problem w/ check_log2.pl

Andreas Ericsson ae at op5.se
Wed Jan 5 00:50:05 CET 2005


Emmett Hogan wrote:
> Hi Folks,
> 
> I am trying to use check_log2.pl via check_by_ssh to check for either 
> "WARNING" or "NOTICE"...however, if I use the command:
> 
> check_by_ssh -l nagios -i nagios_key -H hostname -C 
> '/opt/nagios/libexec/check_log2.pl -l /var/adm/messages -s 
> /var/tmp/message.nagios-seek -p "WARNING|NOTICE"'
> 
> It is treating the "|" as a unix pipe and not a regular expression 
> character.  I have tried every method of "escaping" the character, but 
> have had no luck.
> With all of the folks using check_log2.pl, I am sure someone has run 
> into this before....at least I hope so.
> 
> Does anyone know of a solution?  (Maybe redefining the "or" character 
> for a PERL regular expression?)
> 

You need to do do double double-quotes of the regular expression, the 
inner of which must be escaped (as such):
blahblah "\"WARNING|NOTICE\""

You can optionally use single qoutes on the outside and double quotes on 
the inside, or any manner of other method (triple escaping the pipe, for 
instance). It has to do with how the nrpe daemon executes commands.

> -E
> 

-- 
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