Ad Widget

Collapse

Any way to discover hostname mismatches?

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • ben.bressler
    Member
    • Dec 2012
    • 45

    #1

    Any way to discover hostname mismatches?

    When adding a new host in zabbix you specify the hostname. Occasionally we have updated the hostname on a server and forgot to update it on zabbix. Is there any way to compare the hostname that system.hostname reports to the one entered into zabbix?
  • Koral
    Member
    • Oct 2012
    • 30

    #2
    Probably:
    system.hostname.last(0)#{HOST.HOST}

    Comment

    • steveboyson
      Senior Member
      • Jul 2013
      • 582

      #3
      The host name as appearing in zabbix has not neccessarily something to do with the real hostname returned by "hostname -s".

      It depends if you have set the "Hostname=" entry in the agent's conf.
      If set, this entry has to have a matching entry in zabbix.
      That means you can name your host (by means of OS) as you want.
      In that case the solution koral provided should work, perhaps you've to use {HOST.NAME}.

      If the entry mentioned above is not set, the Zabbix hostname is determined by the setting of "HostnameItem=" in zabbix-agentd.conf. When disabled, it uses "system.hostname" which you have CHANGED.

      In that case you no longer will get any item values back to zabbix since the agent changed its zabbix hostname but the name is unchanged in zabbix DB and zabbix server.

      For that, you should work with some of "nodata" triggers.

      Comment

      • steveboyson
        Senior Member
        • Jul 2013
        • 582

        #4
        I just found that comparison of strings is not supported.

        At the very end.

        So, a trigger like
        Code:
        system.hostname.str("{HOST.NAME}")#1
        should be tested.

        Comment

        Working...