Uploaded image for project: 'ZABBIX BUGS AND ISSUES'
  1. ZABBIX BUGS AND ISSUES
  2. ZBX-24636

{HOST.IP} and {HOST.DNS} not blank if undefined in 7.0.0RC3

XMLWordPrintable

    • Icon: Problem report Problem report
    • Resolution: Fixed
    • Icon: Major Major
    • 7.0.4rc1, 7.2.0alpha1 (master)
    • 7.0.0
    • Server (S)
    • None
    • Ubuntu 22.04.04, PostgresSql, updated from distro to 7.0.0rc3.
    • Prev.Sprint, S24-W32/33
    • 0.25

      I upgraded from a previous beta to RC3 and numerous triggers immediately started failing.

      Steps to reproduce:

      1. External check such as DNSMatchIP[\{HOST.DNS},\{HOST.IP},\{$OPTIONAL_DOMAINS}]
      2. In the host, leave either the host name or the host IP blank (not specified) in the agent interface definition (in my case only agent is defined not snmp, etc.)
      3. the script code invoked looks like
        hostname="$1"
        ip="$2"
        addedDomain="$3"
        
        if [ -z $ip ]
        then
            # Consider a blank IP as on purpose, as it implies a DNS lookup for IP anyway
            echo "Ok"
            exit
        fi
        
        if [ -z $hostname ]
        then
            # Consider a blank name as on purpose (we can report these in various debug queries if not)
            echo "Ok"
            exit
        else
            if [ -z $ip ]
            then
                echo "Missing IP address"
                exit
            fi
        fi
        
        

         

      Result:
      **

      In the prior beta (and going back many versions over years), these macros became blank if undefined. Now they are appearing as their text, e.g. instead of (without quotes) "" they appear as "{HOST.IP}" or "{HOST.DNS}". 

      Expected:

      I am unable to find any documentation that this is on purpose (though I confess I may have just missed it), but it seems incorrect, and will break people's code that presume the behavior remained the same. 

        1. action.jpg
          action.jpg
          43 kB
        2. macros.jpg
          macros.jpg
          696 kB
        3. image-2024-06-17-20-14-46-542.png
          image-2024-06-17-20-14-46-542.png
          18 kB
        4. screenshot-1.png
          screenshot-1.png
          16 kB
        5. Screenshot 2024-08-14 at 16.34.26.png
          Screenshot 2024-08-14 at 16.34.26.png
          44 kB

            vso Vladislavs Sokurenko
            Linwood Linwood Ferguson
            Team B
            Votes:
            3 Vote for this issue
            Watchers:
            10 Start watching this issue

              Created:
              Updated:
              Resolved: