[Nagiosplug-devel] SNMP authentication for plugins

atonns at mail.ivillage.com atonns at mail.ivillage.com
Mon Sep 16 07:42:03 CEST 2002


I'm in the process of writing a few plugins in perl that use Net::SNMP to
monitor certain elements of the net-snmpd host resources mib and possibly
some custom scripted mibs. One thing I've noticed is that all the
snmp-related scripts use SNMP v1 or v2c for getting data from the clients -
which is why I am re-writing them. I want to use SNMP v3, especially using
the 'snmpkey' script that comes with the Net::SNMP perl module. (FYI: I
can't get SNMP::Session to compile on Solaris 9)

With SNMP v3, it's not very wise to put authpassword and privpassword data
on the command line of a check script. Right now I have my authentication
info embedded in the script. However, if I plan to share my scripts with the
community, there has to be a simpler method for authentication - no
'end-user' (including myself) wants to edit every check script for
authentication.

I propose one of two solutions:

Easy - create an snmpauth.pm module to put in the libexec dir. It contains
only simple constructor that creates a Net::SNMP->session object with the
authentication info embedded in it. I will only be used by modules that need
it.

Hard - modify utils.pm to include a similar constructor, but reads
authentication info from some config file. Obviously if Net::SNMP isn't
present this sub shouldn't cause the utils module to barf.

However, the whole reason I'm posting this to the list is to solicit
opinions or hear other people's solutions (including ones I might have
missed already included in docs / plugins).

P.S. I'm using the netsaint 1.2.9-4 plugins because I couldn't get the
autoconf/autoheader/automake/configure/make thing working on Solaris 9 with
Sun's SFW crap. However, I have been reading the documentation and source
for the 1.3-beta1 plugins for tips and coding conventions.

--
"Computer science is as much about computers as
        astronomy is about telescopes" -- Edsger Dijkstra
---------------------------------------------------------
Anthony Tonns, UNIX Administrator - atonns at mail.ivillage.com
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://www.monitoring-plugins.org/archive/devel/attachments/20020916/d6901b0d/attachment.html>


More information about the Devel mailing list