snmp__if plugin does not work if server only supports 32 bit counters

Bug #851625 reported by pneu
12
This bug affects 2 people
Affects Status Importance Assigned to Milestone
munin
New
Unknown
munin (Debian)
Fix Released
Unknown
munin (Ubuntu)
Triaged
Low
Unassigned

Bug Description

The plugin actually supports 32 bit counter as well as 64 bit counter. However, if the snmp server you are connecting to does not support 64 bit byte counters, snmp__if fails.

When I tried to the snmp server which supports only 32 bit counter, the plugin returned as follows:
#munin-run snmp_hostname_if_1
recv.value noSuchObject
send.value noSuchObject

Here is an example of problems I found in the code.

# from line 244
if (defined ($response = $session->get_single($ifEntryIn64Octets) ||
                  $session->get_single($ifEntryInOctets))) {
    print "recv.value ", $response, "\n";
}

In these lines, "$session->get_single($ifEntryIn64Octets" is supposed to return undefined value if the server doesn't support 64 bit counter. However, it actually returns "noSuchObject".

So, these lines should be fixed like this:

if (defined($response = $session->get_single($ifEntryIn64Octets))){
 if ($response eq 'noSuchObject'){
  # 64 bit counter is not supported
  $response = $session->get_single($ifEntryInOctets);
 }
} else {
 # No response
 $response = 'U';
}
print "recv.value ", $response, "\n";

# The information about my environment

Description: Ubuntu 10.04.3 LTS
Release: 10.04

munin-node:
  Installed: 1.4.4-1ubuntu1
  Candidate: 1.4.4-1ubuntu1
  Version table:
 *** 1.4.4-1ubuntu1 0

Revision history for this message
pneu (pneu) wrote :

I found this topic should be discussed at the original munin site. So, I'll work on this bug there.

Revision history for this message
Dave Walker (davewalker) wrote :

@tome, please can you link to where it is being discussed upstream?

Thanks.

Changed in munin (Ubuntu):
status: New → Incomplete
importance: Undecided → Low
Revision history for this message
pneu (pneu) wrote :

Here's the link to the thread I posted in Munin site.
http://munin-monitoring.org/ticket/1143

I also drafted a patch and posted it.

Changed in munin:
status: Unknown → New
Changed in munin (Ubuntu):
status: Incomplete → Triaged
summary: - snmp__if plugin does not work
+ snmp__if plugin does not work if server only supports 32 bit counters
Changed in munin (Debian):
status: Unknown → Confirmed
Revision history for this message
Stefan Leitner (sleitner-i) wrote :

There is a second bug, if the snmp server doesn't support the alias name entry (1.3.6.1.2.1.31.1.1.1.18.x) of the SNMPv2 , the function returns "noSuchObject"

# from line 162
my $alias = $session->get_single($ifEntryAlias) ||
    $session->get_single($ifEntryDescr) ||
    "Interface $iface";

# a possible fix:
my $alias = $session->get_single($ifEntryAlias);
if ($alias eq 'noSuchObject'){
    $alias = $session->get_single($ifEntryDescr) ||
    "Interface $iface";
}

Revision history for this message
Stefan Leitner (sleitner-i) wrote :

I have to correct myself, the fix should be:

    my $alias = $session->get_single($ifEntryAlias);
    if ((!(defined ($alias))) or ($alias eq 'noSuchObject')){
        $alias = $session->get_single($ifEntryDescr) || "Interface $iface";
    }

Revision history for this message
Clint Byrum (clint-fewbar) wrote : Re: [Bug 851625] Re: snmp__if plugin does not work if server only supports 32 bit counters

Excerpts from Stefan Leitner's message of Thu Mar 01 11:28:55 UTC 2012:
> There is a second bug, if the snmp server doesn't support the alias name
> entry (1.3.6.1.2.1.31.1.1.1.18.x) of the SNMPv2 , the function returns
> "noSuchObject"
>

Stefan, perhaps you should report this bug separately?

Changed in munin (Debian):
status: Confirmed → Fix Released
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.