NRPE: Command 'check_disk' not defined

Jonathan Murray jmurray at whoi.edu
Fri Jun 1 20:50:30 CEST 2007


Thanks Sebastian, the error was a result of two machines having the same 
IP address in the hosts.cfg file. As usual, my error. Now that I have 
eliminated my ridiculous oversight, everything is fine.

Thanks for your help, as a result of this process, the checkcommands.cfg 
issue was resolved too.

-Jonathan

Sebastian Ganame wrote:
> Hi John,
>           I think your problem is that you're defining "check_disk_sda5" 
> in your checkcommands.cfg file, while it should be only in your 
> "nrpe.cfg" file in each monitored instance.
>           The only checkcommand you should have for nrpe redirection is 
> the following one:
>  
> /define command{/
> /          command_name      check_nrpe/
> /          command_line         $USER1$/check_nrpe -H $HOSTADDRESS$ -c 
> $ARG1$/
> /}/
>  
>           This tells the system that for each service defined with a 
> check_command like “check_nrpe!...” it should be redirected using that line.
>          
>           After this server side configuration, you should only define 
> the check_disk_sda5 in your target system (the one that would end up 
> reporting the metric), and it should work.
>          
>           Hope you make it with these information.
>           Regards,
>  
> Sebastian Ganame
>  
>  
> -----Original Message-----
> From: Jonathan Murray [mailto:jmurray at whoi.edu]
> Sent: Jueves, 31 de Mayo de 2007 01:47 p.m.
> To: Sebastian Ganame
> Cc: nagios-users at lists.sourceforge.net
> Subject: Re: [Nagios-users] NRPE: Command 'check_disk' not defined
>  
> Interesting. I'm still not getting it, or I'm doing something
> incorrectly. I have other commands set up the same way, and they work:
>  
> for example,
>  
> on nagios "engine"
>  
> in checkcommands.cfg:
>  
> # 'check_disk_c1'
> define command{
>          command_name    check_disk_c1
>          command_line    $USER1$/check_nrpe -H $HOSTADDRESS$ -c
> check_disk_c1
>          }
>  
> in services.cfg:
>  
> define service{
>           use                                   
> generic-service                  ; Name of service template to use
>           host_name                        varuna
>           service_description            Check /raid/c1 space
>           retry_check_interval           2
>           contact_groups                            linux-admin
>           notification_options            w,c,r
>           check_command                          check_disk_c1
>           }
>  
> on machine I am trying to monitor, in /usr/local/nagios/etc/nrpe.cfg:
>  
> command[check_disk_c1]=/usr/local/nagios/libexec/check_disk -w 20 -c 10
> -p /raid
> /c1
>  
> On the web interface, in the status column I see the following:
> varuna Check /raid/c1 space
> OK      05-31-2007 12:21:11        2d 5h 56m 0s          1/3     DISK OK 
> - free space:
> /raid/c1 114527 MB (16% inode=99%):
>  
> So in this case, which is the same as the earlier description, it works.
>    Here the machine being monitored is a debian system, but I didn't
> think that would make such a difference.
>  
> I have also set up the command as you specified, or how I interpreted
> what you specified, I hope I was accurate here:
>  
> Nagios "engine"
> in services.cfg:
>  
> define service{
>           use                                   
> generic-service                  ; Name of service template to use
>           host_name                        paleo
>           service_description            check disk sda5
>           retry_check_interval           2
>           contact_groups                            linux-admin
>           notification_options            w,u,c,r
>           check_command                          
> check_nrpe!check_disk_sda5!20%!10%!/
>           }
>  
> In the above, I don't know what that / is doing after the !, but it was
> in your mail, so I thought it was needed.
>  
> in checkcommands.cfg:
>  
>   'check_disk_sda5'
> define command{
>           command_name    check_disk_sda5
>          command_line    $USER1$/check_nrpe -H $HOSTADDRESS$ -c
> check_disk_sda5
>          }
>  
> On the machine I am trying to get information on the disk sda5,
> command[check_disk_sda5]=/usr/local/nagios/libexec/check_disk -w 20 -c
> 10 -p /dev/sda5
>  
> It would seem here that on the machine being monitored, the command
> "check_disk_sda5" would use the local plugin
> /usr/local/nagios/libexec/check_disk with the options:
> -w 20 -c 10 -p /dev/sda5
>  
> run locally, this is indeed what it seems to do. However, the server
> doesn't seem to use the command I have placed in the nrpe.cfg file.
>  
> On the web interface, this returns, in the "Status" column:
>  
> NRPE v2.7.1
>  
> What do you use for your entries in you checkcommands.cfg for your
> commands? I was under the impression that I had to define the commands
> there and nagios would use them.
>  
> Perhaps these questions are getting too basic?
>  
> Thanks,
>  
> Jonathan
> Sebastian Ganame wrote:
>  > Hi John,
>  >      Your problem is that you're trying to invoke a service that is not
>  > local, thus it shouldn be defined not only in your Nagios server
>  > configuration files, but also in the nrpe.cfg file used when the nrpe
>  > daemon starts on the target machine.
>  >      I'll try to explain just a little bit what I did since I suffered
>  > the same situation:
>  > 
>  >      1) Define a new service in Nagios Engine for monitoring non-local
>  > disks, as follows:
>  > 
>  > define service{
>  >     use                           local-service ;Name of service
>  > template to use
>  >     host_name                /[the servers in which you have nrpe
>  > installed]/
>  > /    /service_description     Remote check disk
>  >     check_command        check_nrpe!check_hda1!20%!10%!/
>  > }
>  >      2) I used check_hda1 instead of check_disk to identify the way I
>  > use this in the target machines. Then you need to include this type of
>  > call in your target machine's nrpe.cfg file, as follows (at the very 
> end):
>  > 
>  > # The following examples use hardcoded command arguments...
>  > command[check_hda1]=/usr/local/nagios/libexec/check_disk -w 20 -c 10 -p
>  > /dev/hda1
>  >      This way, nrpe tells the target machine to call it's
>  > /usr/local/nagios/libexec/check_disk command when the Nagios core engine
>  > calls check_nrpe!check_hda1 on this target machine.
>  > 
>  >      Hope it helps, and most important that you understand what I tried
>  > to tell you ;-)
>  >      Regards,
>  > 
>  > 
>  > Sebastian Ganame
>  > 
>  > 
>  > -----Original Message-----
>  > From: nagios-users-bounces at lists.sourceforge.net
>  > [mailto:nagios-users-bounces at lists.sourceforge.net] On Behalf Of
>  > Jonathan Murray
>  > Sent: Miércoles, 30 de Mayo de 2007 07:49 p.m.
>  > To: nagios-users at lists.sourceforge.net
>  > Subject: [Nagios-users] NRPE: Command 'check_disk' not defined
>  > 
>  > I've been staring at this for a long time, likely pilot error, but maybe
>  > someone has suggestions or sees something I don't...thanks.
>  > 
>  > Nagios server version 2.8, (OS debian)
>  > Nagios plugin version 1.4.7 (Red Hat Enterprise Linux WS release 4)
>  > NRPE version 2.7.1
>  > 
>  > other plugins work (check_swap, check_load)
>  > 
>  > On nagios server:
>  > 
>  > /usr/local/nagios/etc/checkcommands.cfg
>  > 
>  > <-snip->
>  > 
>  > # check_disk
>  > define command{
>  >           command_name    check_disk
>  >          command_line    $USER1$/check_nrpe -H $HOSTADDRESS$ -c 
> check_disk
>  >          }
>  > 
>  > <-snip->
>  > 
>  > On the machine I'm trying to monitor, the one running nrpe 2.7.1 with
>  > the Nagios plugin version 1.4.7 (Red Hat Enterprise Linux WS release 4),
>  > in /usr/local/nagios/libexec/etc/nrpe.cfg:
>  > 
>  > [root at paleo etc]# ls -la
>  > total 28
>  > drwxr-xr-x  2 nagios nagios 4096 May 30 17:03 .
>  > drwxr-xr-x  6 nagios nagios 4096 May 30 17:13 ..
>  > -rwxr-xr-x  1 nagios nagios 7536 May 30 17:03 nrpe.cfg
>  > 
>  > <-snip->
>  > 
>  > command[check_disk]=/usr/local/nagios/libexec/check_disk -w 20 -c 10 -p
>  > /dev/sda5
>  > 
>  > <-snip->
>  > 
>  > when I test it from the server "nagios" it works fine:
>  > 
>  > root at nagios:/usr/local/nagios/libexec# ./check_nrpe -H paleo -c 
> check_disk
>  > DISK OK - free space: / 201921 MB (93% inode=99%);|
>  > /=14918MB;228424;228434;0;22 8444
>  > 
>  > on the system running nrpe "paleo":
>  > 
>  > [root at paleo etc]# /usr/local/nagios/libexec/check_disk -w 20 -c 10 -p
>  > /dev/sda5
>  > DISK OK - free space: / 201921 MB (93% inode=99%);|
>  > /=14918MB;228424;228434;0;228444
>  > 
>  > If NRPE, Command 'check_disk' not defined as the web interface reports,
>  > then where should it be defined? I thought I needed to define the
>  > command in the checkcommands.cfg on the server, then define the command
>  > on the client that is running nrpe daemon.
>  > 
>  > thanks for any ideas,
>  > 
>  > Jonathan Murray


-------------------------------------------------------------------------
This SF.net email is sponsored by DB2 Express
Download DB2 Express C - the FREE version of DB2 express and take
control of your XML. No limits. Just data. Click to get it now.
http://sourceforge.net/powerbar/db2/
_______________________________________________
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