i want to create a shell script to detect the zabbix trigger's status
what is the table should i to detect
or some one can tell me the sql ?
many thanks
what is the table should i to detect
or some one can tell me the sql ?
many thanks
select * from triggers where status=0 and value=1;
select f.triggerid, t.expression, f.functionid, f.lastvalue, f.function, f.parameter, i.key_, h.host
from functions as f
left join items as i on f.itemid=i.itemid
left join hosts as h on i.hostid = h.hostid
left join triggers as t on f.triggerid = t.triggerid
where f.triggerid in
(select triggerid from triggers where value=1 and status=0)
order by f.triggerid;
+-----------+-------------------------+------------+--------------+----------+-----------+------------------------------+----------------+
| triggerid | expression | functionid | lastvalue | function | parameter | key_ | host |
+-----------+-------------------------+------------+--------------+----------+-----------+------------------------------+----------------+
| 22016 | ({28682})<({28683}*0.1) | 28682 | 22122552000 | last | 0 | vfs.fs.size[/space,free] | dabus.prod |
| 22016 | ({28682})<({28683}*0.1) | 28683 | 245089772000 | last | 0 | vfs.fs.size[/space,total] | dabus.prod |
| 21516 | {30984}=1 | 30984 | 1 | nodata | 300 | agent.ping | runka.prod |
| 21288 | {34207}>2500 | 34207 | 3956 | min | 1800 | diskq.counter[block,dbqueue] | response2.prod |
| 21289 | {34208}>2500 | 34208 | 17487 | min | 1800 | diskq.counter[block,dbqueue] | response3.prod |
| 21290 | {34209}>2500 | 34209 | 9358 | min | 1800 | diskq.counter[block,dbqueue] | response4.prod |
+-----------+-------------------------+------------+--------------+----------+-----------+------------------------------+----------------+
6 rows in set (0.13 sec)
Comment