Ad Widget

Collapse

Zabbix Template and PERL Script for Monitoring Apache2

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • lostmarbles
    Member
    • Mar 2009
    • 50

    #1

    Zabbix Template and PERL Script for Monitoring Apache2

    Hello!

    After trying just about every Apache monitoring configuration for Apache2, found one that actually works well for Apache2 over at The UNIX and Linux Forums.


    Zabbix Template and PERL Script for Monitoring Apache2


    Enjoy!

    Note:

    This template has a nice graph that shows total workers, active workers and idle workers. Total item monitored: 10
    Last edited by lostmarbles; 09-03-2009, 10:34.
  • Konstantin Tokar
    Junior Member
    • Oct 2008
    • 17

    #2
    UserParameter=apache2.busyworkers,/etc/zabbix/zabbix_apache2.pl|cut-f8-d ":"
    UserParameter=apache2.idleworkers,/etc/zabbix/zabbix_apache2.pl|cut-f9-d ":"
    Perhaps, there is a possibility in zabbix_agent not to use some starts of a file zabbix_apache2.pl and a choice of the necessary line from the answer, but to start zabbix_apache2.pl once? As a last resort to make so:

    To execute
    /etc/zabbix/zabbix_apache2.pl> result.txt

    In result.txt will get:

    apache2.uptime 1224
    apache2.reqpersec 1234
    .....

    zabbix_agent Reads result.txt

    UserParameterFromFile=apache2.uptime, result.txt
    UserParameterFromFile=apache2.reqpersec, result.txt


    It allows not to call difficult scripts of gathering of statistics.

    Comment

    • lostmarbles
      Member
      • Mar 2009
      • 50

      #3
      I agree that reading the parameters from a file is a better way!

      Good idea! Thanks!

      Comment

      • lostmarbles
        Member
        • Mar 2009
        • 50

        #4
        This script was updated today based on Konstantin Tokar's recommendation.

        Basically, we have moved the PERL script to a crontab running every minute and we then write the results to a /tmp file. Then the Zabbix agent reads the data from the file instead of calling the PERL script 10 times. This is more efficient.

        Also, we change the template to update every 60 seconds instead of 30 seconds to match the crontab entry.

        You can find the crontab file, template and agent entries here:


        Version 2: Zabbix Template and PERL Script for Monitoring Apache2

        Comment

        Working...