<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 3.2//EN">
<HTML>
<HEAD>
<META HTTP-EQUIV="Content-Type" CONTENT="text/html; charset=iso-8859-1">
<META NAME="Generator" CONTENT="MS Exchange Server version 5.5.2653.12">
<TITLE>eventhandler arguments?</TITLE>
</HEAD>
<BODY>
<P><FONT SIZE=2 FACE="Arial">hi all!</FONT>
<BR><FONT SIZE=2 FACE="Arial">did anyone ever try to execute eventhandlers with arguments? the verification of the config-files fails if the eventhandler has parameter.</FONT></P>
<P><FONT SIZE=2 FACE="Arial">below you can see my configuration of a nrpe-restart-eventhandler, iŽd like to pass the hostname (that functions) and a free-defined name of the nrpe-configuration file (per host)</FONT></P>
<P><FONT SIZE=2 FACE="Arial">i configured the service via nawui, so think it should be correct</FONT>
<BR><FONT SIZE=2 FACE="Arial">define service {</FONT>
<BR><FONT SIZE=2 FACE="Arial"> host_name machine</FONT>
<BR><FONT SIZE=2 FACE="Arial"> service_description NRPE_CLIENT</FONT>
<BR><FONT SIZE=2 FACE="Arial"> check_command check_nrpe_cvs!check_procs!-w 0:1024 -c 0:1024 -C sched</FONT>
<BR><FONT SIZE=2 FACE="Arial"> register 1</FONT>
<BR><FONT SIZE=2 FACE="Arial"> use generic-service ; The </FONT><A HREF="\\\'name\\\"><U><FONT COLOR="#0000FF" SIZE=2 FACE="Arial">\\\'name\\\</FONT></U></A><FONT SIZE=2 FACE="Arial">' of this service template</FONT>
<BR><FONT SIZE=2 FACE="Arial"> max_check_attempts 1</FONT>
<BR><FONT SIZE=2 FACE="Arial"> normal_check_interval 1</FONT>
<BR><FONT SIZE=2 FACE="Arial"> retry_check_interval 1</FONT>
<BR><FONT SIZE=2 FACE="Arial"> active_checks_enabled 1</FONT>
<BR><FONT SIZE=2 FACE="Arial"> check_period 24x7</FONT>
<BR><FONT SIZE=2 FACE="Arial"> passive_checks_enabled 1</FONT>
<BR><FONT SIZE=2 FACE="Arial"> parallelize_check 1</FONT>
<BR><FONT SIZE=2 FACE="Arial"> <B> event_handler restart_nrpe!nrpe.cfg</B></FONT>
<BR><FONT SIZE=2 FACE="Arial"> event_handler_enabled 1</FONT>
<BR><FONT SIZE=2 FACE="Arial"> flap_detection_enabled 1</FONT>
<BR><FONT SIZE=2 FACE="Arial"> process_perf_data 0</FONT>
<BR><FONT SIZE=2 FACE="Arial"> notification_interval 0</FONT>
<BR><FONT SIZE=2 FACE="Arial"> notification_period 24x7</FONT>
<BR><FONT SIZE=2 FACE="Arial"> notification_options c</FONT>
<BR><FONT SIZE=2 FACE="Arial"> notifications_enabled 1</FONT>
<BR><FONT SIZE=2 FACE="Arial"> contact_groups nagios</FONT>
<BR><FONT SIZE=2 FACE="Arial"> }</FONT>
</P>
<P><FONT SIZE=2 FACE="Arial">define command {</FONT>
<BR><FONT SIZE=2 FACE="Arial"> command_name restart_nrpe</FONT>
<BR><FONT SIZE=2 FACE="Arial"> command_line /opt/prod/nagios/nagios_test/eventhandler/start_nrpe $HOSTNAME$ $ARG1$</FONT>
<BR><FONT SIZE=2 FACE="Arial"> }</FONT>
</P>
<P><FONT SIZE=2 FACE="Arial">verification-output is:</FONT>
<BR><FONT SIZE=2 FACE="Arial">...</FONT>
<BR><FONT SIZE=2 FACE="Arial">Error: Event handler command 'restart_nrpe!nrpe.cfg' specified in service 'NRPE_CLIENT' for host 'oftvwd03' not defined anywhere</FONT></P>
<P><FONT SIZE=2 FACE="Arial">...</FONT>
</P>
<P><FONT SIZE=2 FACE="Arial">it works without the argument "nrpe.cfg".</FONT>
</P>
<P><FONT SIZE=2 FACE="Arial">greetz, thomas.</FONT>
</P>
</BODY>
</HTML>