<!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.1170" name=GENERATOR>
<STYLE></STYLE>
</HEAD>
<BODY bgColor=#ffffff>
<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></BODY></HTML>