SNMP Support
Agent plugins are able to communicate with remote devices using the Simple Network Management Protocol (SNMP) with the built-in SnmpSupport class, accessible through the Snmp property.
IsConnected
Determines whether the SNMP system is connected and authenticated.
Connect (SNMP v2)
It is recommended to use the existing connection, however if the SNMP system is not already connected the following method can be used to connect to the SNMP host. The community string will be stored in the code of the plugin in plain text.
SnmpSettings settings = new SnmpSettings();
settings.CommunityStrings.Add("public");
Snmp.Connect("devicename");
Connect (SNMP v3)
It is recommended to use the existing connection, however if the SNMP system is not already connected the following method can be used to connect to the SNMP host. The SNMP v3 password will be stored in the code of the plugin in plain text.
SnmpSettings settings = new SnmpSettings();
settings.Version = SnmpSettingsVersion.Three;
settings.Security.AuthenticationPassword.SetPassword("SecurePassword");
settings.Security.AuthenticationProtocol = Snmpv3AuthenticationProtocol.Md5;
settings.Security.PrivacyPassword.SetPassword("SecurePassword");
settings.Security.PrivacyProtocol = Snmpv3PrivacyProtocol.Aes256;
settings.Security.Username = "Snmpv3Username";
Snmp.Connect("devicename");
CommunityString
The currently active community string. This setting is not used for SNMP v3.
Contact
Gets the RFC1213 sysContact for the remote device.
Location
Gets the RFC1213 sysLocation for the remote device.
ObjectIdentifier
Gets the RFC1213 sysObjectID for the remote device.
ItemType
Gets the determined item type of the remote device.
GetByteArray
Gets the System.Byte[] value from the specified OID.
GetInteger
Gets the System.Int32 value from the specified OID.
GetDateTime
Gets the System.DateTime value from the specified OID.
GetGauge
Gets the System.Int64 value from the specified OID.
GetMacAddress
Gets the MAC address as a System.String value from the specified OID.
GetString
Gets the System.String value from the specified OID.
String sysName = Snmp.GetString("1.3.6.1.2.1.1.5.0");
GetTable
Gets the SNMP table from the specified OID.
SnmpTable table = snmp.GetTable("1.3.6.1.2.1.2.2");
foreach (SnmpTableRow row in table.Rows)
{
String interfaceDescription = row.GetString("1.3.6.1.2.1.2.2.1.2");
}
GetTimeTicks
Gets the System.TimeSpan value from the specified OID.
Disconnect
Disconnects from the remote SNMP device. This is done automatically by the system when the scan completes.
Dispose
Disconnects from the remote SNMP device, and disposes of the connection. This is done automatically by the system when the scan completes.
Settings
The settings used to establish the SSH connection.