Ad Widget

Collapse

Problem with creating "Control host groups" using Autoregistration actions

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • svc_zbx_6754
    Junior Member
    • Aug 2024
    • 14

    #1

    Problem with creating "Control host groups" using Autoregistration actions

    Hi all, heres my current issue and I thank you in advance for any responses and possible solutions <3.

    I have four types of servers, each with its unique HostMetadata in the config file:
    1. HostMetadata=WindowsServer2016
    2. HostMetadata=WindowsServer2022
    3. HostMetadata=LinuxServerDebian
    4. HostMetadata=LinuxServerUbuntu
    I have several autoregistration actions that check if hostnames and HostMetadatas match, which then perform operations like adding to a certain host group or linking templates.
    Here’s an example:

    Conditions:
    A: Host metadata matches WindowsServer2016
    B: Host name matches Windows2016HostsA\d+$
    C: Host name matches Windows2016HostsB\d+$

    Type of Calculation: A and (B or C)

    Operations:
    • Add to host groups: WindowsServer2016_Matching
    • Link templates: WindowsServer2016Template
    • Enable host
    So far, everything works well.

    I then created four different "control groups" with the following autoregistration action as an example:

    Conditions:
    A: Host metadata matches WindowsServer2016
    B: Host name does not match Windows2016HostsA\d+$
    C: Host name does not match Windows2016HostsB\d+$

    Type of Calculation:
    I’ve tried A and (B or C), which would make sense.
    I’ve also tried A and B and C out of frustration.
    Neither work.

    Operations:
    • Add to host group: WindowsServer2016_NotMatching

    So basically, if a host autoregisters with the matching HostMetadata=WindowsServer2016 but is not one of my specified hostnames, I want the host(s) to be added to the host group WindowsServer2016_NotMatching.

    The problem is that all hosts still get added to the control groups. The HostMetadata part seems to be fine, but the hostnames seem to be "ignored"?
  • svc_zbx_6754
    Junior Member
    • Aug 2024
    • 14

    #2
    Or does anyone have another solution approach that works similarly?

    Comment

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

      #3
      I see what you want to do... I dont see flaws in logic... But I have no ideas also how to improve and no place or time to experiment...
      I have autoreg actions where I have both metadata and hostname used and it works .. (host metada contains XXXXXX and host name does not match YYYYY)
      only difference with yours is contains vs matches in metadata...

      at least you can say, someone reads your post..

      Comment

      Working...