Ad Widget

Collapse

HOST.* macros

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • Bernd Hohmann
    Member
    • Mar 2013
    • 46

    #1

    HOST.* macros

    I'm new to Zabbix have some problems to understand the various HOST.* macros in conjunction with the Agent/SNMP/JMX/IPMI-Interface fields.

    As far as I understand, the inputfield "Host name" must be a FQDN and is copied into the macro HOST.HOST. Then the resolver finds the IP for the host and copies the address into HOST.IP (variables formerly known as HOSTNAME and IPADDRESS). Right?

    HOST.NAME comes from the inputfield "Visible name". Right?

    So when I know the FQDN Hostname and the IP for the host why are there additional input fields for IP/DNS-Name for the various interfaces? Which concept I missed here?

    I didn't found out what HOST.CONN and HOST.DNS is good for.

    Maybe someone more experienced can help me out - thanks in advance!

    Bernd
  • Bernd Hohmann
    Member
    • Mar 2013
    • 46

    #2
    push.. schubs...

    Comment

    • heaje
      Senior Member
      Zabbix Certified Specialist
      • Sep 2009
      • 325

      #3
      I'm not sure what that last post meant, but it doesn't seem the connotation was good. Just a word of advice, but getting upset about not receiving an answer doesn't typically help with getting an answer. I for one had seen this post a couple days ago, but have not had a chance to respond until today.

      In any case, take a look at the documentation here: https://www.zabbix.com/documentation...ed_by_location

      Yes, HOST.NAME comes from the visible name field.

      Pay special attention to the footnote entries. Specifically, here is entry 3 for the HOST.* stuff:

      "Depending on the context, the macro will be expanded differently.

      In 2.0.1 or earlier version in the context of remote command execution, GUI scripts, item key parameters, and interface IP/DNS fields only the main agent interface will be considered as the source of information.

      Since 2.0.2 the macro will use the main agent interface, however, if it is not present, main SNMP interface will be used. If SNMP is also not present, main JMX interface will be used. If JMX is not present either, main IPMI interface will be used.

      In item key parameters the interface that is selected for the item will be used, since 2.0.3."

      So, HOST.CONN will use either the IP address or DNS address (depending on what you have configured) for the interfaces in the order specified in the footnote.

      HOST.DNS will force it to use the DNS address for the interfaces in the order specified in the footnote.

      HOST.IP will force it to use the IP address for the interfaces in the order specified in the footnote.

      Comment

      • Bernd Hohmann
        Member
        • Mar 2013
        • 46

        #4
        Originally posted by heaje
        Since 2.0.2 the macro will use the main agent interface, however, if it is not present, main SNMP interface will be used. If SNMP is also not present, main JMX interface will be used. If JMX is not present either, main IPMI interface will be used.

        In item key parameters the interface that is selected for the item will be used, since 2.0.3."

        So, HOST.CONN will use either the IP address or DNS address (depending on what you have configured) for the interfaces in the order specified in the footnote.
        My problem is that I don't grook the concept behind it.

        First I have to enter a FQDN in "Host name", then I have to enter either IP or an FQDN for the Agent, the SNMP and so on. I didn't found a use-case where the hostname for the agent (or SNMP, JMX...) is different from the hostname given in the Field "Host name". Furthermore I have to define at least one entry in the Agent/SNMP/JMX/IPMI field even if I use external checks only.

        Confusing..

        Bernd

        Comment

        • heaje
          Senior Member
          Zabbix Certified Specialist
          • Sep 2009
          • 325

          #5
          In your case the host name may not be different than the fqdn for the host, but I personally have done many cases where it is NOT the fqdn. I've even had devices that do not have DNS entries at all and I have to use the IP.

          I agree the external checks only thing can be confusing, but zabbix has to know somehow where to connect given that the name does not necessarily match the fqdn.

          Comment

          • Bernd Hohmann
            Member
            • Mar 2013
            • 46

            #6
            Originally posted by heaje
            I agree the external checks only thing can be confusing, but zabbix has to know somehow where to connect given that the name does not necessarily match the fqdn.
            Do you have an example for such a combination?

            I found out that an empty hostname macro (like in "some.thing[,4]) is substituted by "HOST.HOST" so the field "Host name" with a fqdn is needed in most cases.

            Bernd

            Comment

            • heaje
              Senior Member
              Zabbix Certified Specialist
              • Sep 2009
              • 325

              #7
              I found out that an empty hostname macro (like in "some.thing[,4]) is substituted by "HOST.HOST" so the field "Host name" with a fqdn is needed in most cases.
              Can you give an example key that has that problem? I can't find any by looking in the documentation.


              As for an example, here it is:

              Let's say I have an application that runs across 1000 servers. Each individual instance of that application across all 1000 servers services a certain number of client connections. Now let's say I want to know how many connections there are total across all one hundred servers, the total number of failed connection, the total number errors in log files, etc. I could have a script on a single app server that goes out and collects all that data, but it wouldn't make sense to store all that data under that host in Zabbix because the data represents all hosts. In this case, here is what I would do:

              1. Make sure all 1000 hosts were a part of the same host group.
              2. Create a new host and give it a name like "App Totals". Note, "App Totals" obviously will not resolve via DNS.
              3. Create a zabbix agent interface that points to one of the 100 app servers. Note that the IP/DNS here could be for any 100 of the servers because any of them can run the script to get the data.
              4. Create an item that hits that "virtual host" (again, there is not really a host in reality called "App Totals") and runs the script.

              Comment

              • Bernd Hohmann
                Member
                • Mar 2013
                • 46

                #8
                Originally posted by heaje
                Can you give an example key that has that problem? I can't find any by looking in the documentation.
                net.tcp.service[] and so on are going to HOST.HOST in their presets (if mind serves). In my opinion (as a newcomer to Zabbix) the whole HOST.* and Host-Preset stuff needs rework and clarification.

                And for Templates/Hosts with "external checks only": because I cannot delete the last interface (usually "Agent interface"), Zabbix will show me a big red "Z" because the agent is not reachable. A little bit stupid behaviour for a such matured product.

                Originally posted by heaje
                [...]4. Create an item that hits that "virtual host" (again, there is not really a host in reality called "App Totals") and runs the script.
                Ok, I understand that there is a use for it. Maybe I'll use your trick too when it comes to monitor everything here.

                Thanks for your help,

                Bernd

                Comment

                • heaje
                  Senior Member
                  Zabbix Certified Specialist
                  • Sep 2009
                  • 325

                  #9
                  As you find things that don't work as you expect, you're always welcome to submit bugs on the Zabbix bug tracker here: https://support.zabbix.com/secure/Dashboard.jspa.

                  Comment

                  Working...