Ad Widget

Collapse

discovered hosts: only the IP address is shown

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • harri
    Member
    • Nov 2010
    • 89

    #1

    discovered hosts: only the IP address is shown

    Hi folks,

    some of the discovered hosts are listed by their IP address, others are listed by their hostname (short or fqdn). How comes?

    On both clients zabbix_agentd.conf doesn't provide a Hostname option. "zabbix-agent -p" shows the expected system.uname values, so it must be an issue on the server. But the debug log file on the server doesn' show.


    I really would like to see FQDNs instead of IP addresses. Any helpful comment would be highly appreciated

    Harri
  • untergeek
    Senior Member
    Zabbix Certified Specialist
    • Jun 2009
    • 512

    #2
    Um, if the zabbix_agentd.conf doesn't have the Hostname parameter, it's not because it can't go there. It should be there by default. Perhaps you have an outdated client or outdated config file. You may wish to update either/both if they're incomplete or outdated.

    If you're using discovery, make sure that the Hostname directive in the zabbix_agentd.conf is defined with what reverse-dns will get from the discovered IP.

    Example:
    Code:
    $ host zabbix.example.com
    zabbix.example.com has address 10.0.0.1
    $ host 10.0.0.1
    1.0.0.10.in-addr.arpa domain name pointer zabbix.example.com.
    Inside zabbix_agentd.conf:
    Code:
    Hostname=zabbix.example.com
    And optionally:
    Code:
    SourceIP=10.0.0.1
    ListenIP=10.0.0.1

    Comment

    • harri
      Member
      • Nov 2010
      • 89

      #3
      zabbix-agent is version 1.8.3. Both system.hostname and system.uname are set. Example:

      Code:
      # zabbix-agentd -p | egrep hostname\|uname
      system.hostname       [t|sebos11i011]
      system.uname          [t|Linux sebos11i011 2.6.34.7-0.5-desktop #1 SMP PREEMPT 2010-10-25 08:40:12 +0200 i686 i686 i386 GNU/Linux]
      There is no reverse zone file, which might explain why only the IP address is shown. But the "device uniqueness criteria" in the Discovery rule is set to "system.uname", which means (IMU) that the IP address of the host might change. A reverse lookup using the volatile IP address wouldn't bring in any new reliable information, not to mention the difference between short host name and FQDN.

      ???

      Comment

      • untergeek
        Senior Member
        Zabbix Certified Specialist
        • Jun 2009
        • 512

        #4
        Whoa. Discovery with non-static host IPs? That sounds like…well, like a pain.

        In this case, I'd define the Hostname= statically to be the FQDN. system.uname can sometimes be the short host name. The discovery monitoring will still only show IPs, but the hosts added by discovery will be named based on what's in the Hostname= line of your zabbix_agentd.conf (at least that's my belief. I'm not 100% on that as it tends to be reverse lookup related).

        The system.uname will still be a good unique identifier, even if it's the short name (those should be unique, of course). See if that works for you.

        Comment

        • harri
          Member
          • Nov 2010
          • 89

          #5
          Originally posted by untergeek
          Whoa. Discovery with non-static host IPs? That sounds like…well, like a pain.
          Why? The (virtual) hosts are supposed to pop up and go away as needed. Zabbix is supposed to discover, to monitor and to forget the hosts. Sounds like Zabbix' basic functionality to me.
          In this case, I'd define the Hostname= statically to be the FQDN. system.uname can sometimes be the short host name. The discovery monitoring will still only show IPs, but the hosts added by discovery will be named based on what's in the Hostname= line of your zabbix_agentd.conf (at least that's my belief. I'm not 100% on that as it tends to be reverse lookup related).

          The system.uname will still be a good unique identifier, even if it's the short name (those should be unique, of course). See if that works for you.
          I agree that the system.uname would be a good identifier, but it seems you are mixing up system.uname and system.hostname. AFAICS the system.uname contains (next to the output of /bin/hostname) the kernel version, platform, build time, etc. If Zabbix uses system.uname to distinguish between the monitored clients, then IMU this is not related to the Hostname option in zabbix-agentd.conf.

          My major problem with the Hostname option is: The virtual hosts are supposed to be cloned from the same template as needed. They are configured at boot time using dhcp options (as far as possible). If I have to hardwire different identifiers into zabbix-agentd.conf on each clone to help the Zabbix server to distinguish between all these virtual hosts, then cloning gets _way_ more difficult.

          Comment

          • untergeek
            Senior Member
            Zabbix Certified Specialist
            • Jun 2009
            • 512

            #6
            You are correct with the uname. I was using it interchangeably with hostname, in error.

            My observation is based on our model, which is not one which has servers frequently coming in and out of use. We're pretty static with hosts, IPs and such. I'm just trying to wrap my experience with Discovery around what I read in your post.

            It has been my experience that discovery works with forward and reverse lookups to match, and to correlate with the Hostname directive in the zabbix_agentd.conf

            While this does not necessarily mean that what you're trying to do can't work, I am unsure how well it will work.

            If you look at the individual host configurations, do you see where it is configurable to Connect to IP or to DNS name (drop-down)? Perhaps the difference is there. It may default to one but use the other if option A) can't be resolved.

            I found that if I had the Hostname wrong, discovery would wind up with 2 hosts, one with whatever was in Hostname= and the other was what resolved with the reverse lookup of the IP. Neither would correctly get linked to templates (in my case, based on our discovery method).

            Your mileage may vary. I'd love to hear the solution, just for future knowledge.

            Comment

            • harri
              Member
              • Nov 2010
              • 89

              #7
              IMU the host identifier to be used by Zabbix is derived from 4 different values:

              - the "Hostname" option in zabbix-agentd.conf
              - the output of "uname -n" on the client
              - the result of the reverse lookup for the clients IP address (run on the server)
              - the clients IP address

              What I would like to know is which one takes precedence over others in what situation, which values have to match, and which values are mandatory or optional? I would guess this information could help to avoid a lot of confusion.


              Harri

              Comment

              • harri
                Member
                • Nov 2010
                • 89

                #8
                IMU the host identifier to be used by Zabbix is derived from 4 different values:

                - the "Hostname" option in zabbix-agentd.conf
                - the output of "uname -n" on the client
                - the result of the reverse lookup for the client's IP address (run on the server)
                - the client's IP address

                What I would like to know is which one takes precedence over others in what situation, which values have to match, and which values are mandatory or optional? I would guess this information could help to avoid a lot of confusion.


                Harri

                Comment

                • rchannel
                  Junior Member
                  • Apr 2014
                  • 5

                  #9
                  ShortName

                  Anyway to force it to use just the shortname. I do not want the FQDN.

                  Comment

                  • tvtue
                    Member
                    • Sep 2012
                    • 71

                    #10
                    Originally posted by rchannel
                    Anyway to force it to use just the shortname. I do not want the FQDN.
                    Hi, did you find a solution to only using the shortname?

                    I see in my environment that the discovery adds the hosts with the FQDN. For the sake doing as less changes to the config as possible on the agents, I would prefer not to set the Hostname= setting. But then agent.hostname provides the shortname which doesn't match with that in the GUI. And you get those ugly host xyz not found messages in the log.

                    Zabbix Server 2.2.1
                    Zabbix Agentd 2.0.3

                    TIA
                    Timo

                    Comment

                    Working...