Page 1 of 1

Dhcpd-pools - NRPE - Unable to read output

Posted: Tue Feb 18, 2014 4:36 am
by BassDudu
Hi everybody,

I have some trouble with "dhcpd-pools" plugin.

If I understand correctly, this plugin doesn't need an IP to join the DHCP server, so we need to use NRPE plugin to access the DHCP server...
If it's correct, I did it but the response is an error :
NRPE - Unable to read output

commands.cfg

Code: Select all

define command{
                   command_name    dhcpd-pools
                   command_line    $USER1$/dhcpd-pools -L $ARG1$ -c $ARG2$ -l $ARG3$
}
Services.cfg

Code: Select all

define service{
                   use generic-service
                   host_name Srv2
                   service_description DHCP leases
                   check_command check_nrpe!dhcpd-pools
}
check_nrpe is working for other services, so I suppose he is good.
Say me if you need more informations...

Re: Dhcpd-pools - NRPE - Unable to read output

Posted: Tue Feb 18, 2014 2:49 pm
by lmiltchev
If you are using nrpe, you need to have the command defined in the nrpe.cfg file. You may have something like this:

Code: Select all

command[dhcpd-pools] = /usr/local/nagios/libexec/dhcpd-pools $ARG1$
Then, you can run on the nagios server:

Code: Select all

./chech_nrpe -H <IP> -c dhcpd-pools -a '-L <arg 1> -c <arg 2> -l <arg 3>'

Re: Dhcpd-pools - NRPE - Unable to read output

Posted: Tue Feb 25, 2014 3:57 am
by BassDudu
lmiltchev wrote:

Code: Select all

./chech_nrpe -H <IP> -c dhcpd-pools -a '-L <arg 1> -c <arg 2> -l <arg 3>'
Thank you, this command is ok now...

But on Nagios, the error still NRPE : Unable to read output.

I don't specify the arguments for the command dhcpd-pools anywhere... and I don't know where I need to do it...

Re: Dhcpd-pools - NRPE - Unable to read output

Posted: Tue Feb 25, 2014 2:05 pm
by sreinhardt
What result do you get when running check_nrpe from the nagios machine like this? Also what is the result of "echo $?" immidiately after the check_nrpe command?

Re: Dhcpd-pools - NRPE - Unable to read output

Posted: Wed Feb 26, 2014 3:25 am
by BassDudu

Code: Select all

[root]# ./chech_nrpe -H <IP> -c dhcpd-pools -a '-L 01 -c /etc/dhcp/dhcpd.conf -l /var/lib/dhcpd/dhcpd.leases'

All networks       10.0.2.100      - 10.0.2.101     2     0     0.000     2      2    100.000

Code: Select all

[root]# ./chech_nrpe -H <IP> -c dhcpd-pools -a '-c /etc/dhcp/dhcpd.conf -l /var/lib/dhcpd/dhcpd.leases --critical 60 --warning 45 '

OK  Ranges; crit: 0 warn: 0 ok 2 Shared nets; crit: 0 warn: 0 ok: 0
echo $? gives 0 ...

Re: Dhcpd-pools - NRPE - Unable to read output

Posted: Wed Feb 26, 2014 10:54 am
by sreinhardt
I am not sure how this would effect data being returned via nrpe, my guess is it may not. However NRPE does define ; as a nasty metacharacter. Nagios, however does not appear to do the same within the nagios code or configs. However if possible I would suggest removing that from the plugin output, maybe replace with -. Also just to clarify, you are running the second command right? The first does not look like it provides valuable information in a nagios style format, but I also have not run the plugin myself.