[Nagiosplug-help] execute cygwin bash script on WIN 2003withcheck_nrpe
Vonnahme, Nathan
nathan.vonnahme at bannerhealth.com
Thu Feb 19 18:50:07 CET 2009
Thanks for the tip; I'm sure I will need to do custom monitoring in
Cygwinland at some point. We have also had success writing NRPE check
plugins in Perl or AutoIt Script on Windows machines.
BTW, I like rxvt, but I've been rocking mintty for cygwin lately, it's
based on PuTTY and it's good.
From: Rick Garland [mailto:Rick.Garland at quantum.com]
Sent: Thursday, February 05, 2009 12:53 PM
To: Nagios Plugin Help List
Subject: Re: [Nagiosplug-help] execute cygwin bash script on WIN
2003withcheck_nrpe
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/20090219/5a1fa73d/attachment.html>
More information about the Help
mailing list