R
R
Reikoemco2018-12-27 14:25:22
System administration
Reikoemco, 2018-12-27 14:25:22

How to write a script for monitoring time in a domain?

There is such a problem that time synchronization falls off periodically on one of the domain controllers. Is it possible to attach a script to Zabbix that will monitor and notify this case?
I googled about system.localtime.fuzzytime, but I didn’t really understand how to implement it, because I’ve only known Zabbix for a little less than a week. Maybe someone is already using something similar?
I would be grateful for your help and advice!

Answer the question

In order to leave comments, you need to log in

2 answer(s)
D
Dmitry, 2018-12-27
@Reikoemco

With fuzzytyme this is very easy to do.
1. Install the agent on Windows Server.
2. Add an item that will take Host local time , the parameters are
Name: Host local time
Type: Zabbix agent
Key: system.uptime
Type of information: Numeric (unsigned)
Units: unixtime
Update interval: 300s (see here as you need, but too often not worth it)
3. Added item, made sure that the data went.
4. Add a trigger to this server, with the following parameters:
Name: {HOST.NAME}: Time Drift > 30 Sec
Expression: {Your_windows_server:system.localtime.fuzzytime(30)}=0 Configure the alarm
yourself, as usual in Zabbix
Now, if the time between the Windows server and the Zabbix server is more than 30 seconds apart, the trigger will work.
It is important that the servers must have a configured time service, I have both Windows and Zabbix looking at the same network ntp server.

G
Galdar Turin, 2018-12-27
@Galdar

I would do it through JSON:
Zabbix. How to display data from JSON by key?
Well, or would try)

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question