Ad Widget

Collapse

Zabbix 2.2 Web Checks

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • MeepleMan
    Junior Member
    • Dec 2013
    • 7

    #1

    Zabbix 2.2 Web Checks

    Does anyone know how the behavior for web checks have changed in 2.2?

    I noticed that web checks are located under the host configuration versus there own heading in our 1.8 installation. Specifically I'd like to know if that means when we specify a URL now if the host header can be different than the host name. When specifying a host header that differs from the server name, will Zabbix send a request to the server that the web check is defined to specifically or will it simply check against the URL like it does in 1.8

    This is a weakness for us in 1.8 as we need the ability to monitor several servers behind a load balancer using the same URL. I was able to work around it by defining a curl check in the zabbix config file on the server, but all checks I have defined show up under the zabbix server and not the server we are actually checking against. It works, but it would be better to have the checks show up under the correct server so we can send alerts to only the correct people if it is tripped.

    ~Phil
  • MaxM
    Member
    • Sep 2011
    • 42

    #2
    I'm using the HOST.DNS macro for the web checks. You should be able to use either HOST.DNS or HOST.IP for any interface. There is no LLD, so hopefully which interface to use is common

    Comment

    • MeepleMan
      Junior Member
      • Dec 2013
      • 7

      #3
      Thanks for the reply.

      If I'm reading it right that may not help in my case.

      I have 3 servers hosting a number of sites with different domains, so we'll say server1, server2, and server3 are each hosting sites at hxxp://domain1/index.php and hxxp://domain2/index.php all behind a load balancer. Domain1 and domain2 are defined in DNS as being located at the farm's VIP.

      If I create a check on server1 for instance hxxp://{HOST.DNS}/index.php the actual check sent will be hxxp://server1/index.php when in reality I need the request to go to the server's IP and the url to be hxxp://domain1/index.php.

      I can see how this would be useful to apply to a template were servers are hosting sites that match the hostname defined in Zabbix, but not in my case.

      Comment

      • enkrypt3d
        Member
        • Oct 2013
        • 32

        #4
        Meepleman:



        This is one of the biggest shortfalls in zabbix IMO....

        In 2.0.6, I was able to at least trigger off of certain things AND I have the same problem in making the hostname a variable which is something other than what the zabbix server is aware of...

        The zabbix gods don't seem to want to acknowledge that this feature is not working and it's not ready for primetime as there are about half a dozen threads about this.

        Comment

        • MeepleMan
          Junior Member
          • Dec 2013
          • 7

          #5
          enkrypt3d-

          From the linked thread it looks like you may be able to define a user macro and use that (Administration > General > Macros). Has anyone tried this?

          If I could define a macro and apply it to a template that would be fantastic, but if it is as you said half-baked, that is unfortunate.

          ~Phil

          Comment

          • MeepleMan
            Junior Member
            • Dec 2013
            • 7

            #6
            It seems that it simply tries to query whatever is in dns for the requested URL.

            I really hope Zabbix puts some more effort behind working with load balanced scenarios in the future. It is not exactly an uncommon configuration.

            Comment

            • MaxM
              Member
              • Sep 2011
              • 42

              #7
              Why not check both?

              I hit each individual server and the load balanced URL's using the same template. This may not suit your case exactly, but I think it is viable. Then, I have a python script that is called every time the server is discovered, and it calls the Puppet API and gathers facts, including which load balancer pool the server is a member of. I then look to see if that pool has a host, and if necessary create it. If the host exists, I check to make sure the right templates are mapped. Your user macro idea is probably viable. I use other macros that are populated to determine whether I should be using http/https (e.g. if I'm passed where I terminate encryption in my stack) and what port (e.g. JBoss => 8080) so that I can have a generic template that hits all points in my stack (external LB interface, web servers, internal LB interface, app servers)

              Comment

              • MeepleMan
                Junior Member
                • Dec 2013
                • 7

                #8
                MaxM

                How are you monitoring the load balancer and individual servers at the same time?

                I created a user macro and used it in a web check that I applied to a template. I then watched what happened in WireShark and I could see the zabbix server query DNS for the domain in the URL and use that IP (Load Balancer VIP) to perform the web check not the IP of server the template was applied to like I had hoped.

                The way I set it up never had Zabbix go directly to the server I was trying to monitor.

                Comment

                • mcxian
                  Junior Member
                  • Mar 2013
                  • 10

                  #9
                  I am waiting for this functionality as well.

                  Comment

                  • MaxM
                    Member
                    • Sep 2011
                    • 42

                    #10
                    I create a host for the pool on the load balancer that has its own IP address and name. I have a separate host for the each web and app server. So in your scenario where you mention having server1, server2, server3, domain1, and domain2... I would create server1, server2, server3, domain1, and domain2 all as hosts in *my* environment.

                    My template config essentially has the following URL:

                    {$APP.PROTOCOL}://{HOST.DNS}:{$APP.PORT}/healthcheck

                    Each host has the {$APP.PROTOCOL}, {$APP.PORT}, and {$APP.PASSWORD} macros set through API automation.

                    As mentioned before, being this pedantic allows me to have one template for each webapp that can monitor *all* tiers. A little over-engineered... sure. However, it works perfectly and it lets me know exactly how many members of the pool are down, allowing me to do groupfuncs to control alerting and put gates on restarts (e.g. essentially accomplishing the scenario... if I'm down to three servers out of ten in a pool, quit restarting and wake a human)

                    Comment

                    • MeepleMan
                      Junior Member
                      • Dec 2013
                      • 7

                      #11
                      I too have a host in Zabbix that was set up just for monitoring the application that is pointed at VIP on the load balancer. I also have a separate host defined for each of the servers hosting the application.

                      Using {HOST.DNS} won't work in my case because non of the application listen for that host header. Even if I were to assign that to one of the applications, I couldn't use it for every one. Assigning the hostname with a different port on each of the hosts is also not an option because these sites are in a DMZ and security wouldn't approve all the holes that would need to be punched in the firewall.

                      Comment

                      • MeepleMan
                        Junior Member
                        • Dec 2013
                        • 7

                        #12
                        mcxian -

                        That's exactly what I'm looking for. It looks like it was created about 3 years ago and is low priority :|

                        I'm going to vote for it, hopefully, the more votes it gets the more visibility it will receive.

                        Comment

                        • jan.garaj
                          Senior Member
                          Zabbix Certified Specialist
                          • Jan 2010
                          • 506

                          #13
                          Web monitoring has a few feature requests


                          I want to code some improvements e.g. Setting http headers see proof of concept for Zabbix 2.2.
                          However I saw a old patches for web monitoring, which was not applied. So I worry if it be wasted time for me.
                          Devops Monitoring Expert advice: Dockerize/automate/monitor all the things.
                          My DevOps stack: Docker / Kubernetes / Mesos / ECS / Terraform / Elasticsearch / Zabbix / Grafana / Puppet / Ansible / Vagrant

                          Comment

                          Working...