Zabbix Template for Asus WRT Merlin Routers

Zabbix Template for Asus WRT Merlin Routers Хостинг

Purpose of the article

Another article on the use of a modern universal monitoring system. I’ll tell you how to set up time monitoring on servers using zabbix and warn if discrepancies are too large. In my opinion, a useful metric, which for some reason is not in the basic checks.

In the latest versions of Zabbix Server, the functionality described in the article is present in standard templates for operating systems. It makes no sense to configure time monitoring manually.


The task of monitoring the time on the server at first glance seems trivial, but it is not so simple. I took on this task several times and never completed it. Now I don’t remember all the details, because I decided to share the final version, which has been functioning for me for some time. The main problem there is that the time from the agent is taken at one moment, and the time of the Zabbix server is taken at another moment. And when they are compared, there can be a large discrepancy precisely because the time was taken for comparison at different moments, and not because the time actually diverges.

The time comparison is between the time of the zabbix server and the local time on the server where the agent is installed using the built-in fuzzytime function. I decided for myself that it is enough for me to check the time once a minute. If the discrepancy is more than 60 seconds in the last three checks, then the trigger fires.

Theoretically, you can attach an action to this trigger, which will execute something on the server. For example, running the ntpdate utility to synchronize the time. But I did not set it up, since I always have the ntpd or chrony service running on all servers. So if the time is not up to date, then you need to go to the server and check what is happening with the time synchronization service.

Читайте также:  Vpn между двумя Mikrotik и Создание отказоустойчивого туннеля IPSec VPN между Mikrotik RouterOS и Kerio Control

Let’s start setting up.

If you don’t have your own monitoring server yet, then I recommend materials on this topic. For those who prefer CentOS system:

Same on Debian 10 if you prefer:

If you want to monitor your Asus SOHO router using a Zabbix agent, this template offers some useful monitoring items, triggers, graphs and more.



This template was tested only with Asus RT-AC86U / RT-AC87U / RT-AX86U router running an Asus Merlin firmware.
It should work with other Asus routers as well.
Feedbacks are welcome.

Wrong time alert trigger

Here is an example of the alert trigger itself.

Zabbix Template for Asus WRT Merlin Routers

If the last 3 checks were in error, then their sum will be equal to 0. After that, a notification will be sent. As soon as the time is synchronized, the trigger will immediately return to its normal state.

Here is the finished template with element and trigger zabbix_time.xml. The checks work on both linux and windows servers. The template was downloaded from the server version 4.0.

It is important to ensure that the monitoring server itself always has the correct time, otherwise there will be no point in monitoring. The comparison is specifically with the time on the zabbix server. You need to remember this and follow it.

Checking work

To check the operation of time monitoring, it is enough to set the time on some server with a lag or advance of more than 60 seconds. After that wait 3 failed checks.

Zabbix Template for Asus WRT Merlin Routers

After that, the trigger will work.

Zabbix Template for Asus WRT Merlin Routers

As you can see from the graph, 3 wrong values ​​came at 14:40, at which point the trigger went off. At 14:47, the check returned the value 1 and the trigger went into the state. At this time, I first stopped ntpd, then set the wrong time with the command:

# date +%T -s «14:35:13»

With this, I created a one and a half minute delay. I waited a few minutes, then started the ntpd service back and waited for it to synchronize.

Time monitoring item

In the final version, I propose the following item for monitoring the local time on the server.

Zabbix Template for Asus WRT Merlin Routers

This is a calculated item. Formula:

In this case, the fuzzytime function compares the time on the zabbix server with the local time of the monitored server. If the difference is greater than 60 seconds, the function will return 0, if less, then 1.

Читайте также:  Регистрация домена SU, купить доменное имя в зоне SU, продление и цены

With the help of a calculated element, a specific check result for the current moment of time immediately goes to the database, which is then easy to use in a trigger. No need to do any calculations and comparisons in it. I just take the last 3 checks and if they all return 0, then the trigger will fire.

Instead of a calculated element, it would be possible to make a regular element with the system.localtime key, and then use the fuzzytime function already in the trigger. But there can be a large error if the update interval is large (several minutes), and the difference being checked is small (tens of seconds). I did not like how it worked, so I changed it to a calculated value right in the item.

System Time Is Out Of Sync Flapping Zabbix

Aug 2, 2021 From reading through the forums it appears Zabbix had the ability to check and correct time issues prior to v4.0. If Zabix would at least inform me that system time is out of sync then that would help. For ICMP monitored items and ZBX monitored items at least.

Time sync check — ZABBIX Forums

Clock out of sync? 2007-11-13 05:40 PM Today I noticed something wierd with the clock that’s being displayed in the screen section when you enable it. At this moment I have zabbix installed on my workstation as a test setup and I was pretty surprised to see the local clock 2-3 seconds ahead of the server clock. (both the same system)

HELP!!! How to resolve zabbix triggers didn’t work of system. localtime?

May 27, 2013 By Alexei Vladishev May 27, 2013 Zabbix trigger expressions provide an incredibly flexible way of defining problem conditions. If you can express your problem using plain English or any other human language, there is a great chance it could be represented using triggers.

[ZBX-22473] Typo for the ‘Time out of sync trigger’ — ZABBIX SUPPORT

0. 1 System time is out of sync flapping 21-12-2020, 1207 In OS Linux monitoring, there is a trigger which checks the remote system time. Time zone for PHP is not set (configuration parameter «date. dancing baby video. saiki kx reader platonic deities associated with purple; ios 15 activation lock bypass reddit ravaged crown read online

System time out of sync zabbix

Jan 06, 2021 #1 System time is out of sync flapping 12-21-2020, 12:07 PM In OS Linux monitoring, there is a trigger which checks the remote system time. Cacti EZ: System time / clock is running out of sync in virtual machine.

Читайте также:  Корпорация ZTE

System time out of sync zabbix — pnjbdx. talkwireless. info

The problem is NOT the difference being 30 seconds or 60 seconds or how much the time difference is between a host and zabbix server. The problem is when the difference is close to the limit set, the trigger starts flapping and sends many warnings unnecessarily. This can be avoided using hysteresis.

[ZBX-18794] System time is out of sync flapping — Zabbix

Dec 21, 2020 Details Type: Problem report Status: Closed Priority: Trivial Resolution: Won’t fix Affects Version/s: 5.0.6 Fix Version/s: None Component/s: Templates (T) Labels: linux , macro, ntp template, Description Steps to reproduce: Setup a machine with ~60s time difference with Zabbix server. Use Zabbix Linux template which checks system time difference

Fix flapping of «System time is out of sync» trigger — Zabbix

Answer Time discrepancy issues that result in the «Server’s time may be out of sync» error message are most commonly resolved by SSHing into the server hosting your Duo-protected application or service and using Network Time Protocol ( NTP) to set the correct time. Here are some OS-specific instructions for configuring NTP: Windows Fedora Ubuntu

System time is out of sync — ZABBIX Forums

This server time check works fine and there are almost no false positives. If you need more stringent check intervals, then there can be difficulties. For example, if you need to divide the time and warn when the difference becomes 5 seconds. If you do as shown by me, it will not work reliably.

I don’t know exactly what it is connected with. Perhaps network delays, or in the work of calculated values. Here you need to carefully look at the implementation of fuzzytime. I didn’t need it. If someone solved a similar problem, please share in the comments how you did it.

Read my other articles on monitoring with zabbix.

If you have a desire to learn how to administer Linux-based systems, but you have never worked with them and are not familiar with them, then I recommend starting with the Linux for Beginners online course at OTUS. Course for beginners, for those who are not familiar with Linux. The price for the course is minimal (symbolic). Course and price information.

Did the article help? Subscribe to the author’s telegram channel

Announcements of all articles, plus a lot of other useful and interesting information that does not make it to the site.

Оцените статью