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:
parent
2d5c78a463
commit
f00e552b55
1 changed files with 8 additions and 6 deletions
|
@ -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))
|
||||||
{
|
{
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue