[Nagios-users]
Sanderson, Andrew
Andrew.Sanderson at ahsys.org
Fri Jul 11 16:48:03 CEST 2003
Thanks for your help
I can make the script work if I hardcode the servername or ip address.
My check command for the event handler looks like this
# 'restart-spooler' command definition
define command{
command_name restart-spooler
command_line /usr/local/nagios/libexec/eventhandlers/restart-spooler.sh
$SERVICESTATE$ $STATETYPE$ $SERVICEATTEMPT$
}
The script I use which is located in the eventhandler directory looks
like this
rsh carling net start \"Spooler\"
This works but only for the one server carling.
What can I change in the scripts for nagios to read a variable instead
so that I can run the same script against multiple nt servers?
I am new to linux and nagios.
Thanks again
Andrew Sanderson.
-----Original Message-----
From: Rob Nelson [mailto:rob at capband.net]
Sent: Friday, July 11, 2003 10:36 AM
To: Sanderson, Andrew; nagios-users at lists.sourceforge.net
Subject: Re: [Nagios-users] [Nagios-users]
>/usr/bin/rsh thentservername net start \"Spooler\"
>
>How can I have nagios enter the servername by reading the value of the
>$HOSTADRESS$ variable ?
Depending on how you have your active directory/nt4 domain structure set
up, they should respond as an IP (as in \\10.10.0.1). If not, you can
make
sure that /etc/hosts is up to date and use a hostname instead of an IP
address for $HOSTADDRESS$. I'd definitely want it to be the former, but
the
latter is a workable solution, just requires a wee bit more maintenance.
Also, if you're passing this to an external command, why not just add
another argument for the servername?
Rob Nelson
Network Administrator, Capitol Broadband
C: 919-369-1874
rob at capband.net
-------------------------------------------------------
This SF.Net email sponsored by: Parasoft
Error proof Web apps, automate testing & more.
Download & eval WebKing and get a free book.
www.parasoft.com/bulletproofapps1
_______________________________________________
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