Thread SNMP v3 (6 answers)
Opened by draekster at 2009-06-11 13:27

Gast draekster
 2009-06-11 14:21
#122449 #122449
jez hab ich
ERROR: Time synchronization failed during discovery.

das schein jez am authpassword zu liegen

Code: (dl )
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
   use strict;
use Net::SNMP;

open(IPs, "<ip.txt");
while(<IPs>)
{
my ($session, $error) = Net::SNMP->session(
-hostname => $_,
-port => 161,
#-community => 'public',
-version => 'snmpv3',
-username => 'derBlob',
-authpassword => 'blob234blob234blob234',
-authprotocol => 'md5'
);

if (!defined($session)) #Prüfung ob die Sitzung funktioniert
{
printf("ERROR: %s.\n", $error);
exit 1;
}

my $OID = '1.3.6.1.2.1.1.5.0';

my $result = $session->get_request(
-varbindlist => [$OID]
);

printf "Mit der OID: $OID kommt man zu $result->{$OID}\n";

$session->close;

}
close(IPs);

View full thread SNMP v3