I have an item which prints the local time of the system and want to design a trigger that works when the local time on the system is < 6AM
This is the item.
zabbix_get -s 192.168.201.101 -k system.localtime[local]
And this is the output
2017-07-25,04:39:14.682,-05:00
I am using Zabbix 3.0.
How do I format this item to show the time like hhmmss (043914). I want to have it in this format so that i can use it in a trigger expression like so -
If localtime > 060000 and <some_other_condition> then raise alert
Currently i see that zabbix raises alerts based on the server time, so i cannot use the inbuilt item.key.time(0) function as the server time is different from the host time.
Unfortunately, that is not possible currently. You can use parameter utc
, but that will return Unix timestamp. Without knowing the timezone, you cannot calculate the local time from that. Advanced value parsing, coming in Zabbix 3.4, might allow to calculate that, but it would still be messy.
It seems like a useful idea - please consider creating a new feature request (make sure to search for already existing requests).