SNMP GET
The SNMP GET functions allow the rules file to retrieve SNMP variables from an SNMP agent.
There
are two functions for each version
of SNMP; one without a _p
suffix and one with the
suffix. The form without the suffix (for example, snmpget
)
uses the default port number 161. The form with the suffix (for example, snmpget_p
)
uses the port number on the SNMP agent specified by the Port property.
When using the form without the suffix in the rules file, you must include the port number with the IP address of the host, preceded by a colon.
The syntax of the functions is different for each version of SNMP.
SNMP V1
$value = snmpget($hostname, $OID, $community)
$value = snmpget_p($hostname, $OID, $community, $port)
SNMP V2c
$value = snmpget_v2c($hostname, $OID, $community)
$value = snmpget_v2c_p($hostname, $OID, $community, $port)
SNMP V3
$value = snmpget_v3($hostname, $userid, $OID)
$value = snmpget_v3_p($hostname, $userid, $OID, $port)