Ad Widget

Collapse

Web Scenario Trigger Expression problem between Zabbix 5 and Zabbix 6

Collapse
This topic has been answered.
X
X
 
  • Time
  • Show
Clear All
new posts
  • greavette
    Member
    • Jul 2015
    • 82

    #1

    Web Scenario Trigger Expression problem between Zabbix 5 and Zabbix 6

    Hello Forum,

    I've been using Zabbix 5 LTS and had setup a Web Scenario to monitor our websites. Along with the scenario I had setup triggers for each website and in Zabbix 5 my Trigger Expression was as follows:

    Code:
    {Website Monitoring:web.test.error[Website-Check].strlen()}>0 and {Website Monitoring:web.test.fail[Website-Check].last()}>0

    I've now installed Zabbix 6 on a new Debian server and I'm once again setting up Web Scenario's to monitor our websites. I used the same Trigger expression as above but in Zabbix 6 I receive the following error:

    Invalid parameter "/1/expression": incorrect expression starting from "{Website Monitoring:web.test.error[Website-Check].strlen()}>0 and {Website Monitoring:web.test.fail[Website-Check].last()}>0".

    Secondly, I also noticed that in Zabbix 5 I specified an Application to be used (HTTP or HTTPS) in creating the Web Scenario for each website. In Zabbix 6 I don't see an option to choose an Application. How does Zabbix 6 know to use the HTTP or HTTPS application to check monitoring for our websites?


    Can anyone provide direction or assistance for me on what needs to change in this expression to have it work properly in Zabbix 6?

    Thank you in advance for any advice or direction you can provide me.
  • Answer selected by greavette at 11-08-2022, 19:39.
    greavette
    Member
    • Jul 2015
    • 82

    Hello Cyber and thanks very much for responding to my post!

    Thanks for the link to the new syntax used after 5.4. I've tried your suggestion and found an error whereby strlen is no longer supported. So looking at the documentation strlen is replaced by length. I've modified your suggestion to as follows:

    Code:
    length(/Website Monitoring/web.test.error[Website-Check])>0 and last(/Website Monitoring/web.test.fail[Website-Check])>0
    But that produced an error in how I used the function length. So looking again at this link - https://www.zabbix.com/documentation...nitoring/items I found an example of how to use length. I tried this expression and I'm now allowed to save my trigger:


    Code:
    length(last(/Website Monitoring/web.test.error[Website-Check]))>0 and last(/Website Monitoring/web.test.fail[Website-Check])>0

    I'll do some more testing now and see if this trigger is working properly and post back with my results.

    Thanks!

    Post update:

    I've confirmed that the above expression works for my trigger to determine the status (up or down) of our website. Thanks again for your help!

    Last edited by greavette; 11-08-2022, 19:39.

    Comment

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

      #2
      Starting from 5.4 there is new syntax for triggers... https://www.zabbix.com/documentation...on/whatsnew540
      so instead of "{Website Monitoring:web.test.error[Website-Check].strlen()}>0 and {Website Monitoring:web.test.fail[Website-Check].last()}>0"
      it should be "strlen(/Website Monitoring/web.test.error[Website-Check])>0 and last(/Website Monitoring/web.test.fail[Website-Check])>0" (I think...)

      Comment

      • greavette
        Member
        • Jul 2015
        • 82

        #3
        Hello Cyber and thanks very much for responding to my post!

        Thanks for the link to the new syntax used after 5.4. I've tried your suggestion and found an error whereby strlen is no longer supported. So looking at the documentation strlen is replaced by length. I've modified your suggestion to as follows:

        Code:
        length(/Website Monitoring/web.test.error[Website-Check])>0 and last(/Website Monitoring/web.test.fail[Website-Check])>0
        But that produced an error in how I used the function length. So looking again at this link - https://www.zabbix.com/documentation...nitoring/items I found an example of how to use length. I tried this expression and I'm now allowed to save my trigger:


        Code:
        length(last(/Website Monitoring/web.test.error[Website-Check]))>0 and last(/Website Monitoring/web.test.fail[Website-Check])>0

        I'll do some more testing now and see if this trigger is working properly and post back with my results.

        Thanks!

        Post update:

        I've confirmed that the above expression works for my trigger to determine the status (up or down) of our website. Thanks again for your help!

        Last edited by greavette; 11-08-2022, 19:39.

        Comment

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

          #4
          Ah yea.. did not look that up.. I am not yet on newest versions, so I overlooked the function issues, just translated directly from old to new..

          Comment

          • greavette
            Member
            • Jul 2015
            • 82

            #5
            Thanks Cyber, couldn't have done it without your help! Thanks for the reply and the links to help me find the right syntax. Cheers!

            Comment

            Working...