<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<HTML><HEAD>
<META http-equiv=Content-Type content="text/html; charset=iso-8859-1">
<META content="MSHTML 6.00.2800.1126" name=GENERATOR>
<STYLE></STYLE>
</HEAD>
<BODY bgColor=#ffffff>
<DIV><FONT face=Arial color=#0000ff size=2><SPAN class=859334921-05082003>No,
user arguments can not be passed to Nagios event handlers. Look under the Event
Handler columns on this page.</SPAN></FONT></DIV>
<DIV><FONT face=Arial color=#0000ff size=2><SPAN
class=859334921-05082003></SPAN></FONT> </DIV>
<DIV><FONT face=Arial color=#0000ff size=2><A
href="http://nagios.sourceforge.net/docs/1_0/macros.html">http://nagios.sourceforge.net/docs/1_0/macros.html</A></FONT></DIV>
<DIV><FONT face=Arial color=#0000ff size=2></FONT> </DIV>
<DIV><FONT face=Arial color=#0000ff size=2><SPAN class=859334921-05082003>hope
this helps</SPAN></FONT></DIV>
<DIV><FONT face=Arial color=#0000ff size=2><SPAN
class=859334921-05082003>-anurag</SPAN></FONT></DIV>
<DIV><FONT face=Arial color=#0000ff size=2></FONT> </DIV>
<BLOCKQUOTE dir=ltr style="MARGIN-RIGHT: 0px">
<DIV class=OutlookMessageHeader dir=ltr align=left><FONT face=Tahoma
size=2>-----Original Message-----<BR><B>From:</B>
nagios-users-admin@lists.sourceforge.net
[mailto:nagios-users-admin@lists.sourceforge.net]<B>On Behalf Of </B>Justin
Matlock<BR><B>Sent:</B> Tuesday, August 05, 2003 2:29 PM<BR><B>To:</B>
nagios-users@lists.sourceforge.net<BR><B>Subject:</B> [Nagios-users]
event_handler arguments ($ARG1$)<BR><BR></FONT></DIV>
<DIV><FONT face=Arial size=2>Regarding Nagios 1.1:</FONT></DIV>
<DIV><FONT face=Arial size=2></FONT> </DIV>
<DIV><FONT face=Arial size=2>I've tried a number of things, but it appears
that event_handler's can't use user supplied arguments. I'm trying to
use a generic event_handler script to switch dynamic DNS entries around (so if
something goes terribly wrong on a website, it switches DNS to point to a
"sorry, we're down" web page hosted elsewhere). </FONT></DIV>
<DIV><FONT face=Arial size=2></FONT> </DIV>
<DIV><FONT face=Arial size=2>The only way I can make it work is to make
individual event_handlers for each service... which is really a pain in the
butt. </FONT></DIV>
<DIV><FONT face=Arial size=2></FONT> </DIV>
<DIV><FONT face=Arial size=2>Do event_handlers not support ARG1, ARG2,
etc?</FONT></DIV>
<DIV><FONT face=Arial size=2></FONT> </DIV>
<DIV><FONT face=Arial size=2>Here's my event handler itself:</FONT></DIV>
<DIV><FONT face=Arial size=2></FONT> </DIV>
<DIV><FONT face=Arial size=2>define command
{<BR> command_name
switch_dns<BR>
command_line
/usr/local/nagios/libexec/eventhandlers/switch_dns $SERVICESTATE$ $STATETYPE$
$SERVICEATTEMPTS$ $ARG1$ $ARG2$ $ARG3$<BR>}</FONT></DIV>
<DIV><FONT face=Arial size=2></FONT> </DIV>
<DIV><FONT face=Arial size=2>My shell script just takes the hostname
($4), and changes the IP to $5 if the SERVICESTATE is OK, and to $6 if it's
CRITICAL. </FONT></DIV>
<DIV><FONT face=Arial size=2></FONT> </DIV>
<DIV><FONT face=Arial size=2>Then the service that points to it:</FONT></DIV>
<DIV><FONT face=Arial size=2></FONT> </DIV>
<DIV><FONT face=Arial size=2>define service {</FONT></DIV>
<DIV><FONT face=Arial size=2> ; lots of
stuff removed for readability</FONT></DIV>
<DIV><FONT face=Arial size=2>
event_handler
switch_dns!website.com!111.111.111.111!222.222.222.222</FONT></DIV>
<DIV><FONT face=Arial size=2>}</FONT></DIV>
<DIV><FONT face=Arial size=2></FONT> </DIV>
<DIV><FONT face=Arial size=2>Nagios chokes when I do a
verify:</FONT></DIV><FONT face=Arial size=2>
<DIV><BR>Checking services...<BR>Error: Event handler command
'switch_dns!website.com!111.111.111.111!222.222.222.222' specified in service
'image server' for host 'imgserv' not defined anywhere</DIV>
<DIV> </DIV>
<DIV>Any ideas, or am I going to have to define individual
event_handlers?</DIV>
<DIV> </DIV>
<DIV>Thanks;</DIV>
<DIV>Justin</DIV>
<DIV> </DIV>
<DIV></FONT> </DIV></BLOCKQUOTE></BODY></HTML>