#include <qtossapi.h> int disconnectSNMP( char *queue_name, char *lib_name, long int timeout );
The disconnectSNMP() function ends the logical connection between the SNMP subagent and the i5/OS SNMP agent.
So that the subagent can receive messages from the SNMP agent, the following conditions must be met:
0 | Immediate disconnect, independent of whether or not the SNMP agent is available or has responded |
> 0 | The number of seconds to wait (maximum is 2 147 483 647) |
Any other values result in an error return code.
The indicated return values are defined in the <qtossapi.h> file.
0 | snmpsa_RC_ok
The disconnectSNMP() function was successful. |
-1 | snmpsa_RC_err
An exception occurred. Check the subagent job log for the exception information, correct the condition, and resubmit the subagent job. (This return code is only used when a more specific return code is not available.) |
-2 | snmpsa_RC_noagent
The SNMP agent is not available. |
-3 | snmpsa_RC_mismatch
There is a code-level mismatch between the agent and the subagent. If this occurs, report the problem to the appropriate service organization. |
-4 | snmpsa_RC_timedout
The specified timeout value was exceeded. |
-7 | snmpsa_RC_parmerr
A parameter error occurred. This is more likely caused by errors in the value of a parameter (for example, a value was too large or too small) or by a pointer parameter that has a NULL value and should not. For char* parameters, it may also be caused if the length of the string exceeds some limit. |
-8 | snmpsa_RC_lengtherr
During an attempt to communicate with the agent, a length exception occurred. See any messages in the job log and correct any errors that are indicated, then retry the operation. |
-9 | snmpsa_RC_buffer
An internal buffer was not obtained. See any messages in the job log and correct any errors that are indicated, then retry the operation. |
-14 | snmpsa_RC_sync
A synchronization problem occurred between the agent and subagent. If this occurs, report the problem to the appropriate service organization. |
For more information, see "SNMP Subagent Problem Determination" in the Simple Network Management Protocol (SNMP) Support book.
The disconnectSNMP() function ends the logical connection between the SNMP agent and a subagent. This is normally the last subagent API that a subagent calls.
See Code disclaimer information for information pertaining to code examples.
#include <qtossapi.h> int rc; rc = disconnectSNMP( "QABCDEFG", "LIBABC", 0 ); if (rc) { /* Handle exception. */ }
Top | UNIX-Type APIs | APIs by category |