Hey Guys, Kind New to this, but it would be kewl if zabbix had RSS feeds for events.
Ad Widget
Collapse
Zabbix RSS feeds
Collapse
X
-
Added to wish list for 1.6.Comment
-
Sorry to bring this zombie thread up from the long dead....
Did you guys ever add this feature?
I need events available via RSS so I can post them in our forum automatically.Comment
-
you could try using external script as an action target (already suggested here)Comment
-
made a quick hack to display all active triggers in rss format. definitely not perfect but may serve as a pointer to get started...
Code:<?php header('Content-type: ' . 'text/xml'); echo "<?xml version='1.0' encoding='ISO-8859-1' ?>"; ?> <rss version='2.0'> <channel> <title>your title</title> <link>http://www.zabbix.com</link> <description>Zabbix Triggers</description> <?php function rssitem($title,$link,$description){ echo "<item>\n"; echo " <title>$title</title>\n"; echo " <link>$link</link>\n"; echo " <description>$description</description>\n"; echo "</item>\n"; } $conn=mysql_connect('localhost','root',''); $sel=mysql_select_db('zabbix'); $query="select host,triggers.description from triggers inner join functions on (functions.triggerid=triggers.triggerid) inner join items on(items.itemid=functions.itemid) inner join hosts on (items.hostid=hosts.hostid) where (triggers.value=1 or (triggers.value=0 and unix_timestamp(now()) -triggers.lastchange < 1800)) and hosts.status=0 and items.status=0"; $result=mysql_query($query); $counter=0; $total=mysql_affected_rows(); while($row=mysql_fetch_array($result)){ $counter++; $title="Trigger $counter of $total"; $description=str_replace('{HOSTNAME}',$row[0],$row[1]); $link='http://www.yourzabbixhost.com'; #maybe add direct links to trigger here rssitem($title,$link,$description); } if($counter==0){ rssitem('All good','http://www.yourzabbixhost.com/','No Triggers are active'); } ?> </channel> </rss>Comment
-
Though the official way how to fetch data from Zabbix is to use API, the script above is very good and it works just well. It is easy to alter and customize. Great work!
However there is one bug -- if there are two or more triggers per one host, only one trigger is displayed. I need to fix this. Once I will have it ready, I will post a bugfix here.Comment
Comment