Ad Widget

Collapse

Installing agent 2 MSI via MSIEXEC using the hostinterfaceitem parameter

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • itimanuf
    Junior Member
    • Dec 2024
    • 11

    #1

    Installing agent 2 MSI via MSIEXEC using the hostinterfaceitem parameter

    Hello,

    I have been trying to install the zabbix agent 2 using Endpoint Central. To do this, I copy over the MSI to the server in question and run a bat file to install the agent as a service.
    To get this done, I would like to use this command, but currently it isn't changing the



    msiexec /lv "C:\log.txt" /i "C:\Program Files\Zabbix Agent 2\zabbix_agent2-7.2.2-windows-amd64-openssl.msi" TARGETDIR="C:\Program Files\Zabbix Agent 2" SERVER="ZabbixProxyServerHere".internal.cloudapp.n et HOSTNAMEITEM=system.hostname[fqdn] HOSTINTERFACEITEM=system.hostname[fqdn] SERVERACTIVE=ZabbixProxyServerHere HOSTMETADATA=Windows ENABLEPATH=1 /qn

    The issue I'm having is that this isn't adding these values to the conf file.
    HOSTNAMEITEM=system.hostname[fqdn]
    and
    HOSTINTERFACEITEM=system.hostname[fqdn]
    The SERVERACTIVE and HOSTMETADATA is being added to the conf file without an issue.

    I found that if I use the HOSTINTERFACE parameter instead of HOSTINTERFACEITEM, it does add this value to the conf file, but then the auto registration doesn't work.
    I then get this error. "no active checks on server [ZabbixProxyServerHere:10051]: "system.hostname[fqdn]" is not a valid IP or DNS

    Any tips on how this should be configured?
    Thanks in advance!

    Kr,

    Maarten
  • cyber
    Senior Member
    Zabbix Certified SpecialistZabbix Certified Professional
    • Dec 2006
    • 4806

    #2
    I have not dealt with windows installs much, but maybe because "system.hostname" item has no such option as "fqdn" ?
    system.hostname[<type>, <transform>]
    System host name. String type (before version 5.4.7 supported on Windows only) - possible values: netbios (default on Windows), host (default on Linux), shorthost (since version 5.4.7; returns part of the hostname before the first dot, a full string for names without dots).
    transform (since version 5.4.7) - possible values:
    none (default), lower (convert to lowercase)
    hostinterfaceitem, if you set it as "system.hostname[fqdn]" it is taken literally and you get that error in logfile, as you dont have a host called "system.hostname[fqdn]"

    Comment

    • itimanuf
      Junior Member
      • Dec 2024
      • 11

      #3
      I ended up going with this instead.
      msiexec /lv "C:\log.txt" /i "C:\Program Files\Zabbix Agent 2\zabbix_agent2-7.2.2-windows-amd64-openssl.msi" TARGETDIR="C:\Program Files\Zabbix Agent 2" SERVER=PROXY.internal.cloudapp.net SERVERACTIVE=PROXY HOSTMETADATA=Windows Include="C:\Program Files\Zabbix Agent 2\preconfig_zabbix_agent2.conf" ENABLEPATH=1 /qn

      In the included conf file I added HostnameItem=system.hostname[fqdn] and HostInterfaceItem=system.hostname[fqdn]

      This works like a charm. Autoregistration is blazingly fast.
      Kudos to the zabbix dev team. This is a lifesaver feature.

      Comment

      • cyber
        Senior Member
        Zabbix Certified SpecialistZabbix Certified Professional
        • Dec 2006
        • 4806

        #4
        I still claim that "system.hostname[fqdn]" does not work...

        zabbix_agentd -t system.hostname[fqdn]
        system.hostname[fqdn] [m|ZBX_NOTSUPPORTED] [Invalid first parameter.]
        zabbix_agent2 -t system.hostname[fqdn]
        system.hostname[fqdn] [m|ZBX_NOTSUPPORTED] [Invalid first parameter.]

        Comment

        • M D
          Junior Member
          • Feb 2025
          • 7

          #5
          cyber
          here is the documentation for system.hostname[fqdn] ->https://www.zabbix.com/documentation...name-parameter

          Comment

          Working...