Ad Widget

Collapse

Trigger function nodata()

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • Rid
    Junior Member
    • Oct 2019
    • 5

    #1

    Trigger function nodata()

    Hi together,

    a cronjob on a server is running every first day of a month at 06:00 am and sending value to zabbix server. I want to trigger an alert if I don't receive the value at this time or day.
    Currently I am using the nodata() trigger: cronjob.times.processing.nodata(30d)}=1

    It's an item trapper.

    How can I configure the trigger to expect a value at every first day of a month at 06:00 or day? The problem with the trigger above is, that a month can have 28 or 31 days.

    Hope someone out there that can help.

    best regards
    Stefano
  • dimir
    Zabbix developer
    • Apr 2011
    • 1080

    #2
    Add dayofmonth function to the trigger and set nodata to 7 hours:
    Code:
    {cronjob.times.processing.nodata(7h)}=1 and {cronjob.times.processing.dayofmonth()}=1
    Last edited by dimir; 02-03-2021, 13:38.

    Comment

    • Rid
      Junior Member
      • Oct 2019
      • 5

      #3
      wow, that was fast. Thank you!

      At the first look it seems great, I will try it.

      Comment

      • dimir
        Zabbix developer
        • Apr 2011
        • 1080

        #4
        Wait, that will go wrong. It will alert at 14:00 even if you receive a value. :-D If you don't care that the alert will fire 7 hours after missing value set it to:
        Code:
        {cronjob.times.processing.dayofmonth()}=1 and {cronjob.times.processing.nodata(13h)}=1

        Comment

        • Rid
          Junior Member
          • Oct 2019
          • 5

          #5
          But wouldn't it hit also twice, when I set it to 13h? Because if Zabbix Server receives the value at 6 am then it except the next value 13h later at that day. So it would fire an alert at 7 pm.

          Comment

          • Semiadmin
            Senior Member
            • Oct 2014
            • 1625

            #6
            {cronjob.times.processing.nodata(18h)}=1 and {cronjob.times.processing.dayofmonth()}=1 and {cronjob.times.processing.time()}>060500

            Comment

            • dimir
              Zabbix developer
              • Apr 2011
              • 1080

              #7
              Haha, sorry, I messed it up. Take the expression of Semiadmin . :-)

              Comment

              Working...