Ad Widget

Collapse

Apache monitoring with Zabbix

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • bashman
    Senior Member
    • Dec 2009
    • 432

    #16
    I'll be looking for that!!!
    978 Hosts / 16.901 Items / 8.703 Triggers / 44 usr / 90,59 nvps / v1.8.15

    Comment

    • sue
      Member
      • Mar 2011
      • 41

      #17
      I can monitor apache using method 3 but only for localhost. when i want monitor other host, zabbix agent status say not support. why this happen? anyone can help me?

      Comment

      • bashman
        Senior Member
        • Dec 2009
        • 432

        #18
        Originally posted by sue
        I can monitor apache using method 3 but only for localhost. when i want monitor other host, zabbix agent status say not support. why this happen? anyone can help me?
        Check your "Allow from" apache config file:

        Code:
        <Location /server-status>
                SetHandler server-status
                Allow from 127.0.0.1 # If using a remote host for monitoring replace 127.0.0.1 with its IP.
                Order deny,allow
                Deny from all
        </Location>
        ExtendedStatus On # Optional. Must be in global scope and not in a virtual host
        978 Hosts / 16.901 Items / 8.703 Triggers / 44 usr / 90,59 nvps / v1.8.15

        Comment

        • sue
          Member
          • Mar 2011
          • 41

          #19
          Originally posted by bashman
          Check your "Allow from" apache config file:

          Code:
          <Location /server-status>
                  SetHandler server-status
                  Allow from 127.0.0.1 # If using a remote host for monitoring replace 127.0.0.1 with its IP.
                  Order deny,allow
                  Deny from all
          </Location>
          ExtendedStatus On # Optional. Must be in global scope and not in a virtual host
          I already enable apache on host that i want to monitor. i can call the process from browser or from terminal in my server but it not appear in zabbix monitoring. I change the syntax to call apache process because the syntax before, agent cannot support. When i change, agent support but the value show zero. Do you know how to solve this?

          Comment

          • muratkoc
            Junior Member
            • Mar 2008
            • 23

            #20
            Hi,

            Sue, can you be more clear about what you wanted, do you want to monitor other than localhost with this script? If so, you can't do that, localhost is hardcoded and you have to change it to remote host but it is easier if you put this script to remote host.

            But I have modified script also to be used as external check script. So that you can use this on the zabbix server without putting on remote host. I am assuming that you already know how to use external scripting function?

            Bashman if you accept it here is the version 1.3 also can be used as external check
            Attached Files

            Comment

            • bashman
              Senior Member
              • Dec 2009
              • 432

              #21
              Originally posted by muratkoc
              Hi,

              Sue, can you be more clear about what you wanted, do you want to monitor other than localhost with this script? If so, you can't do that, localhost is hardcoded and you have to change it to remote host but it is easier if you put this script to remote host.

              But I have modified script also to be used as external check script. So that you can use this on the zabbix server without putting on remote host. I am assuming that you already know how to use external scripting function?

              Bashman if you accept it here is the version 1.3 also can be used as external check
              That's great!, the wiki is updated with your new script:

              http://www.zabbix.com/wiki/templates/apache#method_3

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

              Comment

              • sue
                Member
                • Mar 2011
                • 41

                #22
                Originally posted by muratkoc
                Hi,

                Sue, can you be more clear about what you wanted, do you want to monitor other than localhost with this script? If so, you can't do that, localhost is hardcoded and you have to change it to remote host but it is easier if you put this script to remote host.

                But I have modified script also to be used as external check script. So that you can use this on the zabbix server without putting on remote host. I am assuming that you already know how to use external scripting function?
                Unfortunately i think i dont know. i try to add this line in zabbix script
                /usr/local/zabbix/zapache {HOST.CONN}
                and put this line in zabbix_agentd.conf
                UserParameter=apache[*],/usr/local/zabbix/zapache \$2
                After restart the agent, i still cannot monitor remote host. Can you explain??

                Comment

                • bashman
                  Senior Member
                  • Dec 2009
                  • 432

                  #23
                  sue, what do see in zabbix_agentd.log with debug mode?
                  978 Hosts / 16.901 Items / 8.703 Triggers / 44 usr / 90,59 nvps / v1.8.15

                  Comment

                  • sue
                    Member
                    • Mar 2011
                    • 41

                    #24
                    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?

                    Comment

                    • Rudd
                      Member
                      • Mar 2011
                      • 69

                      #25
                      sue, the scoreboard reflects what the various workers are doing, at the time of the check.

                      Reading the request is a very short operation, resulting in the usual longer operation of sending the reply.

                      If the server is not very busy you are less likely to catch the reading of requests.

                      You could consider running the checks more often to increase the resolution of the graphs.

                      Depending on how you configured it you can check the scoreboard via your web browser (e.g.: http://192.168.1.10/server-status) to verify if the values zabbix get look correct.
                      Last edited by Rudd; 27-05-2011, 07:02. Reason: typo

                      Comment

                      • archang3llo
                        Junior Member
                        • May 2011
                        • 10

                        #26
                        Apache Monitoring Script - Method 3 + templates

                        Thanks! With the zapache version 1.3, the method 3 rocks!
                        By the way, here's the apache template for those who need it
                        Attached Files

                        Comment

                        • bashman
                          Senior Member
                          • Dec 2009
                          • 432

                          #27
                          This is great!!!!

                          Thanks archang3llo, your template is in the wiki:

                          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

                          • vrtareg
                            Senior Member
                            • May 2006
                            • 293

                            #28
                            Hi

                            I am experiencing problem with the Method 1 described in Wiki.
                            The script is getting the scientific values for the CPU load when the system is idle and CPULoad parameter becoming not supported:

                            tmp0Vn915:host001 apache[localhost,CPULoad] 9.16204e-5

                            7892:20121227:112001.782 item [host001:apache[localhost,CPULoad]] became not supported: Received value [9.16204e-5] is not suitable for value type [Numeric (float)]

                            I am tried to find the part in the script where the values are collected but as I am not so strong in python it is a little bit tricky for me

                            Just wondering if someone else noticed this?

                            Regards,
                            Areg

                            Comment

                            • vrtareg
                              Senior Member
                              • May 2006
                              • 293

                              #29
                              Hi

                              Just added the following lines to the original fetch.py file which solved my issue. Testing now but seems it is Ok.

                              Code:
                              230c230,233
                              <                 tempfile.write("%s apache[%s,%s] %s\n" % (opts.zabbixsource, opts.host, key, val))
                              ---
                              >                 if key == 'CPULoad':
                              >                     tempfile.write("%s apache[%s,%s] %1.9f\n" % (opts.zabbixsource, opts.host, key, float(val)))
                              >                 else:
                              >                     tempfile.write("%s apache[%s,%s] %s\n" % (opts.zabbixsource, opts.host, key, val))
                              Regards,
                              Areg

                              Comment

                              • brynjellis
                                Junior Member
                                • May 2012
                                • 7

                                #30
                                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

                                Comment

                                Working...