Ad Widget

Collapse

Apache monitoring with Zabbix

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • ericgearhart
    Senior Member
    • Jan 2009
    • 115

    #1

    Apache monitoring with Zabbix

    I've created a script and template that allows Zabbix to monitor Apache's /server-status page, and I built a graph for Apache's thread scoreboard. I posted what I've done so far on the Zabbix wiki: http://zabbix.com/wiki/templates/apache

    Zabbix needs to have "external check" functionality enabled, and the query_apachestats.py script should be tossed into the folder configured in zabix_server.conf

    Here's an example of what my zabbix_server.conf externalscripts looks like:
    Code:
    ### Option: ExternalScripts
    #       Location of external scripts
    # 
    # Mandatory: no
    # Default:
    ExternalScripts=/etc/zabbix/externalscripts
    I think an example illustrates the graph best:


    Each of the /server-status Scoreboard metrics has a corresponding item... I haven't setup triggers for items because this would be somewhat environment specific I think... for where I work if we have more than 50 "Sending Reply" threads busy that indicates a problem, but it might not indicate a problem at your site... building triggers from what this script gives you is pretty easy though

    I haven't built graphs for the other Apache metrics yet (TotalAccesses, BytesPerRequest, CPULoad, etc) but I plan to

    Please provide copious amounts of feedback, tell me my python skills suck, etc

    P.S. - for those familiar with Cacti, this is a direct ripoff of Cacti's "ApacheStats" template.. see this thread for the similarities
  • gpmidi
    Member
    • Aug 2009
    • 62

    #2
    Simlar

    I've created a similar script here. I'd like to post it to the Zabbix Wiki but can't.
    -Paul

    PS I did reference your script when creating mine. Thanks!

    Comment

    • ericgearhart
      Senior Member
      • Jan 2009
      • 115

      #3
      Originally posted by gpmidi
      I'd like to post it to the Zabbix Wiki but can't.
      -Paul
      Why can't you post this to the wiki? You can log in with your forum username/password if I'm remembering right, or maybe just a quick registration is all that was needed for me

      Comment

      • gpmidi
        Member
        • Aug 2009
        • 62

        #4
        Ahh

        Originally posted by ericgearhart
        Why can't you post this to the wiki? You can log in with your forum username/password if I'm remembering right, or maybe just a quick registration is all that was needed for me
        Ahh, the forums login works. Thanks!

        Comment

        • ericgearhart
          Senior Member
          • Jan 2009
          • 115

          #5
          Hey the wiki was naming your article "Overview" in the "Templates" tree on the left hand side because of the header of your article... I added "Apache Monitoring Script" to the header to fix it

          Comment

          • ericgearhart
            Senior Member
            • Jan 2009
            • 115

            #6
            If you like i can pull my old "Method 2" out of the wiki as well... your python fu is awesome... using a dict is much cleaner

            Comment

            • bashman
              Senior Member
              • Dec 2009
              • 432

              #7
              If you don't want to use a perl script you can use zapache
              978 Hosts / 16.901 Items / 8.703 Triggers / 44 usr / 90,59 nvps / v1.8.15

              Comment

              • gpmidi
                Member
                • Aug 2009
                • 62

                #8
                Originally posted by bashman
                If you don't want to use a perl script you can use zapache
                You should add this option to the Wiki.
                -Paul

                Comment

                • bashman
                  Senior Member
                  • Dec 2009
                  • 432

                  #9
                  May be this is a little bit better:

                  978 Hosts / 16.901 Items / 8.703 Triggers / 44 usr / 90,59 nvps / v1.8.15

                  Comment

                  • Z@fleur
                    Junior Member
                    • Dec 2010
                    • 2

                    #10
                    query_apachestats.py returned nothing

                    Hello

                    I follow instructions method2

                    But all items query_apachestats.py returns (in interface or zabbix-serveur.log)

                    error: Script /etc/zabbix/externalscripts/query_apachestats.py returned nothing.

                    I use Zabbix Appliance 1.8.3 based on OpenSuSE Linux with MySQL back-end.

                    Do you have any solutions ?

                    Merci par avance

                    Comment

                    • sue
                      Member
                      • Mar 2011
                      • 41

                      #11
                      Originally posted by ericgearhart
                      I've created a script and template that allows Zabbix to monitor Apache's /server-status page, and I built a graph for Apache's thread scoreboard. I posted what I've done so far on the Zabbix wiki: http://zabbix.com/wiki/templates/apache

                      Zabbix needs to have "external check" functionality enabled, and the query_apachestats.py script should be tossed into the folder configured in zabix_server.conf

                      Here's an example of what my zabbix_server.conf externalscripts looks like:
                      Code:
                      ### Option: ExternalScripts
                      #       Location of external scripts
                      # 
                      # Mandatory: no
                      # Default:
                      ExternalScripts=/etc/zabbix/externalscripts
                      I think an example illustrates the graph best:


                      Each of the /server-status Scoreboard metrics has a corresponding item... I haven't setup triggers for items because this would be somewhat environment specific I think... for where I work if we have more than 50 "Sending Reply" threads busy that indicates a problem, but it might not indicate a problem at your site... building triggers from what this script gives you is pretty easy though

                      I haven't built graphs for the other Apache metrics yet (TotalAccesses, BytesPerRequest, CPULoad, etc) but I plan to

                      Please provide copious amounts of feedback, tell me my python skills suck, etc

                      P.S. - for those familiar with Cacti, this is a direct ripoff of Cacti's "ApacheStats" template.. see this thread for the similarities
                      Hi..i interseted to monitoring apache but i dont know how. Then i saw ur method. So, i hope u can help me because i try to do by using method 2 but nothing happen. or i need use method 1 also??

                      Comment

                      • bashman
                        Senior Member
                        • Dec 2009
                        • 432

                        #12
                        Originally posted by gpmidi
                        You should add this option to the Wiki.
                        -Paul
                        http://www.zabbix.com/wiki/templates/apache#method_3
                        978 Hosts / 16.901 Items / 8.703 Triggers / 44 usr / 90,59 nvps / v1.8.15

                        Comment

                        • muratkoc
                          Junior Member
                          • Mar 2008
                          • 23

                          #13
                          Hi,

                          I have modified bashman's script to include scoreboard values, here it is
                          Attached Files

                          Comment

                          • bashman
                            Senior Member
                            • Dec 2009
                            • 432

                            #14
                            Originally posted by muratkoc
                            Hi,

                            I have modified bashman's script to include scoreboard values, here it is
                            Great job!!!, thanks Muratkoc!

                            The wiki is now updated with your new script:

                            http://www.zabbix.com/wiki/templates/apache#method_3
                            978 Hosts / 16.901 Items / 8.703 Triggers / 44 usr / 90,59 nvps / v1.8.15

                            Comment

                            • muratkoc
                              Junior Member
                              • Mar 2008
                              • 23

                              #15
                              Thank you bashman for putting in wiki I'have also prepared graphs, items, triggers but due to https://support.zabbix.com/browse/ZBX-3531 can't export it Since I am kind of lazy to install 1.8 version again when this issue resolved I'll post the template.

                              Thanks again,

                              Comment

                              Working...