1
0
Fork 0
mirror of https://github.com/munin-monitoring/contrib.git synced 2025-07-25 18:38:30 +00:00

v1 used Net::SNMP module, and hard coded snmp v2c. This v2 version uses Munin::Plugin::SNMP which transparently supports all snmp versions.

This commit is contained in:
Tom Feiner 2011-02-23 14:14:39 +01:00 committed by Steve Schnepp
parent 2d5c78a463
commit f00e552b55

View file

@ -125,12 +125,14 @@ my %cpuCounters = (
cpuIdle => "1.3.6.1.4.1.2021.11.11.$cpu", # The percentage of processor time spent idle, calculated over the last minute cpuIdle => "1.3.6.1.4.1.2021.11.11.$cpu", # The percentage of processor time spent idle, calculated over the last minute
); );
my ($session, $error) = Net::SNMP->session( my $session = Munin::Plugin::SNMP->session(-translate =>
-hostname => $host, [ -timeticks => 0x0 ]);
-community => $community,
-port => $port, if (!defined ($session))
-version => "2c" {
); die "Croaking: could not establish SNMP object";
}
if (!defined ($session)) if (!defined ($session))
{ {