Page 1 of 4
Monitoring Windows Event Logs
Posted: Fri Mar 15, 2013 9:32 am
by centwisit
I'm brand new to Nagios but I've got it up and running on Ubuntu 12.04. It is returning information on all the default checks for both localhost and the windows servers I've added. I've spent the last day or so digging around trying to figure how to get monitoring of Windows Event Logs and can't seem to figure it out. Is it a default part of core or do I need to add a plugin? I feel like I'm missing something simple but if there is a through tutorial for monitoring Windows Event Logs I would really appreciate it if someone could hook me up.
Re: Monitoring Windows Event Logs
Posted: Fri Mar 15, 2013 9:59 am
by slansing
One way that you could monitor Windows Event logs is through the Nag Event Log Monitor:
http://exchange.nagios.org/directory/Ad ... og/details
However it is not one of our company created agent's, and the documentation we have for it is for Nagios XI and not Core, though there may be documentation out there floating around for integration with Core.
Re: Monitoring Windows Event Logs
Posted: Mon Mar 18, 2013 1:09 pm
by centwisit
I've also been tryying to get this to work:
http://www.thedailyadmin.com/2010/08/ch ... agios.html.
Has anyone successfully used that format to monitor event logs or something similar ?
Re: Monitoring Windows Event Logs
Posted: Mon Mar 18, 2013 2:06 pm
by slansing
You can most definitely use NSClient++ for event log monitoring as well, how are you getting along on this project?
Re: Monitoring Windows Event Logs
Posted: Mon Mar 18, 2013 3:27 pm
by centwisit
Could be better. I've got the entries uncommented in the NSClient++ ini and I've added the checks to the commands.cfg file. I'm just not sure how to properly call them to have them display is Nagios.
I get the following errors in the Status Information when it tries to check...maybe because I'm not calling it correctly?
(Return code of 127 is out of bounds - plugin may be missing)
Re: Monitoring Windows Event Logs
Posted: Mon Mar 18, 2013 3:47 pm
by slansing
Can you show us how you are calling the plugins? Some examples of the event log check are located in the bottom portion of this document:
http://www.nsclient.org/nscp/wiki/Check ... k_eventlog
Re: Monitoring Windows Event Logs
Posted: Tue Mar 19, 2013 8:18 am
by centwisit
I've got the following in my commands.cfg file:
#Check the Windows System Log for Errors in the last hour
define command{
command_name check_eventlog
command_line $USER1$/check_nrpe -H $HOSTNAME$ -p 5666 -c CheckEventLog -a filter=new file="system" MaxWarn=1 MaxCrit=1 filter-generated=\<1h filter-eventType==error filter=in filter=all
}
I've got the following in my service_definitions.cfg file to call it:
define service(
use generic-service
host_name "servername"
service_description Event Log
check_command check_eventlog
}
Re: Monitoring Windows Event Logs
Posted: Tue Mar 19, 2013 9:57 am
by slansing
Sorry, I meant when you ran it manually, such as so:
Code: Select all
/usr/local/nagios/libexec/check_nrpe -H windows.server.ip. -p 5666 -c CheckEventLog -a filter=new file="system" MaxWarn=1 MaxCrit=1 filter-generated=\<1h filter-eventType==error filter=in filter=all
I receive the following output from one of my Server 2008 R2 box's:
Code: Select all
Eventlog check ok|'eventlog'=0;1;1
Someone ran into this same issue and their resolution is at the bottom of the page, though it seems you have your command defined properly:
http://nsclient.org/nscp/discussion/topic/562
Re: Monitoring Windows Event Logs
Posted: Tue Mar 19, 2013 1:45 pm
by centwisit
Ok, so when I run the check manually I get the following:
Code: Select all
Exception processing request: Request command contained illegal metachars!
Re: Monitoring Windows Event Logs
Posted: Tue Mar 19, 2013 2:14 pm
by slansing
You must enable the:
Option within the Windows server's NSClient/NSC.ini file, set the value to 1 for this line, and restart the NSClient++ service, then you should be good to go.