Ad Widget

Collapse

Service time and different timezones

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • WanWizard
    Junior Member
    • Apr 2020
    • 2

    #1

    Service time and different timezones

    Something I've been searching for, but I can't find any reference to this.

    All our servers run in UTC, and that includes the Zabbix cluster, the Zabbix frontend, all Zabbix proxies, and our database cluster.
    Some of the metrics are collected by the active Zabbix cluster node itself, some by remote Zabbix proxies (notably web scenario's, to include internet connectivity).

    We do managed hosting for clients in several timezones, with SLA definitions like "office hours", "extended office hours", etc, which are expressed in the clients' local time.

    So for example, we have an application for a German client, which has an SLA for Monday to Friday, 08:00 to 18:00 local German time. In wintertime, CET is the same as UTC+1, in summertime CEST is UTC+2.

    How can I define the uptimes or downtimes for this service so that the SLA is correctly calculated? Zabbix has no clue in which timezone a service operates...
    Last edited by WanWizard; 16-04-2020, 12:16. Reason: rephrased the last sentence
  • Hamardaban
    Senior Member
    Zabbix Certified SpecialistZabbix Certified Professional
    • May 2019
    • 2713

    #2
    With time zones, zabixx works poorly... But there Is a tricky trick: you can use macro at expression with the time function in triggers that count as SLA:
    like host.key.time()>{$WORKBEGIN} and host.key.time()<{$WORKEND}
    Next define macro values {$WORKBEGIN} {$WORKEND} for a specific time zone in a separate template and attach this template to the appropriate network nodes.
    For example: UTC+1 template have {$WORKBEGIN}=80000 {$WORKEND} =180000 , but UTC+3 template have {$WORKBEGIN}=100000 {$WORKEND} =200000
    Note: the function time is calculated based on the zabbix server time.
    When converting the clock to summer or winter time you will have to change the values of the macros in the template
    Last edited by Hamardaban; 16-04-2020, 14:42.

    Comment

    • WanWizard
      Junior Member
      • Apr 2020
      • 2

      #3
      I had thought of that, but not really looking forward to the manual work.

      In the meantime I have noticed that unlike all other timestamps in Zabbix, service times are not converted to UTC, so if I enter "Uptime Monday 09:00 - 18:00" for a Service with a Frontend set to the Australia/Melbourne timezone, and I look at the values from a Frontend set to Europe/London timezone, I still see the same "09:00 - 18:00". If I check the database, these values are stored as numbers (118800 to 151200), which are offsets from Sunday 0:00.

      So I wonder how these times are actually applied when calculating the SLA.

      If they are applied when the SLA report is opened, with the times as reported by the timezone of the Frontend, I can live with that. It only means I have to think of this when I make customer dashboards with Grafana.
      Last edited by WanWizard; 16-04-2020, 15:08. Reason: Added the last line

      Comment

      Working...