<div>NC_NEt also has Event Log check,  that can be checked via Check_NC_NEt (nc_net version of check_nt that was modified from the official plugin check_nt)   NC_net offers checking threadhold -c or -w based on the number of results from the event log query.  It also offers filers for which log, How resent, Event Type, Source, Event ID, and Regular Expessions against the message field.</div>

<div> </div>
<div> </div>
<div>TOny  <br><br></div>
<div class="gmail_quote">On Mon, Jun 2, 2008 at 3:41 PM, Frater, Greg J <<a href="mailto:GJFRATER@bechtel.com">GJFRATER@bechtel.com</a>> wrote:<br>
<blockquote class="gmail_quote" style="PADDING-LEFT: 1ex; MARGIN: 0px 0px 0px 0.8ex; BORDER-LEFT: #ccc 1px solid">
<div>
<div class="Ih2E3d">
<p><font face="Courier New" size="2">>Dear All,</font> </p>
<p><font face="Courier New" size="2">>Would anyone have experience in checking the windows eventviewer for certain events, or turning nagios red in case of ERRORs ?</font></p>
<p><font face="Courier New" size="2">>What script are you using ? preferably something that can simply interact with NSClient</font> </p></div>
<p><font face="Courier New" size="2">We do this using the NSClient++ agent (</font><a><u><font face="Courier New" color="#0000ff" size="2">www.nsclient.org</font></u></a><font face="Courier New" size="2">).  It checks the event logs and filters them based on criteria you define, alerting when the number of hits you specify is reached (i.e. when the system log has 1 or more events with an ID of XXXX within the last 10 minutes send alerts).  Here is an example we use to monitor for a specific Oracle error.  In the example we check the "application" log of the server every "60" minutes for events with an ID of "20" with event type of "Error" containing a string in the text of the message "Can not allocate log", check turns criti
 cal after 1 matching event is found that is time stamped within the last "65" minutes.</font></p>
<br>
<p><font face="Courier New" size="2">Checkcommands.cfg:</font> <br><font face="Courier New" size="2">define command{</font> <br><font face="Courier New" size="2">        command_name    check_eventlogs</font> <br><font face="Courier New" size="2">        command_line    $USER1$/check_nrpe -H $HOSTADDRESS$ -p 5666 -c checkEventLog -a filter=new $ARG1$ MaxWarn=$ARG2$ MaxCrit=$ARG3$ filter-generated=\$ARG4$ $ARG5$ truncate=$ARG6$</font></p>

<p><font face="Courier New" size="2"># Desc:</font> <br><font face="Courier New" size="2">#       $ARG1$ = event logs to check (i.e. file=system file=application)</font> <br><font face="Courier New" size="2">#       $ARG2$ = Warning level (i.e. number of hits to generate a warning response)</font> <br>
<font face="Courier New" size="2">#       $ARG3$ = Critical level (i.e. number of hits to generate a critcal response)</font> <br><font face="Courier New" size="2">#       $ARG4$ = Time period (i.e. 1 day is '1d' 30 hours is '>30h')</font> <br>
<font face="Courier New" size="2">#       $ARG5$ = Filters (i.e. filter-eventID==9009 filter-eventSource=Tcpip) see </font><a href="http://www.nsclient.org/nscp/wiki/CheckEventLog/CheckEventLog" target="_blank"><u><font face="Courier New" color="#0000ff" size="2">http://www.nsclient.org/nscp/wiki/CheckEventLog/CheckEventLog</font></u></a><font face="Courier New" size="2"> for detailed info</font></p>

<p><font face="Courier New" size="2">#       $ARG6$ = Amount of data to return in characters (i.e. truncate=150)</font> <br><font face="Courier New" size="2">#       Example: check_nrpe -H server_name_here -p 5666 -c checkEventLog -a filter=new file=system MaxWarn=1 MaxCrit=1 filter-generated=\>30h filter+eventID==10002 descriptions truncate=138</font></p>

<p><font face="Courier New" size="2">        }</font> </p>
<p><font face="Courier New" size="2">Services.cfg:</font> <br><font face="Courier New" size="2">define service{</font> <br><font face="Courier New" size="2">        use                             standard-srv</font> <br>
<font face="Courier New" size="2">        service_description             eventlog: Oracle archive log errors</font> <br><font face="Courier New" size="2">        check_command                   check_eventlogs!file=application!1!1!>65m!filter+eventID==20 filter+eventType==error filter+message=substr:"Can not allocate log"!100</font></p>

<p><font face="Courier New" size="2">        normal_check_interval           60</font> <br><font face="Courier New" size="2">        notification_options            w,c</font> <br><font face="Courier New" size="2">        contact_groups                  apps</font> <br>
<font face="Courier New" size="2">        host_name                       server1, server2</font> <br><font face="Courier New" size="2">        }</font> </p>
<p><font face="Courier New" size="2">HTH, </font></p>
<p><font face="Courier New" size="2">-greg</font> </p><br><br></div><br>-------------------------------------------------------------------------<br>This SF.net email is sponsored by: Microsoft<br>Defy all challenges. Microsoft(R) Visual Studio 2008.<br>
<a href="http://clk.atdmt.com/MRT/go/vse0120000070mrt/direct/01/" target="_blank">http://clk.atdmt.com/MRT/go/vse0120000070mrt/direct/01/</a><br>_______________________________________________<br>Nagios-users mailing list<br>
<a href="mailto:Nagios-users@lists.sourceforge.net">Nagios-users@lists.sourceforge.net</a><br><a href="https://lists.sourceforge.net/lists/listinfo/nagios-users" target="_blank">https://lists.sourceforge.net/lists/listinfo/nagios-users</a><br>
::: Please include Nagios version, plugin version (-v) and OS when reporting any issue.<br>::: Messages without supporting info will risk being sent to /dev/null<br></blockquote></div><br>