Ad Widget

Collapse

Setting up trigger on "Web"

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • sikander
    Junior Member
    • Feb 2013
    • 12

    #1

    Setting up trigger on "Web"

    Hello.
    We have several web-services that we maintain that is behind a proxy-server. When a service goes down, the proxy redirects all traffic to a static html.

    I have set up web-monitoring on all services, but when a service goes down it never raises any problem because the statuscode for the static site is still 200.

    Is there any smart way to get Zabbix to fire off a trigger when this happens?
    I have tried to set up "Required String", but havent had any luck getting it to raise a trigger properly.

    Any help greatly appreciated!
    Tell me if you need any more info, and i will gladly provide!
  • lukeiam
    Member
    • Sep 2012
    • 38

    #2
    Yes. Your solution is the required string.

    What I have done is I used a unique hidden comment on a page i am monitoring such as Zabbix_Monitoring_SomeName. Then I set up the required string. Some websites will return code not found, but for others, it will still return ok (200) as web server will load default page if the destination one is not found. That all depends on the web server and the set up. Anyway, none of my other sites, default or not, have that SAME unique comment. This was even if I get code 200, it will still look for the string. All the sites I monitor have a different comment.

    Regards,

    Luke

    Comment

    • sikander
      Junior Member
      • Feb 2013
      • 12

      #3
      Okay, I see.

      So how do i set up a trigger to fire off when it doesnt get the right string?

      Comment

      • sikander
        Junior Member
        • Feb 2013
        • 12

        #4
        Never mind. I finally made it work by counting fails with this: .count(180,0,"ne")}>1

        Thanks for your help anyway!

        Comment

        • lukeiam
          Member
          • Sep 2012
          • 38

          #5
          Can you post your whole trigger config?

          Just interested

          Comment

          • sikander
            Junior Member
            • Feb 2013
            • 12

            #6
            Shure. Here it is:
            {<host>:web.test.fail[<scenario>].count(180,0,"ne")}>1

            I will admit that i dont completely understand how it works, but in my tests it works as i want it to so i let it be.
            If you have ideas on improvements, i will gladly test them out.

            Comment

            Working...