Ad Widget

Collapse

Web Scenario override IP

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • beliali
    Junior Member
    • Dec 2014
    • 7

    #1

    Web Scenario override IP

    Hello! Im new here in the forums, but we've been using Zabbix for a while now and I'm loving the amount of different settings and customisations it has, however I have run into a wall and am hoping that some of you might be able to help me.

    I need to setup zabbix to check a specific website. From what I understand, I need to do this via the Web Scenarios tab and zabbix then uses curl to connect to the website in question. Right?

    So here is my question:

    I've setup the web scenario and everything, but I need to be able to override the IP address of the host.

    I mean the zabbix host should run a command similar to this one to satisfy my needs:

    curl -H "www.domain.com" 123.123.123.123

    Where I could specify both the domain and the destination IP address. I'm able to specify the target URL in Web Scenarios, but not the IP address. Or am I just not seeing it? I need this because the website I am checking can be loaded from a bunch of different locations and I need to make sure that they are all working fine.

    I hope its clear what I'm looking for and that some of you know the answer!
  • beliali
    Junior Member
    • Dec 2014
    • 7

    #2
    anyone?

    Comment

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

      #3
      Zabbix 2.4 and field Headers is your good friend in this case:


      Use IP in URL and hostname http header in Headers.
      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

      • beliali
        Junior Member
        • Dec 2014
        • 7

        #4
        Thats awesome, sounds like exactly what I was looking for!

        I'm kind of new in the whole networking field, but could anyone tell me what I'm doing wrong?

        In the Headers field of the Web Scenario step I added the following:

        "Host: www.domain.com" 123.123.123.123

        Is this right? Because for whatever reason, it seems to ignore the IP address part and simply checks domain.com from its origin, and that is not what I need.

        I tried adding this header either to the Web Scenario 'Scenario' tab or into the 'Step' section, but it came back with the same results.

        Comment

        • beliali
          Junior Member
          • Dec 2014
          • 7

          #5
          Also, I did not mention it before, but I'm using Zabbix 2.4.2

          Comment

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

            #6
            See attached image.
            Attached Files
            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

            • beliali
              Junior Member
              • Dec 2014
              • 7

              #7
              Thats awesome! exactly what i needed. could you also confirm, if one step fails, does it still do the other steps or does it stop after failing one?

              Comment

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

                #8
                I can't find it in the manual. But I have my own experience: yes, web check stops after failing step.
                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

                • beliali
                  Junior Member
                  • Dec 2014
                  • 7

                  #9
                  Alrighty, thank you for the answers. Another question then

                  I've setup the web scenarios and some of them seem to always fail, but I've got no idea why, because if I run a 'curl -H "Host: www.domain.com" 123.123.123.123' command from the same machine where the Web Scenario is running, it works fine.

                  So my question is two-fold:
                  1. Is there any place where zabbix would show what failed? I checked the zabbix_agentd.log on the machine where the Web Scenario is supposed to be running, but its empty.

                  2. Where does zabbix hold these Web Scenarios so I could see/edit them manually via CLI?

                  Comment

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

                    #10
                    Web monitoring is always executed on Zabbix server, not Zabbix Agent.
                    Use Web monitoring debug feature in Zabbix 2.4 server: url]http://blog.zabbix.com/zabbix-2-4-features-part-8-debugging-web-and-vmware-monitoring/3675/[/url]
                    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

                    • beliali
                      Junior Member
                      • Dec 2014
                      • 7

                      #11
                      I run a single Zabbix Server on a separate machine and then many Zabbix Agents on different machines.
                      I created a new Template, added an item to it and then using the item created a few Web Scenarios.

                      I then added this Template to a few hosts. If the Web Scenarios are not being executed on the Host side (agent), but the main Zabbix Server, what is the point of adding them to hosts?

                      Sorry for the many questions, but I'm just taking advantage of the fact that there's a person who knows stuff and is willing to share the knowledge

                      Comment

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

                        #12
                        You can assign all web checks to one host "webchecker", but then you will see events:
                        "webchecker" - "URL of host A failed"
                        "webchecker" - "URL of host B failed"
                        ...
                        And your monitored hosts A,B,... will be green, even their webs are failing.

                        It's only about logical relationship between web check and host.
                        Usually you check URL of monitored web host - if web check fails, it's problem of host. So web check assigned to host is better concept.

                        Also if you are using webchecks assigned to host, then you can use host macros. For example you need to check default index on all your hosts. Then just create web check template with url "http://{HOST.HOST}/" and assign it to all hosts.

                        BTW: you can run some simple webcheck actions on the agent. Check web.page.* keys: https://www.zabbix.com/documentation...rted_item_keys
                        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

                        • aib
                          Senior Member
                          • Jan 2014
                          • 1615

                          #13
                          Originally posted by beliali
                          I then added this Template to a few hosts. If the Web Scenarios are not being executed on the Host side (agent), but the main Zabbix Server, what is the point of adding them to hosts?
                          Just imagine that you have a big farm of web-servers.
                          One Zabbix server can control, that:
                          - ping to web-server is working
                          - CPU on web-server is not overloaded
                          - web-site on web-server is answering to Zabbix Server.

                          Zabbix web-check were made for centralizing of all checks, not for distributed monitoring.

                          If you need the functionality of distributed monitoring, you can use simple web-checks functionality, as jan.garaj pointed for you.

                          Or you can create your own scripts to test any functionality, which you need, place that scripts on Zabbix Agent's clients and use it through UserParameter= in zabbix_agent.conf file.
                          Sincerely yours,
                          Aleksey

                          Comment

                          Working...