AW: Monitoring Windows Event Log from Nagios

Andreas Ericsson ae at op5.se
Tue Sep 21 03:03:06 CEST 2004


Greg King wrote:
> I solved the embedded perl problem by encapulating the perl script inside
> a shell script. Here's the code that works for me:
> 
> [root at z3 libexec]# cat check_win_eventlog.sh
> #!/bin/bash
> /usr/bin/perl -w /usr/local/nagios/libexec/check_win_eventlog.pl $1 $2 $3 $4 $5
> $6 $7 $8
> exit $?
> 

That will give you problems if there are spaces in the arguments. You 
should try
/usr/bin/perl perlscript.pl "$@" 2>&1
instead, which expands the argument list and encapsulates each argument 
in double quotes. The 2>&1 part sends stderr to stdout, so you can trap 
occasional perl errors instead of getting the old 'no output', if you 
want a more generic wrapper.

Or just disable the embedded perl interpreter. Judging from mail going 
to nagios-devel, problems with it aren't likely to be solved any time 
soon...

-- 
Andreas Ericsson                   andreas.ericsson at op5.se
OP5 AB                             www.op5.se
Lead Developer


-------------------------------------------------------
This SF.Net email is sponsored by: YOU BE THE JUDGE. Be one of 170
Project Admins to receive an Apple iPod Mini FREE for your judgement on
who ports your project to Linux PPC the best. Sponsored by IBM.
Deadline: Sept. 24. Go here: http://sf.net/ppc_contest.php
_______________________________________________
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