Skip site navigation (1)Skip section navigation (2)
Date:      Tue, 19 Feb 2013 20:41:32 -0500 (EST)
From:      vogelke+unix@pobox.com (Karl Vogel)
To:        freebsd-questions@freebsd.org
Subject:   Re: convert date and time to epoch in awk
Message-ID:  <20130220014133.4D8D0BF63@kev.msw.wpafb.af.mil>
In-Reply-To: <CAHM0YgvadWLRUNvyQzTj0b=YkfZAyzRRCTEyjByqXM9yXsynhg@mail.gmail.com> (message from b w on Tue, 19 Feb 2013 23:34:21 %2B0100)
References:  <CAHM0YgvadWLRUNvyQzTj0b=YkfZAyzRRCTEyjByqXM9yXsynhg@mail.gmail.com>

next in thread | previous in thread | raw e-mail | index | archive | help
>> On Tue, 19 Feb 2013 23:34:21 +0100, 
>> b w <bw.mail.lists@gmail.com> said:

b> I want to write a script that parses the last, say, 10 minutes of a log
b> file looking for a certain string, like 'error', or failed', and returns
b> how many times it shows up. The script would be run by Nagios and if it
b> returns > 0 an alert is raised. Each line of the log file starts with a
b> date like 'Feb 19 23:45:32'.

   Instead of looking for 'error' or 'failed', I'd recommend weeding out
   benign log entries and returning everything else.  Some examples:
     http://www.hcst.net/~vogelke/src/logfiles/

   Some relevant links for Nagios:
     http://serverfault.com/questions/172875/
     Is Nagios capable of covering the functionality of Logwatch?

     http://stackoverflow.com/questions/2373212/
     How do I use Nagios to monitor a log file

     http://serverfault.com/questions/44/
     What tool do you use to monitor your servers?

-- 
Karl Vogel                      I don't speak for the USAF or my company

John, this smells worse than your uncle's codpiece (which I wish you would
stop wearing to work), and in reviewing it I can deduce that your parents
were never formally introduced.
                    --Slashdot suggestion for inspecting poorly-written code



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?20130220014133.4D8D0BF63>