Ad Widget

Collapse

Feature Request: Ability to use hostnames instead of IPs

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • cameronsto
    Senior Member
    • Oct 2005
    • 148

    #1

    Feature Request: Ability to use hostnames instead of IPs

    It would be really helpful to be able to use hostnames (www.yahoo.com for example) instead of IP addresses in hosts, agent configuration, and items in Zabbix.

    I need this for several reasons, one of which is I like to poll several remote machine which are dynamic IP addresses for stats in order to get a more distributed view of performance for my machines. When they're IP addresses change, Zabbix loses connections to them. If I could use a hostname, I could use one of the dynamic dns services to always have the right IP address.

    Again, this would be useful in all locations within Zabbix where one could use IP address.

    Thanks,

    Cameron
  • elkor
    Senior Member
    • Jul 2005
    • 299

    #2
    as far as I know.. you can already do this.

    Comment

    • cameronsto
      Senior Member
      • Oct 2005
      • 148

      #3
      Really? Across hosts and items? I guess I never tried because it always just said IP. Does it work for the Win32 agent as well?

      Thanks.

      -cameron

      Comment

      • elkor
        Senior Member
        • Jul 2005
        • 299

        #4
        I'm pretty sure, yeah.

        admittedly.. I use IP addresses because our naming convention sucks. so I'm not 100% positive, but I'd give it a try if I were you.

        Comment

        • cameronsto
          Senior Member
          • Oct 2005
          • 148

          #5
          Ok, I've done some testing (which I guess I should've done in the first place ). Hostnames seem to work fine in items, which is good.

          As far as using hostnames within hosts, this seems to work when this is defined in the "Host" field, but sometimes I'd like to have a different name for the host within zabbix then it's actual hostname, as hostnames can get quite long. Trying to do this doesn't work as you can't use a hostname within the IP field.

          A more legitimate reason for needing this (rather than just "i'd like to...") is having more than 1 machine NAT'd behind one hostname. I may have 1 hostname for a gateway, but 5 machines behind it and I wouldn't want to have to differentiate between them just on which port I defined them by.

          -cameron
          Last edited by cameronsto; 14-02-2006, 22:36.

          Comment

          • KarmaPolice
            Member
            • Oct 2005
            • 95

            #6
            I use only hostnames because we change IPs a lot... so yes... this is possible and works (so far) flawlessly

            Comment

            • elkor
              Senior Member
              • Jul 2005
              • 299

              #7
              Originally posted by cameronsto
              Ok, I've done some testing (which I guess I should've done in the first place ). Hostnames seem to work fine in items, which is good. As far as using hostnames within hosts, this seems to work when this is defined in the "Host" field, but sometimes I'd like to have a different name for the host within zabbix then it's actual hostname, as hostnames can get quite long. Trying to do this doesn't work as you can't use a hostname within the IP field.

              -cameron

              Yep. that's why I use ipaddresses for that

              In all honesty though you can give each host a short "label" if you are putting it on a map or something so that the long name doesn't mess the display. but yes.. you are correct.

              you could probably try putting the long name in the local host file along with the short one if you don't mind maintaining /etc/hosts.

              Comment

              • cameronsto
                Senior Member
                • Oct 2005
                • 148

                #8
                It seems it might be easy (maybe...) to allow an IP or a hostname in the IP field (maybe change the field label to IP/Host). This way one could just use the Host field if they wanted and zabbix would default to it if "Use IP address" was unchecked, or one could specify an IP/hostname within the IP field for zabbix to use while allowing for "better" names for the host. This might also allow for spaces in the names if we were forced to use both the host and IP fields, which would be nice... Ideas?

                -cameron
                Last edited by cameronsto; 14-02-2006, 22:41. Reason: I say 'just' way too often

                Comment

                • cameronsto
                  Senior Member
                  • Oct 2005
                  • 148

                  #9
                  Forgot to mention something. It looks like using a hostname within the IP field works...if it's short enough. I have a host that I am monitoring this way, that just happens to have a short hostname. However if I use a longer hostname, it appears to trim the name to the maximum length that an IP address could be (15 characters). Could be a simple PHP change to make. I'll check it out later tonight.

                  -cameron
                  Last edited by cameronsto; 15-02-2006, 04:45. Reason: Fixed number of characters

                  Comment

                  • cameronsto
                    Senior Member
                    • Oct 2005
                    • 148

                    #10
                    Looks like it's just the database limiting the IP value to 15 characters. I changed it to 64 characters and I'm able to add long hostnames in the IP field, and everything still functions properly.

                    -cameron

                    Comment

                    Working...