Check_Log - SOLUTION

James Turnbull james at lovedthanlost.net
Sun Mar 5 02:00:04 CET 2006


Mike Koponick wrote:
> All,
>
> Thanks for all the help/information regarding this subject.
>
> I have found a solution that works in this case.
>
> The problem is that the "%" is a directive for printf. Since the "%" was
> in the string, printf thinks it should be a directive.
>
> Since I had no need for the "%" in the output string, I removed it.
>
> I changed the check_log script with the following:
>
> OLD:
> $ECHO "($count) $lastentry" 
>
> NEW:
> $ECHO "($count) $lastentry" | /bin/sed 's/%//'
>
> I'm sure there is probably a more efficient way of doing this, but it
> was a quick fix for me.
>   
I guess the easier way might be to escape the % in printf.

Regards

James Turnbull

-- 
James Turnbull <james at lovedthanlost.net>
---
Author of Pro Nagios 2.0
(http://www.amazon.com/gp/product/1590596099/)

Hardening Linux
(http://www.amazon.com/gp/product/1590594444/)
---
PGP Key (http://pgp.mit.edu:11371/pks/lookup?op=get&search=0x0C42DF40)



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