snmp_agent_start()

Start the PATROL SNMP Sub-Agent.

Syntax

snmp_agent_start()

Parameter

This function does not accept any parameters.

Description

The snmp_agent_start() function starts the PATROL SNMP Sub-Agent listening for SNMP requests. If the snmp_agent_start() function is issued and the PATROL SNMP Sub-Agent is already running, the snmp_agent_start() function has no effect. 

The snmp_agent_start() functio n returns the string OK if successful, or the string ERR if an SNMP master agent is not running.

Example

The following example checks the output from snmp_agent_config() function for the text "SNMP support is not active." If the text is found, SNMP support is not active, and the snmp_agent_start() function is used to start the PATROL SNMP Sub-Agent. The return value of the snmp_agent_start() function is checked for the string OK to verify that the PATROL SNMP Sub-Agent started:

if (grep("SNMP support is not active.",snmp_agent_config())) {
if (snmp_agent_start() == "OK") {
print("Patrol SNMP sub-agent started.\n");
} else {
print("Patrol SNMP sub-agent failed to start.\n");
print("Make sure the SNMP Master Agent is running.\n");
}
}


Was this page helpful? Yes No Submitting... Thank you

Comments