[Nagiosplug-help] Re: syntax question check_nrpe & check_disk

Frederik Vanhee frederik.vanhee at perso.be
Tue Sep 7 02:54:04 CEST 2004


Thanks Ian,

but I want to configure everything from my Nagios server. The warning and
critical tresholds for the disk must be configurable from the nagios-server
and not on each host's nrpe.cfg file.

In the mean time, I found the solution. From nrpe 2.0 on, it is possible to
add extra arguments to the check_nrpe plugin with the '-a' option.
So, in my example, I pass 2 extra arguments $ARG2$ and $ARG3$ with the
treshold values for the warning and critical arguments from the check_disk
command.

nrpe.cfg
command[check_disk]=/opt/nrpe/check_disk -w $ARG1$ -c $ARG2$

check_commands.cfg
command_line /opt/nagios/libexec/check_nrpe -H machineA -p 5666 -t 60 -n -c
$ARG1$ -a $ARG2$ $ARG3$

services.cfg
check_command check_nrpe!check_disk!20%!10%

Frederik


----- Original Message ----- 
From: "Ian Masters" <ian at acces.co.jp>
To: <nagiosplug-help at lists.sourceforge.net>
Cc: "Frederik Vanhee" <frederik.vanhee at perso.be>
Sent: Tuesday, September 07, 2004 10:46 AM
Subject: [Nagiosplug-help] Re: syntax question check_nrpe & check_disk


> Try this:
>
> # Service definition
> define service{
>         use                             generic-service         ; Name of
> service template to use
>
>         host_name tom
>         service_description             Disk usage 1 via NRPE
>         ...
>         check_command                   check_nrpe!check_disk
>         }
>
> You're then telling the remote machine to run the check that command with
> the parameters defined on the remote machine.
>
> Hope this helps.
>
> Ian Masters
>
> > I've been configuring nagios for a while and now I want to do some
checks,
> > using NRPE.
> > I want to monitor the disk space of machineA from the monitoring nagios
> > machineB
> >
> > machine A, nrpe.cfg :
> > command[check_disk]=/opt/nrpe/check_disk -w $ARG1$ -c $ARG2$
> >
> > machine B (nagios server), from the command line:
> > check_nrpe -H machineA -p 5666 -t 60 -n -c 'check_disk!20%!10%'
> >
> > this works, because I put quotes around the check_disk command
> > But now, I want it to work in Nagios, so I configure the
check_commands.cfg
> > and the services.cfg file
> >
> > check_commands.cfg
> > # 'check_nrpe' command definition
> > define command{
> > command_name check_nrpe
> > command_line /opt/nagios/libexec/check_nrpe -H machineA -p 5666 -t
60 -n -c
> > $ARG1$
> > }
> >
> > services.cfg
> >
> > # Service definition
> > define service{
> > ...
> > check_command check_nrpe!'check_disk!20%!10%'
> > }
> >
> > But this doesn't work, I get 'no output' in Nagios. Can somebody tell me
how
> > to write the command in services.cfg to obtain a good result. In other
words
> > : how can I pass 'check_disk!20%!10%' to $ARG1$
>
>
>
>
>
>
>
> -------------------------------------------------------
> This SF.Net email is sponsored by BEA Weblogic Workshop
> FREE Java Enterprise J2EE developer tools!
> Get your free copy of BEA WebLogic Workshop 8.1 today.
> http://ads.osdn.com/?ad_id=5047&alloc_id=10808&op=click
> _______________________________________________
> Nagiosplug-help mailing list
> Nagiosplug-help at lists.sourceforge.net
> https://lists.sourceforge.net/lists/listinfo/nagiosplug-help
> ::: Please include plugins version (-v) and OS when reporting any issue.
> ::: Messages without supporting info will risk being sent to /dev/null





More information about the Help mailing list