Ad Widget

Collapse

Zabbix multiple actions on Discovery Rule

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • Nortole
    Junior Member
    • Sep 2015
    • 6

    #1

    Zabbix multiple actions on Discovery Rule

    Hello,

    our Zabbix Server/Proxy version is 2.4.6.
    I want to use a Discovery Rule for our active public IPs.

    The rules configuration:
    Name: IP Discovery
    Discovery by proxy: true
    Delay(in sec): 3600
    Checks:
    - HTTP / 80
    - HTTPS / 443

    I created 3 Actions:
    1. Add IP
    Conditions (AND):
    - Discovery rule = IP Discovery
    - Discovery status = Up

    Operations:
    - Add host
    - Add to host groups: <groups>
    - Enable host

    2. Add HTTP Checks
    Conditions (AND):
    - Discovery rule = IP Discovery
    - Discovery status = UP
    - Service type <> HTTPS
    - Service type = HTTP

    Operations:
    - Link to template HTTP

    3. Add HTTPS Checks
    Conditions (AND):
    - Discovery rule = IP Discovery
    - Discovery status = UP
    - Service type = HTTPS

    Operations:
    - Link to template HTTPS

    So here is my problem:
    If the discovery detect the HTTP or HTTPS service only, the correct action is implemented ("Add IP" and "Add HTTP(S)" Checks).
    If the discovery detect both HTTP and HTTPS services, only the "Add IP" and "Add HTTP" rule will apply.

    That's very confusing. I thought my second rule (HTTP) only works if HTTP was discovered and not HTTPS.

    I tried several conditions but nothing worked. Maybe I'm doing something wrong.

    Anyone has a similar setup or an idea?

    Thanks for your time and thoughts.

    Regars
  • DmitryL
    Senior Member
    Zabbix Certified SpecialistZabbix Certified Professional
    • May 2016
    • 278

    #2
    Hi Nortelle,

    Lets take a look what happens when both HTTP and HTTPS are detected:
    Code:
    Conditions (AND):
    - Discovery rule = IP Discovery = YES
    - Discovery status = UP = YES
    - Service type <> HTTPS = NO (because there are both HTTP and HTTPS)
    - Service type = HTTP = YES
    because AND conditions, one no is enough to fail.

    3. Add HTTPS Checks
    Code:
    Conditions (AND): 
    - Discovery rule = IP Discovery = YES
    - Discovery status = UP = YES
    - Service type = HTTPS = YES
    Flawless!

    Try adding
    Code:
    Service type <> HTTP to third action
    Then create action Nr. 4 like
    Code:
    Conditions (AND)
    - Discovery rule = IP Discovery
    - Discovery status = UP
    - Service type = HTTPS
    - Service type = HTTP
    Best regards,
    Dmitry

    Comment

    • Nortole
      Junior Member
      • Sep 2015
      • 6

      #3
      Hi Dmitryb,

      thanks for your fast answer.

      I configured the actions as you said. And now the confusing thing I cannot explain...

      My new discovered hosts got the normal HTTP template and not the HTTPS template.
      The discovery rule recognized both, HTTP and HTTPS template.

      Maybe you have another idea?

      Regards

      Nortole

      Comment

      • DmitryL
        Senior Member
        Zabbix Certified SpecialistZabbix Certified Professional
        • May 2016
        • 278

        #4
        So currently you have this 3 actions?

        Code:
        Conditions (AND):
        - Discovery rule = IP Discovery
        - Discovery status = UP
        - Service type <> HTTPS
        - Service type = HTTP
        
        Add HTTP template
        Code:
        Conditions (AND):
        - Discovery rule = IP Discovery
        - Discovery status = UP
        - Service type = HTTPS
        - Service type <> HTTP 
        
        Add HTTPS template
        Code:
        - Discovery rule = IP Discovery
        - Discovery status = UP
        - Service type = HTTPS
        - Service type = HTTP 
        
        Add HTTP & HTTPS template
        Discovery finds hosts with active service-type HTTP / HTTPS and both.
        But only HTTP template is attaching?

        Comment

        • Nortole
          Junior Member
          • Sep 2015
          • 6

          #5
          Yeah. This three actions plus the host adding action for new discovered hosts.

          Here is a screenshot from the actions:


          |Device |HTTP|HTTPS|
          |1.2.3.4 | X | - |
          |2.3.4.5 | - | X |
          |3.4.5.6 | X | X |

          1.2.3.4:
          - Domain HTTP
          2.3.4.5:
          - Domain HTTPS
          3.4.5.6:
          - Domain HTTP

          So this is more than a bit confusing to me.

          Comment

          • DmitryL
            Senior Member
            Zabbix Certified SpecialistZabbix Certified Professional
            • May 2016
            • 278

            #6
            Hello again,

            Find one host, that should have HTTPS. And take a look under Monitoring -> Events (Source: Discovery)

            Are you sure that you have discovered hosts with service type HTTPS?

            Comment

            • Nortole
              Junior Member
              • Sep 2015
              • 6

              #7
              That's a good idea. I haven't looked there yet.

              But unfortunately...

              2016-06-16 08:37:30 1.2.3.4 example.com Host UP
              2016-06-16 08:37:30 1.2.3.4 example.com Service: HTTPS UP
              2016-06-16 08:37:30 1.2.3.4 example.com Service: HTTP UP
              I controlled the host right now and only the HTTP template was added.

              Comment

              • DmitryL
                Senior Member
                Zabbix Certified SpecialistZabbix Certified Professional
                • May 2016
                • 278

                #8
                Double check that Domain - HTTP and Domain - HTTPS templates are not linked to host groups Discovered hosts and Domain hosts

                Comment

                • Nortole
                  Junior Member
                  • Sep 2015
                  • 6

                  #9
                  Oh no. I'm so sorry for this noob like question...

                  I found the failure.
                  The web checks I added with the templates had the same name... So Zabbix can't link both templates. I worked around this for hour.

                  Thank you very very much for your time and help!!!

                  Closed.

                  Comment

                  • DmitryL
                    Senior Member
                    Zabbix Certified SpecialistZabbix Certified Professional
                    • May 2016
                    • 278

                    #10
                    Glad to hear you solved the problem

                    Comment

                    Working...