Requesting a variable using SNMPv1:
ManagerBase manager = ManagerFactory.CreateVersion1Manager("public");
manager.GetAsync(_Address, 161, "1.3.6.1.2.1.1.1.0", (variables, remoteEndpoint) =>
{
if (variables.Count > 0)
{
MessageBox.Show("Response: " + variables[0].ToString());
}
manager.Close();
});
with SNMPv3:
SnmpUser user = new SnmpUser()
{
Username = "test",
SecurityLevel = SnmpUserSecurityLevel.AuthenticationAndPrivacy,
AuthenticationAlgorithm = SnmpAuthenticationAlgorithm.SHA,
AuthenticationPassword = "SHAPassword",
PrivacyAlgorithm = SnmpPrivacyAlgorithm.AES,
PrivacyPassword = "AESPassword"
};
ManagerBase manager = ManagerFactory.CreateVersion1Manager("public");
manager.GetAsync(_Address, 161, "1.3.6.1.2.1.1.1.0", (variables, remoteEndpoint) =>
{
if (variables.Count > 0)
{
MessageBox.Show("Response: " + variables[0].ToString());
}
manager.Close();
});
Stay tuned for information on how you can get your hands on the BETA. Mmmmmmm juicy mangos.
No comments:
Post a Comment