Search Exchange
Search All Sites
Nagios Live Webinars
Let our experts show you how Nagios can help your organization.Login
Directory Tree
check_logwarn
1.0.1
2010-12-29
- Nagios 2.x
- Nagios 3.x
Apache
106008
Meet The New Nagios Core Services Platform
Built on over 25 years of monitoring experience, the Nagios Core Services Platform provides insightful monitoring dashboards, time-saving monitoring wizards, and unmatched ease of use. Use it for free indefinitely.
Monitoring Made Magically Better
- Nagios Core on Overdrive
- Powerful Monitoring Dashboards
- Time-Saving Configuration Wizards
- Open Source Powered Monitoring On Steroids
- And So Much More!
Logwarn searches for interesting messages in log files, where ``interesting'' is defined by a user-supplied list of positive and negative extended regular expressions provided on the command line.
Each log message is compared against each pattern in the order given. If the log message matches a positive pattern before matching a negative pattern then it's printed to standard output.
Logwarn keeps track of its position between invocations, so each matching line is only ever output once. It also finds messages in log files that have been rotated (and possibly compressed) since the previous invocation.
Logwarn also includes support for log messages that span multiple lines.
Logwarn is written in C for efficient execution. A Nagios plugin is also included.
Each log message is compared against each pattern in the order given. If the log message matches a positive pattern before matching a negative pattern then it's printed to standard output.
Logwarn keeps track of its position between invocations, so each matching line is only ever output once. It also finds messages in log files that have been rotated (and possibly compressed) since the previous invocation.
Logwarn also includes support for log messages that span multiple lines.
Logwarn is written in C for efficient execution. A Nagios plugin is also included.
Reviews (1)
byaricade, August 16, 2012
1st!!!!!!!!!!!!
define command{
command_name check_logwarn
command_line bash /usr/lib/nagios/plugins/check_logwarn -d /tmp/logwarn -p $ARG1$ $ARG2$
#ARG1 is file ARG2 is regex
}
define service{
use generic-service
host_name HOSTNAME
service_description Log Warning
max_check_attempts 1
check_command check_logwarn!/var/log/file.log!^.*YOURWORDHERE.*
}
needed to add -d /tmp/logwarn dir. Make sure to chown nagios.nagios /tmp/logwarn. Maybe it would be better to place in /var/lib/nagios3/logwarn it's up to you.
Also set max_check_attempts to 1 as my default was 4. so it would take 4 failures in a row to actually trigger a notification. I was really stumped on this for a bit! Save yourself some pain and set it to 1. My setup may still need some tweaking but it is working well enough right now.
Our nagios box is a syslog server and recieves logs from our switches/routers. I am able to watch for certain events with this plugin.
I have yet to see how it works with logrotate but it apparently does support on what the man page reads.
Thanks! This a great plugin that solves some clumsy limitations we have.
define command{
command_name check_logwarn
command_line bash /usr/lib/nagios/plugins/check_logwarn -d /tmp/logwarn -p $ARG1$ $ARG2$
#ARG1 is file ARG2 is regex
}
define service{
use generic-service
host_name HOSTNAME
service_description Log Warning
max_check_attempts 1
check_command check_logwarn!/var/log/file.log!^.*YOURWORDHERE.*
}
needed to add -d /tmp/logwarn dir. Make sure to chown nagios.nagios /tmp/logwarn. Maybe it would be better to place in /var/lib/nagios3/logwarn it's up to you.
Also set max_check_attempts to 1 as my default was 4. so it would take 4 failures in a row to actually trigger a notification. I was really stumped on this for a bit! Save yourself some pain and set it to 1. My setup may still need some tweaking but it is working well enough right now.
Our nagios box is a syslog server and recieves logs from our switches/routers. I am able to watch for certain events with this plugin.
I have yet to see how it works with logrotate but it apparently does support on what the man page reads.
Thanks! This a great plugin that solves some clumsy limitations we have.