Ad Widget

Collapse

Alert when string value doesn't change for specific time period

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • ahahum
    Member
    • Jan 2009
    • 79

    #1

    Alert when string value doesn't change for specific time period

    I have a windows box that I'm trying to monitor a directory on to see when the last update to a file in the directory. I have a powershell script running that sends the last updated time of the most recent file to Zabbix using zabbix_sender. This is working fine and I see the values updating as they should.

    I don't know how to trigger on my condition properly. I need to trigger an alert when the value has not changed in x amount of time. I think this is possible, but I'm not too advanced on making triggers like this. Any help would be appreciated.

    Cheers!
  • LenR
    Senior Member
    • Sep 2009
    • 1005

    #2
    If the string value is a "always increasing" date string, then it will never have the same value twice when it does change. In that case, then something like item.last(xm) = item.last() maybe

    Comment

    • Semiadmin
      Senior Member
      • Oct 2014
      • 1625

      #3
      I think in this case would be better convert time to unixtime in PS script and save it as an integer with unixtime as units.

      Comment

      • ahahum
        Member
        • Jan 2009
        • 79

        #4
        Good feedback, thank you both.

        I have the values being entered as unixtime now and that should help achieve what I want

        I tried the one from LenR but it isn't clearing when the value changes. I'm trying out some recovery expressions, but I would've expected it to clear when the latest value does not match that of 2h ago according to my current trigger.

        Comment

        • Markku
          Senior Member
          Zabbix Certified SpecialistZabbix Certified ProfessionalZabbix Certified Expert
          • Sep 2018
          • 1781

          #5
          How about

          item.last() = item.last(,2h) (note the syntax, see https://www.zabbix.com/documentation...s?s%5B%5D=last)

          or

          item.min(2h) = item.max(2h)

          Markku

          Comment

          • ahahum
            Member
            • Jan 2009
            • 79

            #6
            Originally posted by Markku
            How about

            item.last() = item.last(,2h) (note the syntax, see https://www.zabbix.com/documentation...s?s%5B%5D=last)

            or

            item.min(2h) = item.max(2h)

            Markku
            Ah yes, that makes perfect sense and seems to be working. Thanks for your help, everyone!

            Comment

            Working...