Ad Widget

Collapse

auto registration using fqdn

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • rebidebi
    Junior Member
    • May 2023
    • 11

    #1

    auto registration using fqdn

    Im trying to auto register servers with the same name using their FQDN... for example i have 3 servers named SRV1 in 3 different domains.
    I want zabbix to register them as SRV1.com, SRV1.local, SRV1.net

    im only able to register the servers name and not the fqdn. using the forums resources yielded no success..

    here is from the conf file:
    Code:
    ### Option: AllowKey
    # Allow execution of item keys matching pattern.
    # Multiple keys matching rules may be defined in combination with DenyKey.
    # Key pattern is wildcard expression, which support "*" character to match any number of any characters in certain position. It might be used in both key name and key arguments.
    # Parameters are processed one by one according their appearance order.
    # If no AllowKey or DenyKey rules defined, all keys are allowed.
    #
    # Mandatory: no
    AllowKey=system.run[*]
    
    
    ### Option: HostnameItem
    # Item used for generating Hostname if it is undefined. Ignored if Hostname is defined.
    # Does not support UserParameters or aliases.
    #
    # Mandatory: no
    # Default:
    HostnameItem=system.run["powershell $env:COMPUTERNAME + '.' + (Get-CimInstance Win32_ComputerSystem).Domain"]
    ​
    using this the service doesnt even comp up

    any suggestions would be amazing.
  • cyber
    Senior Member
    Zabbix Certified SpecialistZabbix Certified Professional
    • Dec 2006
    • 4806

    #2
    Anything in logs? agent own log? eventlog?
    we have "system.run["powershell.exe -NonInteractive "[System.Net.Dns]::GetHostByName($env:computerName).HostName""]" in use... returns the same as yours in PS... Maybe that noninteractive there makes the diff for startup?

    Comment

    • rebidebi
      Junior Member
      • May 2023
      • 11

      #3
      We tried

      Code:
      ### Option: HostnameItem
      #    Item used for generating Hostname if it is undefined. Ignored if Hostname is defined.
      #    Does not support UserParameters or aliases.
      #
      # Mandatory: no
      # Default:
      HostnameItem=system.run["powershell [System.Net.Dns]::GetHostByName($env:computerName).Hostname"]​
      and it works.. (combined with the allowkey ofc) thank you.. !

      Comment

      Working...