Graphing Access Log Status with PNP4Nagios, part two 16

Posted by Peter Burkholder Sat, 04 Dec 2010 02:10:00 GMT

The graphs I showed in part one are generated by performance output from a Perl script, check_access_log.pl (attached to this post). The performance data are then captured by pnp4nagios and saved into an RRD file. The default graphing templates provided with pnp4nagios v0.4 didn’t do justice to how interest these data are, so I wrote my own template (to be attached to a future post).

The usage for check_access_log.pl is:

Usage: check_log3.pl [ -v|--verbose ] -l|--logfile=file -m|--m=minutes [ -c|--critical=<threshold>(20) ] [ -w|--warning=<threshold>(10) ] [ -a|--activity=number_of_lines (100) ]

where:
  • logfile is the path to your httpd access log
  • minutes is how far back from the present you want to parse your log file (5 minutes by default)
  • -c|-w represent the percentage of non-200 statuses are considered problematic
  • --activity: only go to warning/critical if activity exceeds this number of lines per check. This prevent the check from going to warning/critical if you’ve taken it out of service.
The script requires:
  • File::ReadBackwards; # allows the script to read backwards until the time period criterion is met
  • Date::Manip;
  • Nagios::Plugin;

Generally, the live httpd access logs will not be on your Nagios server so you’ll need to invoke this over NRPE.

Comments

Leave a comment

  1. Choline Chloride 12 days later:
    Thanks for sharing this cod
  2. Houston Alarm Companies 26 days later:
    I truly appreciate you taking the time to post this. I really liked reading it and am looking forward to more posts from you! Keep 'em coming
  3. health insurance about 1 month later:
    If something doesn't work, then create your own. That's a motto I live by and it forces me to be very creative. Your solution to your problem seems sound and concrete. When you can figure things out on your own, you empower yourself in ways that nothing else can.
  4. krzyzowki 4 months later:
    Thanks for this great post. Did you do it all on your own? This must've taken a lot of time
  5. darmowe pozycjonowanie 4 months later:
    Thanks for this great post. Did you do it all on your own? This must've taken a lot of time
  6. tiffany jewelry 4 months later:
    Very nice post! I recommend this blog a really good one.
  7. cheapjordans 4 months later:
    I really love your weblog, Its great to find not absolutely everyone is just posting a ton of rubbish these days! cheapjordans
  8. darmowe programy 4 months later:
    I am not sure where you are getting your information, but great topic
  9. Home Security Austin 4 months later:
    This is the perfect blog for anyone who wants to know about this topic. You know so much its almost hard to argue with you (not that I really would want…HaHa). You definitely put a new spin on a subject thats been written about for years. Great stuff, just great!
  10. Diablo3 9 months later:
    Stuff like these desurves a twit and maybe a bookmark,your content is very good and i thank you for that
  11. Tulle 9 months later:
    Blog posts about wedding and bridal are always rare to find , at least with great quality,you qualify for a great blog post writer title,kep the great job happening
  12. african Mango dr oz 9 months later:
    Corporations are challenging existing business models as they seek ways to speed innovation, focus on their core competencies, and scale to capitalize on opportunities and outpace competitors.
  13. The Diet Solution 10 months later:
    it needs a bokmark so i can come back to it later ,nice stuff
  14. Leonard D. Williams about 1 year later:
    The one thing exciting about a destination wedding is, you can experiment a lot with your destination wedding dresses. Getting married on a beach is like a dream come true and your destination beach wedding dresses should be in sync with the soothing ambiance endowed upon by the sun, sand and the sea.
  15. Cornelius M. Amato about 1 year later:
    The bride usually wears white, off-white, silver, or other very light-colored modern style wedding dresses, particularly at her first marriage. But if it comes to the bridal reception dresses, color is not limited.
  16. Todd Groten about 1 year later:
    Hi Peter, I noticed you said you would be attaching the pnp4nagios template to a future blog entry, but the latest one is from 2010. Is there an chance you could write a quick entry on it and attach the template? Or, if that's an issue, could you please shoot it to me over email? Thanks, -Todd Groten
Comments