Ad Widget

Collapse

Monitor agent host through 2 ip addresses

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • nahueld
    Junior Member
    • Nov 2021
    • 13

    #1

    Monitor agent host through 2 ip addresses

    Hi,
    I'm trying to monitor a remote pc, which i can reach through 2 IP addresses. So i created 2 interfaces for that host, as its shown in the image below.


    Click image for larger version

Name:	image.png
Views:	2352
Size:	11.1 KB
ID:	450579
    I want to make the server monitor the host through the first interface, and if something goes wrong (we lose connectivity), it starts polling the host through the second interface.

    Is there a way to do this, without creating another host, in order to avoid having the same info twice.


    I'm using zabbix 5.0.17, running over Rocky Linux8

    Any comment/advice helps me.

    Thank you,
    Nahuel.
  • Bartosz Mickiewicz
    Junior Member
    • Oct 2022
    • 27

    #2
    Take a look at the Agent config file, ListenIP allows you to set the agent to listen on more than 1 IP address. Here is documentation regarding the agent config file.

    Comment

    • cyber
      Senior Member
      Zabbix Certified SpecialistZabbix Certified Professional
      • Dec 2006
      • 4807

      #3
      Originally posted by bartosz.mickiewicz
      Take a look at the Agent config file, ListenIP allows you to set the agent to listen on more than 1 IP address. Here is documentation regarding the agent config file.
      This does not make zabbix to use other interface for connecting to that host....There is no such option, if one IF fails, try anohter.. Items are bound to IF, so basically you would need to add same items with different IF config to same host... But that again is not going to happen as you cannot have items with same key on a host.. Somekind of workaround would be trigger an action to update IF of all items of the host to other one over API in certain conditions (like no ping to server-> action fired, script updates items)
      It seems easier to have one host described twice, with different IP... Of course with different names...

      Comment

      • Semiadmin
        Senior Member
        • Oct 2014
        • 1625

        #4
        If possible, just use the agent in active mode

        Comment


        • nahueld
          nahueld commented
          Editing a comment
          Already using it, but we have problems with the network design and trying to solve this way would be even worse, this is my last choice.
          Thanks
      • nahueld
        Junior Member
        • Nov 2021
        • 13

        #5
        Originally posted by cyber

        Somekind of workaround would be trigger an action to update IF of all items of the host to other one over API in certain conditions (like no ping to server-> action fired, script updates items)
        It seems easier to have one host described twice, with different IP... Of course with different names...

        I thought about doing that but i wanted first to be sure that there wasnt an easier way.
        And about having a host described twice with different IP, i didnt want to have duplicate information, but i think this could be the easiest way.

        Thank you,
        Nahuel

        Comment

        • cyber
          Senior Member
          Zabbix Certified SpecialistZabbix Certified Professional
          • Dec 2006
          • 4807

          #6
          Active agent and 2 host definitions is not the worst option... You can set multiple hostnames in agent config and when you define both of those in Zabbix, with different IP, you will use same agent via 2 separate paths... yes, agent will do double work, if you have same items defined, but usually it is not noticeable load... And you may just configure absolutely necessary items twice, not everything...

          Comment


          • nahueld
            nahueld commented
            Editing a comment
            Ok, i didnt know that multiple hostnames could be defined in the same host. I'll try if this could be done in the network. And decide which items are absolutely necessary to have.

            Thank you
        Working...