Check_Log - SOLUTION
Mike Koponick
mkoponick at redhawk.info
Sat Mar 4 23:29:16 CET 2006
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.
Thanks!
Mike
-----Original Message-----
From: nagios-users-admin at lists.sourceforge.net
[mailto:nagios-users-admin at lists.sourceforge.net] On Behalf Of Mike
Koponick
Sent: Saturday, March 04, 2006 7:59 AM
To: James Turnbull
Cc: Nagios Users
Subject: RE: [Nagios-users] Check_Log
Sure.
Here is the service check command:
define service {
use Sensor-Log
hostgroup_name Firewalls
service_description Check_Log
check_command
check_log!/var/log/messages!/usr/local/nagios/var/PIX-Deny.log!"Deny"
register 1
}
Here is the template that I am using:
define service{
name Sensor-Log
is_volatile 0
max_check_attempts 1
normal_check_interval 1
retry_check_interval 1
passive_checks_enabled 0
active_checks_enabled 1
check_period 24x7
parallelize_check 1
obsess_over_service 1
check_freshness 0
event_handler_enabled 0
flap_detection_enabled 0
process_perf_data 1
retain_status_information 1
retain_nonstatus_information 1
contact_groups Support
notification_interval 0
notification_period 24x7
notification_options w,c
notifications_enabled 0
register 0
}
Here is my check command:
define command {
command_name check_log
command_line $USER1$/check_log -F $ARG1$ -O $ARG2$ -q $ARG3$
Thanks!
Mike
-----Original Message-----
From: James Turnbull [mailto:james at lovedthanlost.net]
Sent: Friday, March 03, 2006 6:33 PM
To: Mike Koponick
Cc: Nagios Users
Subject: Re: [Nagios-users] Check_Log
Mike Koponick wrote:
>
> I wanted to say thanks to all who responded to my question regarding
> parsing syslog files.
>
>
>
> Thanks!
>
>
>
> But, I was wondering about check_log. It seems that it would work for
> my environment. However I see that I have run into a snag of sorts.
>
>
>
Can you post the command/etc you are using check_log in to parse the
log?
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=k&kid0944&bid$1720&dat1642
_______________________________________________
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
-------------------------------------------------------
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&kid0944&bid$1720&dat1642
_______________________________________________
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