Zabbix: How do I configure a Trigger which will check if a specific value has been changed in the last 10 minutes?
Your question is not 100% clear, so I've covered both possibilities:
If you want to check whether data is not arriving from the Zabbix agent, use the nodata
function.
Returns:
1 - if no data received during period of time in seconds. The period should not be less than 30 seconds.
0 - otherwise
For example, a trigger which will fire if no data was received for 10 minutes:
{mysql.query.nodata(600)}=1
If you want to check whether the value has not changed, use delta
.
Returns the difference between the maximum and minimum values in a period ('max()' minus 'min()'). The period is set in seconds or as a number of collected values (preceded by a # hash mark) in the first parameter.
For example, a trigger which will fire if the value has not changed for 10 minutes:
{mysql.query.delta(600)}=0
Finally, you probably want to rename your item. mysql.query
is very generic, and is already used by common MySQL templates. Something like aggregator.highest_click_id
might be more appropriate.
Related videos on Youtube
![Itai Ganot](https://i.stack.imgur.com/ICkw8.jpg?s=256&g=1)
Itai Ganot
Architect and Lecturer in the field of DevOps Engineering. LinkedIn: https://www.linkedin.com/in/itaiganot Personal Website: http://geek-kb.com
Updated on September 18, 2022Comments
-
Itai Ganot almost 2 years
I've been given the task to monitor a specific value in some MySQL server database, I need to raise a notification if the value has not been changed in the last 10 minutes.
I've added to the
UserParameter_mysql.conf
the following line:UserParameter=mysql.query, echo "select id from resolved_clicks order by id desc limit 1" | mysql -N -u zabbix -pPASSWORD aggregator
And when running a check from the Zabbix server, it returns the value correctly:
[root@zabbix ~]# zabbix_get -s IP -k mysql.query 7957178672 [root@zabbix ~]#
The next step was to create an Item which I've already done so and now I'm trying to configure the Trigger. The trigger should arise a notification if the value has not been updated in the last 10 minutes. How can I configure the trigger to reflect this condition? Thanks!
Edit #1: Here's the Latest data from the trigger I've just created:
My questions are:
1. What's the meaning of change? 2. How can I know from looking on the Change row how many seconds have passed since the last 2 checks? 3. How can I test that the trigger is operating successfully without having to reproduce the problem?
-
Itai Ganot almost 10 yearsWhat's the use of "=0"?
-
Michael Hampton almost 10 yearsThose really are separate questions, and adding them in here is just going to be confusing.