Ad Widget

Collapse

Query result, date-time, triggers...

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • WernerCD
    Member
    • Apr 2011
    • 37

    #1

    Query result, date-time, triggers...

    I have an Oracle query that I am generating via SQLPlus. It's outputting 2 numbers:
    Count (Integer >= 0)
    Last Processed (DateTime)

    I am tracking how many items are in a queue... and last time an item was processed.

    Since the data fields doesn't include a date-time option... What is the best option to parse and compare the DateTime to "now"? and only do so if Count > 0?

    Also... Assume it could get busy... where count stays over 0, but the Last Processed keeps moving forward.

    So... basically it's
    if Count > 0 then... if DateTime remains the same for 10m or longer... Alert!

    I can format the DateTime via SQL easily to any number of output formats. Count is an integer.
  • richlv
    Senior Member
    Zabbix Certified Trainer
    Zabbix Certified SpecialistZabbix Certified Professional
    • Oct 2005
    • 3112

    #2
    in sort of a "pseudo-trigger expression" :

    count.last>0 & datetime.fuzzytime(10m)=1

    see manual on trigger functions for more information
    Zabbix 3.0 Network Monitoring book

    Comment

    • WernerCD
      Member
      • Apr 2011
      • 37

      #3
      Originally posted by richlv
      in sort of a "pseudo-trigger expression" :

      count.last>0 & datetime.fuzzytime(10m)=1

      see manual on trigger functions for more information
      I figured it would be something easy... but I had been staring at the screen crossed from getting other parts working and it just wasn't working.

      I've actually settled on it being two fields:
      Chart2.Count
      Chart2.Seconds (...since last event)

      Once I get cron working right with my Sender script, I plan on it updating every minute or so.

      I'm assuming (Without it being in front of me) that it'll be
      Chart2.Count>0 & Chart2.Seconds>10*60

      The one thing I'd like to update... is how can I send an Alert after it triggers twice? What I'm afraid is going to happen is:
      Nothing happens for 10+ minutes. (Count 0, Seconds > 10m)
      Something gets added to the count queue. (Count 1, Seconds > 10m.)
      Zabbix_Sender happens while it's actually proccessing. (Trigger fires on update)
      Seconds since last process completed gets updated to 0 (Count 0, Seconds 0).

      I'm actually not worried about last processed anymore since I'm not looking at time of last action, but time SINCE last action. What I'm worried about is the times with Zabbix_Sender happens while proccessing is happening, giving a false "positive".

      Is it possible to alert after 2 (or more) pairs of data that would trigger?

      Hope this is making sense.

      Comment

      • richlv
        Senior Member
        Zabbix Certified Trainer
        Zabbix Certified SpecialistZabbix Certified Professional
        • Oct 2005
        • 3112

        #4
        in this case, the trigger should be updated only when a new value arrives.
        if you want to react only after two problem values, you can do that with other trigger functions (min/max/avg/count instead of last, for example) or by using escalations - depending on the goal.
        Zabbix 3.0 Network Monitoring book

        Comment

        Working...