RE: Event handler over a remote machine
"Andy" <[email protected]>
| Newsgroups | gmane.network.netsaint.user |
|---|---|
| Message-ID | <000201c25c7e$fdd19240$0501a8c0@asus> |
What I do with my two event handlers that solve problems is have it run
a script locally to check the parameters that I'm passing from Nagios.
define command{
command_name update-asus-ts-portfw
command_line
/usr/local/nagios/libexec/eventhandlers/update-asus-ts-portfw $HOSTNAME$
$HOSTSTATE$ $STATETYPE$ $HOSTATTEMPT$
}
Notice the 2,3,4 params. Those would pass something like [soft,hard]
[ok,down] [1,2,3,4,5,6]
I then have a bash script that looks at the params to see if I need it
to do something. You wouldn't want it to restart your notes server
every time it runs the script. It will run the event handler on every
attempt that is a non-ok state. So the script would look something like
this. Look at the bottom of the page, there is an example script there.
http://nagios.sourceforge.net/docs/1_0/eventhandlers.html
But it bases has some case statements where it checks if it's in a hard
or soft state. If it's in a soft state, it could be just a fluke. So
look at the attempt.
What I have done is on the first attempt where the state is 'hard' I
have it update firewall rules to point my terminal server session to a
different host. I also have another one that on the first 'hard'
attempt, I have it reboot my firewall just in case my cable modem is
flaking out and I need my firewall to reset it.
Hope this helps....
Andy
-----Original Message-----
From: [email protected]
[mailto:[email protected]] On Behalf Of Edgard
Dapás
Sent: Friday, September 13, 2002 10:17 AM
To: [email protected]
Subject: [netsaint] Event handler over a remote machine
Hi !!!
I'm trying to set my first event handler, but i have problem.
I'm checking my Notes on a remote machine with the check_notes command ,
and it's working right
The problem appear when I'm trying to restart the Notes when the result
of
check_notes command is Critical, the command to restart the Notes is
notes_restart.sh
I configure my netsaint machine in this way:
In the hosts.cfg:
command[notes_restart]=$USER1$/check_nrpe!notes_restart.sh $HOSTADDRESS$
-c $ARG1$ $SERVICESTATE$ $STATETYPE$ $SERVICEATTEMPT$
service[dsl101]=NOTES;0;24x7;3;2;1;webpin;120;24x7;1;1;0;notes_restart;c
heck_nrpe!check_notes
But Netsaint is looking for the notes_restart in the local machine and
not
in the remote machine
Error message:
sh: /opt/sfw/lib/netsaint/plugins/check_nrpe!notes_restart.sh: not
founds
Could you send me a example of the best way to configure the remote
execution of a eventhandler?
Thanks
La información contenida en este correo es para uso exclusivo
de
los destinatarios del mismo. Está prohibido a las personas o
entidades
que no sean los destinatarios de este correo, realizar cualquier tipo de
modificación, copia o distribución del mismo.
Si Ud. recibe este correo por error, tenga a bien notificar al emisor
y
eliminarlo.
This email is confidential and intended solely for the use of the
individual to whom it is addressed. Any views or opinions presented are
solely those of the author and do not necessarily represent those of
Personal. If you are not the intended recipient, be advised that you
have
received this email in error and that any use, dissemination,
forwarding,
printing, or copying of this email is strictly prohibited. If you have
received this email in error please contact the sender.(Embedded image
moved to file: pic06724.pcx)
---
Checked by AVG anti-virus system (http://www.grisoft.com).
Version: 6.0.386 / Virus Database: 218 - Release Date: 9/9/2002
-------------------------------------------------------
This sf.net email is sponsored by:ThinkGeek
Welcome to geek heaven.
http://thinkgeek.com/sf