zabbix-cli
zabbix-cli copied to clipboard
show_problems
Hi, It'll be unbelievable to add the command "show_problems" to export in CSV the list of problems of a period :)
Thanks a lot! Cheerz :P
Hello
What about using 'show_alarms'. e.g. This example gives you all alarms with the word 'disk' and the last event unacknowledged.
[rafael@host ~]$ zabbix-cli -o csv -C "show_alarms *disk* '' * true"
TriggerID,Host,Description,Severity,Last change,Age
"947927","example1.uio.no","* The disk / has used more than 95% of total diskspace (Free: 4.87 %)","AVERAGE","2017-12-14 15:56:40","0:15:06.723073"
"582400","example2.uio.no","* The disk / has used more than 95% of total diskspace (Free: 4.91 %)","AVERAGE","2017-12-14 13:48:53","2:22:53.723874"
"970749","example3.uio.no","* The disk C: has less than 5% (2.07 GB) free space","AVERAGE","2017-12-14 10:34:32","5:37:14.724031"
You can used multiple filters but not timestamps filters. More information: https://github.com/usit-gd/zabbix-cli/blob/master/docs/manual.rst#show-alarms
Hi, Thanks for you reply. The show_alarm, show only alarms in progress, not the solved. I want to export all problems (in progress and solved), for hostgroups on a selected period to generate KPI. I find in the API, the event.get who permit to get the eventids and the clock. And if there is an r_eventids, i redo the request with this r_eventids to have the clock of the end of the problem. But i need to script in python, and i'm not a specialist :)