Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Bug in Net::SNMP forces to use parameter in snmp plugins' requirements #1073

Open
alejandroscf opened this issue Apr 22, 2020 · 2 comments
Open

Comments

@alejandroscf
Copy link
Contributor

While working in a plugin #1049 I found what looks like a bug in the Perl library Net::SNMP that makes that no error is thrown when trying to reach an inaccessible OID, when using SNMPv2c.
You can find detailed information in the bug report.

munin-node-configure is capable of populate the available plugins for an snmp host.
In order to do that it launch the plugin with the snmpconf parameter and the plugin return as many lines as required OIDs with the following structure:

require {OID} [{filter}]

  • The the word 'require'.
  • The OID.
  • An optional parameter a filter in the form of an regular expression.

Then that OIDs are queried and if the filter parameter was set, the output is checked against that regular expression, if not if the OID is inaccessible the SNMP library throws an 'noSuchName(2)' error and that plugin is not suggested.

But the combination of the snmp sessions options (translate=0) and using an SNMPv2c device (version = "v2c" ) has an unexpected result.
The bug of the Net::SNMP library makes that no error is thrown and the response is defined but equal to an empty string, so here you have no way of knowing if the OID has answered an empty string or that OID is not available.

That makes that the plugin being suggested for any snmp device using SNMP v2c regardless of the OID being accessible or not.

Until the bug in the perl library is solved the workaround (already used in many snmp plugins) is use the filter parameter to check that the value returned is not empty using something like
print "require $OID ^\\d\n"; instead of print "require $OID\n";

@github-actions
Copy link

Stale issue message

@alejandroscf
Copy link
Contributor Author

This bug should be open, as the upstream bug has not been solved.

@steveschnepp steveschnepp reopened this Apr 27, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Development

No branches or pull requests

2 participants