Ad Widget

Collapse

enable item\trigger only if match specific time

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • ilia
    Member
    • Dec 2018
    • 37

    #1

    enable item\trigger only if match specific time

    hi,
    we are monitoring multiple servers all over the world with latest zabbix (5)

    we want to get notified when there is a server crash with sms only when the server is triggered within configure time ranged ( each server group have different ranged in)
    the sms trigger already working but it works 24/7 and i want to filter out unwanted events.


    example the scenario:
    server group US ( we have 6 servers each should trigger events only between 09:00 to 23:00 local time )
    server group EU1 ( we have 2 servers each should trigger events only between 10:00 to 15:00 local time )
    server group EU2 ( we have 5 servers each should trigger events only between 11:00 to 23:00 local time )

    i already made a custom template with that monitor the specific process, and now i wane to add a valid time filter best on the server group.
    what would be the best approach?
    Last edited by ilia; 18-08-2020, 10:51.
  • ilia
    Member
    • Dec 2018
    • 37

    #2
    does anyone have an idea?

    Comment

    • isaqueprofeta
      Senior Member
      Zabbix Certified SpecialistZabbix Certified Professional
      • Aug 2020
      • 154

      #3
      Lookup for dayofweek, date and time trigger functions in https://www.zabbix.com/documentation...gers/functions

      Just remember that:

      If time-based functions (nodata(), date(), dayofmonth(), dayofweek(), time(), now()) are used in the expression, the trigger is recalculated every 30 seconds by a Zabbix history syncer process. If both time-based and non-time-based functions are used in an expression, it is recalculated when a new value is received and every 30 seconds.
      From: https://www.zabbix.com/documentation...onfig/triggers

      Comment

      • tim.mooney
        Senior Member
        • Dec 2012
        • 1427

        #4
        Hi


        My site wanted to do something very similar to this too. I had previously investigated the "Time period" condition that splitek mentioned. I initially thought I could define a default global user macro for the time period that would default to 7x24. Then, on specific hosts where we didn't want to be paged except during certain hours, I could override the time period macro to be something like 5x8 (using Zabbix's time period syntax).

        However, that didn't work for our needs, because the "time period" referenced in that documentation is actually the "event time", not the current time. So what happens is that if a problem event happens outside of the time period you've defined, you will never be alerted about it. Action conditions don't currently have a "current time" as an available condition, so what we were trying to do wouldn't work.

        We ended up using recurring maintenance windows, but we're not really very happy with that solution, for two reasons:
        1. For us, it causes a proliferation of maintenance windows, because some hosts have different business requirements for when we should be paged, so we can't just make one or two maintenance windows that cover these hosts. You, however, might be able to, with your specific conditions.
        2. the bigger problem for us is that we don't want to be paged (alerted by phone) if there's a problem during non-critical times for a system, but our sysadmin team would still like to receive warning emails for the system. That way, if someone happens to check their email on a weekend and spot an easy problem that's emailing but not paging to our phones, they could address the problem. We know we could reconfigure all our actions and removed the "Problem is not suppressed" condition from the ones that warn us via email, but that's also not what our sysadmins wanted.
        If Zabbix had a "current time" as an operation condition, in addition to "event time", that would perfectly allow us to accomplish these flexible alerting periods. It doesn't currently, though.

        Comment

        • Paradice
          Junior Member
          • Mar 2020
          • 16

          #5
          You can set a extra condition on the action, which sends the sms:

          Click image for larger version

Name:	Screen Shot 2020-08-26 at 14.52.41.png
Views:	4611
Size:	163.1 KB
ID:	407755
          Attached Files

          Comment

          • Rudlafik
            Senior Member
            • Nov 2018
            • 144

            #6
            Isnt work in this case: Condition: send message 1-5, 07:00-18:00 AND alert from server XY. When problem started in 02:00 zabbix nobody notify. OK its correct BUT zabbix nobody notify in 7:00 too! Tested. Notify only when you update or close problem in interval 7-18. In 7:00 Zabbix dont start control condition of alert. Zabbix 6.4.1

            When you add recomended time function to alert(s) its way for solution of your problem. example:
            Code:
            (min(/Server.Name/service.info["MongoDB",state],#3)<>0)and(time()>070000 and time()<180000)
            f time-based functions (nodata(), date(), dayofmonth(), dayofweek(), time(), now()) are used in the expression, the trigger is recalculated every 30 seconds by a Zabbix history syncer process.​
            Last edited by Rudlafik; 20-06-2023, 14:35.

            Comment

            Working...