check_log2.pl perl module

Terry L. Inzauro tinzauro at ha-solutions.net
Fri Mar 24 23:19:45 CET 2006


Jason Martin wrote:
> On Fri, Mar 24, 2006 at 04:06:56PM -0600, Terry L. Inzauro wrote:
>> multiple search strings.  the documentation inside the script states that 
>> any perl regex can be  used to the "-p" argument....but warned to be very 
>> careful....i'm gussing careful to not kill yourself in the process ;)
>>
>>
>> my question to the list is: how do you quote the command so it can be run 
>> by the check_by_ssh_plugin?
>> "crit|warn|info|auth"'
> I once had to do this, except using NRPE which forbids those
> characters. I had eventually had to hack in a Base64 decoder in
> the plugin and put the encoded string in the Nagios config.
> Ugly.
> 
> -Jason Martin

sometimes is just pays to know how your shell works!

this works:
nagios at jenna ~ $ /usr/nagios/libexec/check_by_ssh -H ma01 -C '/opt/nagios/libexec/check_log2.pl -l /var/log/messages -s /tmp/seekfile -p 
crit\|warn\|info\|auth'
(3): Mar 24 16:16:43 ma01 sshd[9677]: [ID 800047 auth.info] Accepted publickey for nagios from 10.121.121.250 port 32945 ssh2

but, not as you would hope so.  if you rerun it two seconds later, it reports the same error. not the desired/correct result i was looking for.

has anyone ever got check_log2.pl to "correctly" look for multiple strings without running the script mutiple times?

regards,



_Terry








-------------------------------------------------------
This SF.Net email is sponsored by xPML, a groundbreaking scripting language
that extends applications into web and mobile media. Attend the live webcast
and join the prime developer group breaking into this new coding territory!
http://sel.as-us.falkag.net/sel?cmd=lnk&kid=110944&bid=241720&dat=121642
_______________________________________________
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