Ad Widget

Collapse

Checking all data in the time period

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • Danio9004
    Junior Member
    • Sep 2023
    • 13

    #1

    Checking all data in the time period

    Hi, I'm new so please be understanding.
    I have created an item that runs from 06:30 - 09:30 every 30 minutes and a trigger that checks whether the value "None" exists using the last() function. The values returned by the SQL query are: "exists" or "None". But I have a problem because it doesn't work properly. Namely, at 07:30 the query returns "exist" because that is what the SQL query returned. At 08:00 the query returns "None" because the process has already ended. So at 08:00 I get a message in the dashboard that the process is not running. That's actually true, but not entirely. The process worked, but it is now over. How can I construct a trigger that will check all records from this hourly range and if "exist" occurs at least once, then the message should not appear. Asking for help because I have no idea how to do it.​
  • tim.mooney
    Senior Member
    • Dec 2012
    • 1427

    #2
    You don't say anything about what version of Zabbix you're using, which would have been useful to include. How triggers are written (and what functions are available) has changed over time.

    You probably don't want to use the last() trigger function in this case. There are likely multiple other ways you could accomplish this, likely using find() or count().

    Read through the general trigger documentation and pay attention to the examples: https://www.zabbix.com/documentation...ers/expression

    Then look at the documentation for the individual functions: https://www.zabbix.com/documentation...ndix/functions

    If you follow the documentation for the find() function (in the history function category), you can find an example similar to what you want.

    Code:
    find(/host/key,60m,"like","exists") <> 1​
    This checks the past hour for "exists" and generates a problem event if it does not find it in the last hour.

    Comment

    • Danio9004
      Junior Member
      • Sep 2023
      • 13

      #3
      I'm sorry. I'm using zabbix 6.0

      Comment

      • Baileykemp
        Junior Member
        • Sep 2023
        • 3

        #4
        You can modify your trigger by using the "exists" function instead of the "last" function. By doing so, the trigger will check if the value "exists" occurs at least once within the hourly range. If it does, the message will not appear.

        Comment

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

          #5
          Originally posted by Baileykemp
          You can modify your trigger by using the "exists" function instead of the "last" function. By doing so, the trigger will check if the value "exists" occurs at least once within the hourly range. If it does, the message will not appear.
          "Exists" function? There is "exists_foreach" under aggregate functions, but that is all...

          Comment

          Working...