The SnmpContext class specifies a "context" for SNMP traffic. SNMP objects start
with SnmpContext because all of the other SNMP classes need the context to perform
their function.
Constructor
var context = SnmpContext( int protocolVersion, String ipAddress, String port ) protocolVersion must be 1, 2, or 3. If no port is specified, 161 is used by default.
Properties
Name | Type | Description |
community | String | The community string for v1 or v2 SNMP |
userName | String | The v3 user name |
engineId | String | The v3 engine ID as a string |
Methods
Return Value | Name | Description |
void | authinfo( String protocol , String password ) | Specifies the encryption protocol (HMAC-MD5, HMAC-SHA) and password for v3 authorization |
void | privacy( String password ) | Sets the privacy password for v3 encryption. Currently only CBC-DES is supported. |
Sample usage
var context = new SnmpContext( 2, “1.2.3.4”, 161 ); context.community = “public”;