Ad Widget

Collapse

Monitor web application hosted on different servers.

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • Alekc
    Junior Member
    • Oct 2013
    • 3

    #1

    Monitor web application hosted on different servers.

    Hello, I have some problems with understanding how to monitor web application which resides on different hosts.

    Let's say i have a site which is hosted on ServerA and ServerB, which have zabbix agent installed on them.

    If I understand correctly, even if I create web monitor on each host, they will be executed from zabbix server, so only one of the server will be pulled, right?

    Do I need to setup proxies on these hosts?
  • Alekc
    Junior Member
    • Oct 2013
    • 3

    #2
    Nobody uses this feature?

    Comment

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

      #3
      Probably you use load balanced site (maybe you use DNS balancing). Usually load balancer monitors health of web backends with specific web healthchecks. And monitoring solution monitors only loadbalancers status (missed backends, overloading, ...)

      If your Zabbix server is in network with backends (your hosts ServerA and ServerB) then only publish your site (by aliasing, don't forget for DNS settings) in internal network with special name (server-a.site.com.internal, server-b.site.com.internal) and then create web monitoring, which checks these "new" sites.
      IMHO this is standard/good solution, because you know state for site.com, but also you know states for every backends of site.com.

      If you are in external network, it'll be worse. You can't use web monitoring in Zabbix, but you can still use your own custom scripts. You can do something like:
      wget --header="Host: site.com" http://<IP-OF-SERVERA>
      wget --header="Host: site.com" http://<IP-OF-SERVERB>
      for checking status of your backends.
      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

      • Alekc
        Junior Member
        • Oct 2013
        • 3

        #4
        Thanks for reply.

        Unfortunately my case is a bit different, it's a varnish (caching server) and a real server behind which i need to check, so i need to be sure that people sees the right thing on Varnish (using hostname which they are using), and on it's backend.

        Varnish and it's backend has domain name written in file host (so it resolves at 127.0.0.1), so if Only Zabbix could make a web request through the agent and not from server I would be ok.

        Comment

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

          #5
          You can't use agent for web monitoring. Only Zabbix server make web monitoring requests.

          So you can try to setup your Varnish for passing non cached web test requests (not tested approx. Varnish config):
          Code:
          if(req.request == "GET" && req.url == "(no-cache-1)$") {
             set req.backend = backend1;
             pass;
          }
          
          if(req.request == "GET" && req.url == "(no-cache-2)$") {
             set req.backend = backend2;
             pass;
          }
          Then setup your web monitoring in Zabbix:
          http://example.com/?no-cache-1 for site from backend1
          http://example.com/?no-cache-2 for site from backend2
          If you config Varnish appropriately, you can use suffix no-cache-x anywhere: example.com/page/?no-cache-x
          http://example.com - for Varnished version of your site



          i need to be sure that people sees the right thing on Varnish
          It depends on Varnish configuration
          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

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

            #6
            Another idea: you can use also Zabbix agent, but you have to configure item type as Zabbix agent active and then you can use these keys:
            Code:
            web.page.get[host,<path>,<port>]
            web.page.perf[host,<path>,<port>]
            net.tcp.service[service,<ip>,<port>]
            net.tcp.service.perf[service,<ip>,<port>]
            Reference:
            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...