check_snmp_generic outputs (null) in Nagios, not in cmd.exe

10 posts / 0 new
Last post
Harm
Offline
Last seen: 7 years 6 months ago
Joined: 12.02.2013 - 14:35
check_snmp_generic outputs (null) in Nagios, not in cmd.exe

Hello,

 

I'm trying to get specific SNMP info from a host,
diskusage from an ESXi server to be exact.

I have been struggling to get this check_snmp_generic plugin from
exchange.nagios.org to work in Nagwin.
I have already put other perl plugins in Nagwin which work fine.

I can run check_snmp_generic.pl just fine from the command prompt,
but when I put it in Nagwin, I get a red critical line, and (null) as output.

I already tried various changes in my commands.cfg and host.cfg, I also carefully
re-typed the configs, but no avail.
I also tried pl2bat to run the plugin as a bat,
that returns a yellow warning line in Nagwin, also with (null) as output.

 

I just don't get why the plugin won't work in Nagwin,
but runs just fine in the command prompt and also in the Nagwin bash.

itefix
Offline
Last seen: 3 hours 34 min ago
Joined: 01.05.2008 - 21:33
Try to give the service

Try to give the service account admin privileges.

Harm
Offline
Last seen: 7 years 6 months ago
Joined: 12.02.2013 - 14:35
Thanks for the reply

Thanks for the reply tk,
however, Nagwin already runs with admin privileges.

Is there a way that I can see "verbose" output from the plugin running in Nagwin,
or any more details about the execution of the plugin than just null?

itefix
Offline
Last seen: 3 hours 34 min ago
Joined: 01.05.2008 - 21:33
Have a look at var/log

Have a look at var/log directory. Stdout and stderr log files for Nagwin can give you some hints.

Harm
Offline
Last seen: 7 years 6 months ago
Joined: 12.02.2013 - 14:35
The nagios-stderr.log file

The nagios-stderr.log file indeed has some extra info:

Can't open perl script "/plugins/check_snmp_generic.pl": No such file or directory

But the plugin name is correct.

I'm now trying different solutions:
- Entering full path in commands.cfg;
- Changing Perl path on top of pl script;
- ...

Nothing seems to be working so far.

itefix
Offline
Last seen: 3 hours 34 min ago
Joined: 01.05.2008 - 21:33
Can you publish your plugin

Can you publish your plugin and service/command definitions you use ?

Harm
Offline
Last seen: 7 years 6 months ago
Joined: 12.02.2013 - 14:35
Here's the plugin I

Here's the plugin I use,
here's the command:
# Check SNMP Generic command definition
define command{
    command_name   check_snmp_generic
    command_line      $USER1$/check_snmp_generic.pl -H $HOSTADDRESS$ -N "-v 2c -c public" -d $ARG1$ -l $ARG2$ -u $ARG3$ -w $ARG4$ -c $ARG5$ $ARG6$
}

Here's the service:
define service{
    use                       generic-service
    host_name            VMware ESXi 01
    service_description  Diskusage Disk 2
    check_command     check_snmp_generic!Usage:!usage!MB!55000!58000!1.3.6.1.2.1.25.2.3.1.6.2
}

And here's the full command + output in cmd:
C:\Program Files (x86)\Nagwin\plugins>check_snmp_generic.pl -H 0.0.0.0 -N "-v 2c -c public" -d "Usage:" -l usage -u MB -w 55000 -c 58000 1.3.6.1.2.1.25.2.3.1.6.2
OK - Usage: 38954MB | usage=38954MB;55000;58000;;

itefix
Offline
Last seen: 3 hours 34 min ago
Joined: 01.05.2008 - 21:33
A copy or a link to the

A copy or a link to the pluging itself will be fine.

Harm
Offline
Last seen: 7 years 6 months ago
Joined: 12.02.2013 - 14:35
Here's a direct link to the
Harm
Offline
Last seen: 7 years 6 months ago
Joined: 12.02.2013 - 14:35
Have you been able to spot

Have you been able to spot the problem, tk? Does the plugin work for you?
Do you maybe know of an alternative script to monitor VMware diskusage in Nagios?