[Nagiosplug-help] execute cygwin bash script on WIN 2003 withcheck_nrpe
Rick Garland
Rick.Garland at quantum.com
Thu Feb 5 22:52:59 CET 2009
And 1 last comment, using the rxvt helps a lot!
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
________________________________
From: Rick Garland [mailto:Rick.Garland at quantum.com]
Sent: Monday, February 02, 2009 9:14 PM
To: Nagios Plugin Help List
Subject: [Nagiosplug-help] execute cygwin bash script on WIN 2003
withcheck_nrpe
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.
check_nrpe!check_hallo
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
Netbackup.
#!/bin/bash
PATH=$PATH
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
working.
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 receipt.
________________________________
-----------------------------------------------------------
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
receipt.
------------------------------------------------------------
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://www.monitoring-plugins.org/archive/help/attachments/20090205/ce10b43e/attachment.html>
More information about the Help
mailing list