Ad Widget

Collapse

Apache monitoring with Zabbix

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • SrTunes
    Member
    • Feb 2013
    • 37

    #31
    Help Method 3

    Originally posted by sue
    OK..i success to monitor the item. But i want to know, is it the value i get is right? for example, read request. why my read request value always 0? even when i try many times to request that page is always 0. the changes only in sending reply. Maybe i not understand how it works. can anybody explain to me?
    Help me! How can you have success? I don't know why is it doesn't work. How did you do?

    Comment

    • neilb
      Member
      • Jan 2013
      • 33

      #32
      Originally posted by brynjellis
      Hi

      Does anyone have any instructions on how to implement Method 3 on this URL https://www.zabbix.com/wiki/doku.php...pache#method_3 please?

      I'm a newbie and am not sure where to put the bash script and how it should be executed (via cron or called from zabbix somehow?).

      Sorry to be thick and thanks very much to anybody who can spare me the time to explain. I really need this to work as I'm having lots of Apache related issues and need to get some insight into what our app is doing with Apache.

      Kind regards
      Bryn
      Hi Bryn
      just put the bash script into a path on the apache server.
      then reference that path in the local agent configuration file.
      eg UserParameter=apache[*],/etc/zabbix/externalscripts/zapache.sh \$1

      - remember to restart the zabbix agent post change

      assuming you've then changed the apache configuration ( /etc/httpd/conf/httpd.conf) to allow extended access you should be good to go.

      Comment

      • rkvirani
        Junior Member
        • Aug 2013
        • 1

        #33
        Method #2 - Python Errors

        Hi,

        Method #2 seemed to be the most sustainable, however the python script is not working as it seems it is not receiving the apporpiate data from the Template, is there a fix or an update for this? We are running 2.05, Method #2 is the best from my perspective because it will also monitor apache servers on any OS.

        Code:
        Traceback (most recent call last):
          File "/var/lib/zabbixsrv/externalscripts/query_apachestats.py", line 26, in <module>
            Port = sys.argv[2]
        IndexError: list index out of range
        If someone could update the wiki with a fixed version I would be much obliged,

        Thanks

        Comment

        • ericgearhart
          Senior Member
          • Jan 2009
          • 115

          #34
          Originally posted by rkvirani
          Hi,

          Method #2 seemed to be the most sustainable, however the python script is not working as it seems it is not receiving the apporpiate data from the Template, is there a fix or an update for this? We are running 2.05, Method #2 is the best from my perspective because it will also monitor apache servers on any OS.

          Code:
          Traceback (most recent call last):
            File "/var/lib/zabbixsrv/externalscripts/query_apachestats.py", line 26, in <module>
              Port = sys.argv[2]
          IndexError: list index out of range
          If someone could update the wiki with a fixed version I would be much obliged,

          Thanks
          Just off the top of my head that looks like you're not running the script with the appropriate arguments... it looks like the python script is complaining that an argument is missing, which is the port your Apache server is running on.

          Comment

          • Winus
            Junior Member
            • Sep 2013
            • 2

            #35
            Originally posted by ericgearhart
            Just off the top of my head that looks like you're not running the script with the appropriate arguments... it looks like the python script is complaining that an argument is missing, which is the port your Apache server is running on.
            Had the same issue. I have altered the template to work with zabbix 2.x.
            It can be downloaded here:

            Comment

            • lbarbour
              Junior Member
              • Oct 2013
              • 1

              #36
              zabbix 2.0.9 and query_apachestats.py

              With later versions of Zabbix, such as 2.0.9, importing the template by user Winus will cause an error with something along the lines of "attributes construct error". You have to remove the nested quotes.

              Changing stuff like this:

              Code:
              key="query_apachestats.py["{HOST.CONN}", "80", "D"]"
              To this (or possibly using single-quotes):

              Code:
              key="query_apachestats.py[{HOST.CONN}, 80, D]"
              With the combination of those changes, I was able to get query_apachestats.py working successfully with Zabbix 2.0.9.

              Also... a final gripe:

              WHATS THE POINT OF HAVING A WIKI THAT CAN'T BE EDITED BY THE COMMUNITY? The stuff in there is just getting older and more out of date.

              Comment

              • Winus
                Junior Member
                • Sep 2013
                • 2

                #37
                Maybe copy-pasting the source of the file is what causes the error?
                Accually the source of my file says;


                query_apachestats.py[&quot;{HOST.CONN}&quot;, &quot;80&quot;, &quot;C&quot;]

                Comment

                • chivasregal
                  Junior Member
                  • Jan 2014
                  • 9

                  #38
                  Hi All

                  Im using the 'Method #2' as described in the Wiki, however am getting mixed results.

                  Its working on some of my Apache Servers 2.2.x & older version, but nothing on 2.4.x

                  Has anyone deployed this successfully or can recommend a better method to monitor Apache 2.4.x ?


                  Cheers,
                  JK

                  Comment

                  Working...