[Nagiosplug-help] execute cygwin bash script on WIN 2003 with check_nrpe

Rick Garland Rick.Garland at quantum.com
Tue Feb 3 05:13:33 CET 2009

Yes, here I am again.


Nagios 3.x on CentOS


I have the NRPE-NT working and I can use check_nrpe and get a response
of the test.cmd script that is included in the download.

check_nrpe -H <hostname> -c check_hallo

And it works fine when I put it into nagios for checking as well.



I write my scripts in UN*X shell and I run the script under cygwin. From
the cygwin command line my custom script works fine.

If I try to run it from a DOS window it is not an internal command, it
is not recognized. So when I use the check_nrpe against it I get
"NRPE_NT failed to create process, exiting..."


How can I have a UN*X shell script, that runs under cygwin, run under
the NRPE_NT process.


The script is a short simple script - no warnings or critical alerts
needed. Just going to keep track and the usage of scratch tapes within



export PATH

NUM=vmquery -b -pn Scratch | awk '{if (($5 != "-")) print $0 | sed
'1,3d' | wc -l

echo "Number of scratch tapes = $NUM"


I will add the WARN/CRIT & stats collection for graphing once I get this


The services.cfg entry is;

            define service{

                        use                               ADEN

                        host_name                    backup_server

                        service_description         NBU SCRATCH TAPES

                        check_command           check_nrpe!check_scratch

                        check_period                 24x7

                        max_check_attempts     3

                        notification_interval         480

                        notification_period          workhours

                        notification_options        w,c,u

                        contact_groups              Denver



The commands.cfg is;

            define command{

                        command_name            scratch

                        command_line               $USER1$/check_scratch
-H $HOSTADDRESS$ -C 'e:\cygwin\bin\bash -l check_scratch'



>From a CMD window on the WIN 2003 serverI can execute e:\cygwin\bin\bash
-l check_scratch and get the result. But I am going bonkers trying to
make it work within nagios.


Many thanks




Rick Garland

Sr System Administrator

Quantum, Corp.

8560 Upland Dr.

Englewood, CO  80112


office   720-249-5984

cell      720-210-4671

rick.garland at quantum.com


The information contained in this transmission may be 
confidential. Any disclosure, copying, or further 
distribution of confidential information is not permitted 
unless such privilege is explicitly granted in writing by 
Quantum Corporation. Furthermore, Quantum Corporation is not 
responsible for the proper and complete transmission of the 
substance of this communication or for any delay in its 
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://www.monitoring-plugins.org/archive/help/attachments/20090202/128a0a04/attachment.html>

More information about the Help mailing list