check_hpjd plugin in Plugins 1.4
Edward MacGillivray
mac at biviumcorp.com
Fri Feb 18 19:59:19 CET 2005
On Friday 18 February 2005 12:36 pm, Andreas Ericsson wrote:
> Edward MacGillivray wrote:
> > Sorry to be replying to my own message, but I've did some more research
> > into the differences between the three versions (1.4alpha2, 1.4, and the
> > new test version). I've found that the command_line variables are being
> > filled in the following ways:
> >
> > 1.4alpha2:
> > sprintf (command_line, "%s -m : -v 1 -c %s %s %s", PATH_TO_SNMPGET,
> > community,
> >
> > 1.4
> > sprintf (command_line, "%s -OQa -m : -v 1 -c %s %s %s", PATH_TO_SNMPGET,
> > community,
> >
> > new-test
> > sprintf (command_line, "%s -Oqa -m : -v 1 -c %s %s %s", PATH_TO_SNMPGET,
> > community,
> >
> > Then I looked again at snmpget (or actually snmpcmd) and was not able to
> > find the option -Oa. I also don't see the option -OQ, which is in the
> > newest one that I can compile. I changed the 1.4 version that I have to
> > -Ovq (the options that Andreas asked about), and after compiling with
> > this mods the plugin doesn't have the error output from snmpget. However
> > the plugin only prints a '0' and the exit value of the plugin is 3, so I
> > don't know that this "worked".
>
> It doesn't. The logic that parses the snmpget output assumes that there
> is text in a certain sequence prior to the actual value.
>
> > So I then took the -O snmpget options out completely and recompiled.
> > After doing this the plugin puts 'Printer ok - ("")' on stdout and has an
> > exit value of 0, which is what happens with the 1.4alpha2 version.
>
> This is also busted. The logic expects the MIB-description of the OID
> and an equal sign, which is impossible to get with ucd-snmp and net-snmp
> < 5.0.2. It's just poorly coded, that's all. What happens if you run
> snmpget -Ovq on the target? If that works, then at least I know that
> much. The "errors" being undefined is an easy fix, so long as I know the
> rest of the code is sound.
Hi Andreas and thanks,
When I do:
# snmpget -Ovq -m : -v 1 -c public <hostname>
or
# snmpget -Ovq <hostname>
I get the usage information for snmpget, so it doesn't even do any snmp
communication, right? So I then copied the source file and made a shell
script from the stuff it had and ran the full command with the OIDs and all
like:
# snmpget -Ovq -m : -v 1 -c public <hostname> <all the OIDs>
Which did actually work. I got twelve lines of output (there were 12 OIDs in
the command) with all but the last one being '0', and the last one was two
double quotes. So I think the -Ovq will be fine, so long as the OIDs are
there.
again, thanks
mac
-------------------------------------------------------
SF email is sponsored by - The IT Product Guide
Read honest & candid reviews on hundreds of IT Products from real users.
Discover which products truly live up to the hype. Start reading now.
http://ads.osdn.com/?ad_id=6595&alloc_id=14396&op=click
_______________________________________________
Nagios-users mailing list
Nagios-users at lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/nagios-users
::: Please include Nagios version, plugin version (-v) and OS when reporting any issue.
::: Messages without supporting info will risk being sent to /dev/null
More information about the Users
mailing list