Ad Widget

Collapse

How to configure timezone for Zabbix host

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • lulu
    Junior Member
    • Jul 2016
    • 12

    #1

    How to configure timezone for Zabbix host

    Hi,

    I need to configure triggers for business hours of every host. Is there a way to define timezone of the host? Or I need to define macros for "business hours start" and "business hours end"?

    thanks in advance
  • guzzijason
    Senior Member
    • Dec 2015
    • 106

    #2
    You mean, you want triggers to perform actions only during business hours?

    If so, when you configure an Action, one of the Conditions you can set is "Time period". This will cause triggers activated during that time period to perform the specified action.

    The problem I've found with this, however, is that if a trigger is activated in "non business hours", the action will be suppressed as you would expect. However, when you enter into a "business hours" period, this trigger still won't perform the action, because the condition depends on the time that the trigger was activated, not the current time. This was not sufficient for my purposes.

    So, for my use case, in my notification script that I use for triggers, I put the "business hours" logic in that script. This way, the zabbix server always tries to send to the script, but the script decides whether or not to send out the notification based on the time of day. It doesn't matter what time the trigger was activated at.

    __Jason

    Comment

    • lulu
      Junior Member
      • Jul 2016
      • 12

      #3
      Thanks for your answer

      Originally posted by guzzijason
      You mean, you want triggers to perform actions only during business hours?
      I want to perform actions only during business hours of every given host. Lets say I have 5 hosts, every one in a different time zone. The trigger should only fire during the business hours of that host.
      So I cannot do it in action, otherwise I'll need 5 different actions.
      I was going to do it in trigger configuration based on item time and 2 macros:
      Code:
      time > {$start_hour} and time < {$end_hour}
      This means I will need to define start_hour and end_hour for every host. Is there an easier way to do that?

      Comment

      • guzzijason
        Senior Member
        • Dec 2015
        • 106

        #4
        Oh, yes... I see.

        I *think* you might want to use user-defined macros in your template, and then you can override each macro at the host level for the specific locations.



        __Jason

        Comment

        • lulu
          Junior Member
          • Jul 2016
          • 12

          #5
          Right, thank you! That's what I'm going to use.

          Comment

          Working...