Ad Widget

Collapse

blacklist hostname to autoregistration

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • solution
    Senior Member
    • Jun 2020
    • 269

    #1

    blacklist hostname to autoregistration

    Is there any way to deny autoregistration for specific hostnames?
    Example: if hostname contains "desktop" deny registration.
    for zabbix server 4.4 or 5
  • ingus.vilnis
    Senior Member
    Zabbix Certified Trainer
    Zabbix Certified SpecialistZabbix Certified Professional
    • Mar 2014
    • 908

    #2
    In Action conditions add "Host name does not contain desktop". Make sure you use AND in the Type of calculation or write a custom expression to match whatever you have there already AND "Host name does not contain desktop".

    Comment

    • solution
      Senior Member
      • Jun 2020
      • 269

      #3
      I created the rule in action -> autoregistration
      but hosts are still registered.
      Click image for larger version

Name:	regra1hosts.PNG
Views:	459
Size:	23.7 KB
ID:	404340

      Click image for larger version

Name:	regra2hosts.PNG
Views:	469
Size:	28.5 KB
ID:	404336
      is the Rule incorrect?
      I want to accept self-registration except hosts that match the rule.
      Attached Files

      Comment

      • ingus.vilnis
        Senior Member
        Zabbix Certified Trainer
        Zabbix Certified SpecialistZabbix Certified Professional
        • Mar 2014
        • 908

        #4
        One condition "Host name does not Contain Evolu" should be enough for your case.
        Condition is not a regular expression as you have specified B, C and D.

        Comment

        • solution
          Senior Member
          • Jun 2020
          • 269

          #5
          Thank you.
          When you add other conditions, they are ignored.
          Click image for larger version

Name:	Capturar.PNG
Views:	503
Size:	30.0 KB
ID:	404405

          Click image for larger version

Name:	Capturar1.PNG
Views:	427
Size:	18.7 KB
ID:	404407
          BUG?
          I tested with "and" and "OR"

          **Zabbix Server 5.0.1
          Attached Files

          Comment

          • solution
            Senior Member
            • Jun 2020
            • 269

            #6
            does anyone else have any tips for this problem?
            autoregistration -> action
            1 condition: ok
            2 or more conditions: all are ignored

            As we have hosts that we do not have access to and will no longer monitor, I would like to keep the self-registration on zabbix but ignoring these hosts

            Comment

            • gert.derouck
              Member
              • Jan 2020
              • 69

              #7
              Hi, this is working for me on 4.2...
              Please post a screenshot of the edit page of the action.

              Regards
              Gert

              Comment

              • solution
                Senior Member
                • Jun 2020
                • 269

                #8
                The rules are as follows:
                Click image for larger version

Name:	rules1action.PNG
Views:	451
Size:	20.7 KB
ID:	404758

                I would like to ignore the hosts self-registration that contains the words from the list above.
                But when I activate the rule, everyone is registered including those I want to ignore.

                Details:
                ** 1 Rule with more than one word
                1) Type of calculation:
                AND, OR, AND / OR
                Status: register all, ignore list

                ** 1 separate rule for each word
                Status: register all, ignore list

                ** 1 single rule with only one word:
                Status: ignore OK / Rule applied

                Comment

                • gert.derouck
                  Member
                  • Jan 2020
                  • 69

                  #9
                  With this rule any machine will autoregister...
                  -> Should be "A and B and C and D"
                  Then it will register machines that contain "microca" and do not contain any other of the listed strings.

                  Comment

                  • solution
                    Senior Member
                    • Jun 2020
                    • 269

                    #10
                    the logic is not:
                    if hostname "does not contain" evolu OR band OR micro: register host ?
                    only works when you have only 1 rule with 1 condition

                    Comment

                    • gert.derouck
                      Member
                      • Jan 2020
                      • 69

                      #11
                      Please try with and and and...

                      hostname does not contain FAILLA AND hostname does not contain Evolu AND hostname does not contain BANDERA

                      This will skip all machines that match either of the strings...

                      Comment

                      • solution
                        Senior Member
                        • Jun 2020
                        • 269

                        #12
                        It's like I mentioned before, with AND or OR, the rule is not applied
                        print action:
                        Click image for larger version

Name:	rule3AND.PNG
Views:	458
Size:	18.0 KB
ID:	404765


                        print list discovery:
                        Click image for larger version

Name:	rules3ANDhosts.PNG
Views:	405
Size:	38.8 KB
ID:	404766


                        Status: rule ignored


                        Comment

                        • gert.derouck
                          Member
                          • Jan 2020
                          • 69

                          #13
                          Maybe a stupid question, but did you remove these hosts first?

                          Can you also post a screenshot of the details of eg Evolucao - EVO02? What is the hostname of that machine?

                          Comment

                          • solution
                            Senior Member
                            • Jun 2020
                            • 269

                            #14
                            Yes, I deleted and updated the page and checked the log.
                            And then I activated the rule.

                            print detail host:
                            Click image for larger version

Name:	rule3hostnameevo02.PNG
Views:	442
Size:	36.5 KB
ID:	404773
                            Attached Files

                            Comment

                            • solution
                              Senior Member
                              • Jun 2020
                              • 269

                              #15
                              Thank you for your help.
                              The problem was just doing the following:
                              1) Port 10051 closed on the Firewall (to block agents)
                              2) Template Unlink and Clear on Hosts
                              3) Exclude Hosts
                              4) Recreated the conditions in Autoregistration -> Actions
                              5) Reboot Server
                              6) After Reboot Discovery Hosts Check (No new host)
                              7) Zabbix Queue check (no hosts excluded)
                              8) Open port 10051 on the Firewall.

                              Status:
                              Hosts that contain one of the terms defined in "conditions": Are ignored
                              Other Hosts: Are registered

                              Action --> Conditions Final:
                              Click image for larger version

Name:	conditions-finals.PNG
Views:	468
Size:	25.2 KB
ID:	404841

                              Thanks a lot for the help.

                              Comment

                              Working...