greedy regular experssion nrpe

Assaf Flatto nagios at flatto.net
Wed Mar 31 18:32:07 CEST 2010


shadih rahman wrote:
> Asif,
>    Thanks for your response.  I am attaching the actual plugin in this 
> email.  However the actual regular expression line is below.
>
> if ($_=~ qr/$xgrep/mo){
>                     $returnstring= "We have found $xgrep in $opfile";
>
>
> nrpe definition is something like this
>
> command[check_filecontent_x64]=/usr/lib64/nagios/plugins/check_filetest 
> -n $ARG1$ -G $ARG2$ -c $ARG3$
>
>
> service definition is something like this
>
> check_nrpe -H whatever -c check_filecontent_x64 -a filename ".*foo*" 1
if you  want to pass the quotation marks  to the test you will need to 
escape them .
like this [ -a filename \"\.\*foo\*\" 1 ] so nrpe will pass them as part 
of the string to the daemon on the target machine.

Assaf

 

-- 
Never,Ever Cut A Deal With a Dragon 


------------------------------------------------------------------------------
Download Intel® Parallel Studio Eval
Try the new software tools for yourself. Speed compiling, find bugs
proactively, and fine-tune applications for parallel performance.
See why Intel Parallel Studio got high marks during beta.
http://p.sf.net/sfu/intel-sw-dev
_______________________________________________
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