Take the 2-minute tour ×
Server Fault is a question and answer site for system and network administrators. It's 100% free, no registration required.

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: enter image description here 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?
share|improve this question

1 Answer 1

up vote 2 down vote accepted

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.

share|improve this answer
    
What's the use of "=0"? –  Itai Ganot Jul 20 at 12:20
    
@ItaiGanot delta takes the difference of the maximum and minimum values received during the time period. This can only be 0 when all of the values are the same. –  Michael Hampton Jul 20 at 12:21
    
Please check Edit #1, Thanks. –  Itai Ganot Jul 20 at 12:33
    
Those really are separate questions, and adding them in here is just going to be confusing. –  Michael Hampton Jul 20 at 12:48

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.