-
Type:
Documentation task
-
Resolution: Commercial support required
-
Priority:
Trivial
-
None
-
Affects Version/s: None
-
Component/s: None
-
None
-
Environment:Ubuntu 18 MySQL 5.7
I want to monitor MySQL query from Zabbix.
This is one of the alarms that we have that checks for the number of missed chats in the last 30 minutes:
`host='db2.telepass.cc' RESULT=$(mysql -h$host --user=$user --password=$password --database=asterisk -s --execute="SELECT count(*) FROM cfg_xmpp_sessions WHERE response_time = 3600 AND create_datetime > DATE_SUB(NOW(),INTERVAL 30 MINUTE) and cust2char > 0 ") if [ $RESULT -gt 3 ] then echo "Warning: TP0008 - $RESULT Missed chats in 30 minutes."; exit 1 fi if [ $RESULT -gt 7 ] then echo "Critical: TP0008 - $RESLULT Missed chats in 30 minutes."; exit 2 else echo "TP0008 - CLEAR"; exit 0 fi `
Can we do this ?