Difference between revisions of "NXSL:SNMPGetValue"
Jump to navigation
Jump to search
(Created page with "__NOTOC__ Get the object value from specific node with SNMP GET request. The node and all SNMP communication details defined by SNMP transport. This function is similar to [[N...") |
m (Text replacement - "^" to "{{deprecated}}") |
||
(2 intermediate revisions by 2 users not shown) | |||
Line 1: | Line 1: | ||
__NOTOC__ | {{deprecated}}__NOTOC__ | ||
Get the object value from specific node with SNMP GET request. The node and all SNMP communication details defined by SNMP transport. This function is similar to [[NXSL:SNMPGet|SNMPGet]] but returns string instead of an SNMP_VarBind object. | Get the object value from specific node with SNMP GET request. The node and all SNMP communication details defined by SNMP transport. This function is similar to [[NXSL:SNMPGet|SNMPGet]] but returns string instead of an SNMP_VarBind object. | ||
'''Since:''' 1.2.1 | |||
== Syntax == | == Syntax == | ||
Line 17: | Line 19: | ||
== Return Value == | == Return Value == | ||
String with the value requested or | String with the value requested or '''NULL''' on failure. | ||
== Examples == | == Examples == |
Latest revision as of 18:13, 13 September 2022
This Wiki is deprecated and we are are currrently migrating remaining pages into product documentation (Admin Guide, NXSL Guide) |
Get the object value from specific node with SNMP GET request. The node and all SNMP communication details defined by SNMP transport. This function is similar to SNMPGet but returns string instead of an SNMP_VarBind object.
Since: 1.2.1
Syntax
SNMPGetValue(transport,oid);
Parameters
transport SNMP_Transport SNMP transport object. oid SNMP object id.
Return Value
String with the value requested or NULL on failure.
Examples
transport = CreateSNMPTransport(FindObject("MYWORKPC")); // Create SNMP transport for node MYWORKPC
if (transport == null)
return -1; // Failed to create SNMP transport, exit
oid = ".1.3.6.1.2.1.25.1.6.0"; // number of running processes
value = SNMPGetValue(transport, oid);
if (value == null)
return -2; // Failed to issue SNMP GET request to MYWORKPC, exit
else
trace(1, "SNMP GET ".oid."=".value);