Previous topic |
Next topic |
Contents |
Contact z/OS |
Library |
PDF
Debugging the SNMP manager API z/OS Communications Server: IP Programmer's Guide and Reference SC27-3659-02 |
|||||||||||||||
You can debug problems with the SNMP manager API in two ways. For manager applications, call the snmpSetLogLevel() routine
using the following debug levels:
Set the SNMP_MGR_LOG_LEVEL debuglevel environment variable to turn on debugging. This environment variable is read when the snmpInitialize() function is called. You can set multiple trace levels by adding the levels that you want to trace. The SNMP manager API attempts to read the SNMP_MGR_LOG_LEVEL environment variable in the snmpInitialize() function. If your SNMP manager calls the snmpSetLogLevel() function before calling the snmpInitialize() function, all API-generated trace messages in the snmpInitialize() function are logged. If not, logging begins inside the snmpInitialize() function after the environment variable is validated. After the environment variable has been read in the snmpInitialize() function, the value of the environment variable SNMP_MGR_LOG_LEVEL (if set) is used as the log level for your SNMP manager application. After this point, calls to the snmpSetLogLevel() function do not change the log level. You must unset the environment variable for this function to operate correctly. The SNMP manager API, by default, uses the SYSLOG daemon, and uses the current SYSLOG configuration for the output location. However, by declaring the SNMP_MGR_LOG_FILE environment variable, the SNMP manager can also send the output stream to an individual file (in addition to SYSLOG or another logging function). Use the SNMP_MGR_LOG_FILE environment variable to test your application. If the environment variable is declared, the log messages generated by the SNMP manager API are sent to both the file specified by the environment variable and either SYSLOG or your own logging function. You can use your own logging function, rather than the SYSLOG default. Using your own logging function has the benefit of providing the log messages from the SNMP manager API, and your application logging. Your logging function overrides the default, SYSLOG logging function, which means that after you have enabled your logging function in the SNMP manager API, log messages are no longer sent to SYSLOG. If you have declared the SNMP_MGR_LOG_FILE environment variable, log messages are sent to both your logging function and to the file specified by the environment variable. To use your own logging function, your SNMP manager needs
to pass the name of the function as a parameter to the SNMP manager
API's snmpSetLogFunction() routine. Every message produced by the
SNMP manager API is then sent to your logging function, along with
the integer that specifies the level of the log message (for example,
SNMP_LOG_TRACE). Your function definition must be defined as follows
so that the SNMP manager API calls it correctly:
|
Copyright IBM Corporation 1990, 2014
|