snmp_close()
Close a PATROL Agent SNMP session.
Syntax
snmp_close(session)
Parameter
Parameter | Definition |
---|---|
session | ID of the SNMP session that is to be closed The session is the value returned when an snmp_open() function is executed. |
Description
The snmp_close() function closes session with the PATROL SNMP Sub-Agent that was opened with the snmp_open() function and removes internal structures belonging to session. The snmp_close() function sets the PSL variable errno = 93 (E_PSL_NO_SUCH_ID) if session is not a valid SNMP session ID. T he snmp_close() function returns the string "OK" if successful, or the NULL string otherwise.
Example
The following example opens an SNMP session makes a query to determine what SNMP agent is listening on port 8161 and closes the SNMP session:
session=snmp_open(“runner”,””,””,””,””,”8161”);
print(snmp_get(session,”.1.3.6.1.2.1.1.1.0”));
snmp_close(session);
print(snmp_get(session,”.1.3.6.1.2.1.1.1.0”));
snmp_close(session);
Tip: For faster searching, add an asterisk to the end of your partial query. Example: cert*