upgrade to 2.0b1 / event handlers broken
Andreas Ericsson
ae at op5.se
Wed Jan 19 09:29:36 CET 2005
Steve Shipway wrote:
> James Mosley wrote:
>
>>[1106090538] SERVICE EVENT HANDLER:
>>tx-svr-1;NAGIOS;CRITICAL;HARD;2;handle-master-proc-event
>>[1106090658] SERVICE EVENT HANDLER:
>>tx-svr-1;NAGIOS;OK;HARD;2;handle-master-proc-event
>>
>>However, the event scripts simply aren't being called by the
>>nagios process as verified by modifications I made to them for
>>testing purposes. Running the EV scripts manually works, so
>>it's not broken scripts. Addtionally, all the config
>
>
> I've had similar behaviour under Nagios 1.2. An event handler script
> (written in perl) ran fine from the command line, but not as an event
> handler.
>
> I found that, if I specified the perl executable on the commandline, or even
> wrapped it in a shellscript,
Shell-scripts always work with decently recent shells, since popen and
system actually "run /bin/sh -c <command>" to get things done.
> it worked:
> command_line /usr/bin/perl $USER2$/eh-send-bb.pl $SERVICESTATE$
> $STATETYPE$ $SERVICEATTEMPT$ $HOSTADDRESS$ "$SERVICEDESC$"
>
The shell should take care of it provided the +x bit is set for the user
who's trying to execute and a properly formatted hashbang line is
present at the very top of the script.
chmod 755 script takes care of the permissions. The hashbang line should
look like so;
#!/usr/bin/perl
(i.e. without spaces and such to ensure workability with older shells).
> No idea why, but this might help you if the scripts are perl or shell
> scripts?
>
> Steve
>
> ---
> Steve Shipway: ITSS, University of Auckland
> Email: s.shipway at auckland.ac.nz Web: http://www.steveshipway.org/
> ** We can only discover new oceans when we have the **
> ** courage to lose sight of the shore. **
--
Andreas Ericsson andreas.ericsson at op5.se
OP5 AB www.op5.se
Lead Developer
-------------------------------------------------------
The SF.Net email is sponsored by: Beat the post-holiday blues
Get a FREE limited edition SourceForge.net t-shirt from ThinkGeek.
It's fun and FREE -- well, almost....http://www.thinkgeek.com/sfshirt
_______________________________________________
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