Dhcpd-pools - NRPE - Unable to read output

Support forum for Nagios Core, Nagios Plugins, NCPA, NRPE, NSCA, NDOUtils and more. Engage with the community of users including those using the open source solutions.
Locked
BassDudu
Posts: 3
Joined: Tue Feb 18, 2014 4:18 am

Dhcpd-pools - NRPE - Unable to read output

Post 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...
User avatar
lmiltchev
Bugs find me
Posts: 13589
Joined: Mon May 23, 2011 12:15 pm

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

Post 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>'
Be sure to check out our Knowledgebase for helpful articles and solutions!
BassDudu
Posts: 3
Joined: Tue Feb 18, 2014 4:18 am

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

Post 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...
sreinhardt
-fno-stack-protector
Posts: 4366
Joined: Mon Nov 19, 2012 12:10 pm

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

Post 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?
Nagios-Plugins maintainer exclusively, unless you have other C language bugs with open-source nagios projects, then I am happy to help! Please pm or use other communication to alert me to issues as I no longer track the forum.
BassDudu
Posts: 3
Joined: Tue Feb 18, 2014 4:18 am

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

Post 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 ...
sreinhardt
-fno-stack-protector
Posts: 4366
Joined: Mon Nov 19, 2012 12:10 pm

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

Post 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.
Nagios-Plugins maintainer exclusively, unless you have other C language bugs with open-source nagios projects, then I am happy to help! Please pm or use other communication to alert me to issues as I no longer track the forum.
Locked