I just ran through a 639,000 line gz compressed apache log file, using
zcat access.log.gz|awk '{print $9}'|sort|uniq -c in 7 seconds
 
That gives you the return code (404, 302, 200), and the number.
Percenting it is an exercise for the reader, but something like
 
tac /var/log/apache/access.log|head -10000|awk '{print $9}'|sort|uniq -c

--
There is no time like the present for postponing what you ought to be
doing.

Paul Weaver    
Systems Development Engineer
News Production Facilities, BBC News

________________________________

        From: Paulus, Jake [mailto:[EMAIL PROTECTED] 
        Sent: 03 December 2008 23:59
        To: Jonah Horowitz; nagios-users@lists.sourceforge.net
        Subject: Re: [Nagios-users] SPAM: : Checking for Apache Errors
        
        

        I would really recommend Splunk for this task over
Nagios...assuming you don't generate more than 500 MB of logs per day,
it's free! Assuming you really wanted to do it in Nagios, you'd probably
be stuck writing your own plugin in C in order to make it fast enough to
comb throw MB of logs without too much overhead (like the Nagios
avail.cgi does...)

         

        -Jake

         

        ________________________________

                From: Jonah Horowitz [mailto:[EMAIL PROTECTED] 
        Sent: Wednesday, December 03, 2008 6:46 PM
        To: nagios-users@lists.sourceforge.net
        Subject: SPAM: :[Nagios-users] Checking for Apache Errors

         

        I'm trying to check my apache logs to make sure there is not
more than a reasonable number of 404 errors for any given chunk of time.
Does anyone have a apache log checking plugin?  I would prefer something
that allowed me to alarm if the number of 404s exceeded a certain
percentage.
        
        I didn't see anything on nagiosexchange, and check_log is a bit
too generic for what I'm trying to do.
        
        If nothing exists, I'll probably write something.
        -- 
        Jonah Horowitz * Monitoring Manager * [EMAIL PROTECTED]
        W: 415-348-7694 * F: 415-348-7033 * M: 415-513-7202
        LookSmart - Premium and Performance Advertising Solutions
        625 Second Street, San Francisco, CA 94107


-------------------------------------------------------------------------
This SF.Net email is sponsored by the Moblin Your Move Developer's challenge
Build the coolest Linux based applications with Moblin SDK & win great prizes
Grand prize is a trip for two to an Open Source event anywhere in the world
http://moblin-contest.org/redirect.php?banner_id=100&url=/
_______________________________________________
Nagios-users mailing list
Nagios-users@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

Reply via email to