Replacing snmp_sess_perror by snmp_log

André Hartmann <[email protected]>
Newsgroups gmane.network.net-snmp.user
Organization iseg Spezialelektronik GmbH
Message-ID <[email protected]>
Hello,

I've build a library that wraps user functions to SNMP calls using 
net-snmp as a back-end.

If now have a customer that wants all errors to be printed to a log 
file. I found out, that snmp_log is able to do this.

My error handling is similar to the examples provided by net-snmp, but I 
replaced the fprintf(stderr) by snmp_log(LOG_ERR):

      if (status == STAT_SUCCESS)
        snmp_log(LOG_ERR, "Error in packet\nReason: %s\n",
                snmp_errstring(response->errstat));
      else
        snmp_sess_perror("snmpget", ss);

I now wonder what to do with the snmp_sess_perror(). They may contain 
useful information, but as far as I can see there is no way to just get 
the formated output string.

Is there a way to redirect this function (and maybe other 
net-snmp-outputs) to an user-selectable file?

A second question arises: the priority seems to allow to filter what 
appears in the log file, but how do I set the priority?

Best regards,
Andre

------------------------------------------------------------------------------
Introducing Performance Central, a new site from SourceForge and 
AppDynamics. Performance Central is your source for news, insights, 
analysis and resources for efficient Application Performance Management. 
Visit us today!
http://pubads.g.doubleclick.net/gampad/clk?id=48897511&iu=/4140/ostg.clktrk
_______________________________________________
Net-snmp-users mailing list
[email protected]
Please see the following page to unsubscribe or change other options:
https://lists.sourceforge.net/lists/listinfo/net-snmp-users
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.