Ad Widget

Collapse

Zabbix item on the zabbix server to ping agentless host where vm (with agent) runs on

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • ankur_hts
    Junior Member
    • Oct 2018
    • 5

    #1

    Zabbix item on the zabbix server to ping agentless host where vm (with agent) runs on

    We're working with Zabbix (2.4.7), i'm going to call this the zabbix server. The zabbix server has many machines which it is monitoring. The machines have zabbix agent installed on them.

    The machines are VMs. We would like to ping the host machine that the vm is running on. The host machines that the vms are running on do not have zabbix agent installed and we do not have access to those host machines.

    The Zabbix server can ping the vms on address 192.168.15.10. The host machine where the vm runs on has an ip address of 192.168.15.5. The third quadrant of the ip changes per vm but the vm is always on the .10 address and the host is always on the .5 address.

    We would like to create a trigger to say, if the host is pingable but the vm is not, then alert.

    I can create the item to ping the vm, but how do i create the item to ping the host? I'd like to add this into the template not add an item per host as we have many vms.
  • kloczek
    Senior Member
    • Jun 2006
    • 1771

    #2
    Zabbix 2.4 is no longer supported. Please try to upgrade to at least 3.4 (best to 4.0).
    http://uk.linkedin.com/pub/tomasz-k%...zko/6/940/430/
    https://kloczek.wordpress.com/
    zapish - Zabbix API SHell binding https://github.com/kloczek/zapish
    My zabbix templates https://github.com/kloczek/zabbix-templates

    Comment

    • ankur_hts
      Junior Member
      • Oct 2018
      • 5

      #3
      Thanks, that is something we're looking into. If and when we do, do you know the solution to the problem in the latest zabbix?

      Comment

      • kloczek
        Senior Member
        • Jun 2006
        • 1771

        #4
        If you are using host prototypes LLD to monitor VMs it should be quite easy to implement.
        http://uk.linkedin.com/pub/tomasz-k%...zko/6/940/430/
        https://kloczek.wordpress.com/
        zapish - Zabbix API SHell binding https://github.com/kloczek/zapish
        My zabbix templates https://github.com/kloczek/zabbix-templates

        Comment

        • ankur_hts
          Junior Member
          • Oct 2018
          • 5

          #5
          Thanks, i don't think that's quite what i'm looking for, and we're not using vmware. I've drawn out the current scenario below for more clarity:

          Click image for larger version

Name:	Screenshot from 2018-11-01 13-49-46.png
Views:	1181
Size:	223.2 KB
ID:	368289

          1) We have an auto discovery rule setup to find new vms. So zabbix server has auto detected the vms 192.168.15.10 and 192.168.16.10.
          2) Zabbix has no knowledge of the host machines 192.168.15.5 and 192.168.16.5 since zabbix agent is not installed on the host machine.
          3) New vms are added to zabbix, and the correct templates are attached to the new vms.
          4) We can ping the vms to ensure that it is up.
          5) Therefore there is an entry for the two hosts in zabbix.

          How do we now go about creating a template that can easily be added to each new vm during auto discovery, where the template has an item that pings the host machine on the .5 address, an item that pings the vm on .10 address, and a trigger to say "if host is pingable and vm is not pingable, then trigger an alert"?

          As far as i can tell there's no way of setting up a zabbix item to:
          1) Use the vm ip address
          2) remove .10
          3) Add .5
          4) Now use this new address in the item to ping it

          Comment

          • kloczek
            Senior Member
            • Jun 2006
            • 1771

            #6
            Originally posted by ankur_hts
            Thanks, i don't think that's quite what i'm looking for, and we're not using vmware.
            It is possible to use hosts prototypes with any existing types of virtualisation or nested subsystems/resources.
            I have template which I'm using hosts prototypes to monitor regression tests of my own distribution. In this template hosts generated by hosts prototypes are rpm packages.
            Depends on next cycle changes some packages are automatically added or removed from monitoring of all packages.
            Thinking about host prototypes as something which needs to be associated with hosts is kind of close mind thinking
            http://uk.linkedin.com/pub/tomasz-k%...zko/6/940/430/
            https://kloczek.wordpress.com/
            zapish - Zabbix API SHell binding https://github.com/kloczek/zapish
            My zabbix templates https://github.com/kloczek/zabbix-templates

            Comment

            • ankur_hts
              Junior Member
              • Oct 2018
              • 5

              #7
              Thanks kloczek.

              I couldn't get my head around host prototypes, so the approach taken was to use external checks:

              1) Create a bash script that zabbix can run against all the vms
              2) Bash script takes the vm ip address as an argument
              3) Bash script alters the ip
              4) Ping the altered ip
              5) Results recorded as an item
              6) There is already a ping item against the vm
              7) Trigger created to check the new item and existing ping item to capture and alert when host is pingable and vm is not
              Last edited by ankur_hts; 09-11-2018, 16:00.

              Comment

              Working...