PDA

View Full Version : Trigger News Ticker


navtek007
21-04-2006, 08:39
Hi All,

I have just created a rss feed from zabbix. See below for the steps

1. save the attached rss.php on your zabbix server.. (thanks to http://www.cadenhead.org/workbench/stories/2004/05/22/publish-mysql-data-in-rss.html)

2. save the attached db_connect.php anywhere that is accessible from your rss.php file (once again thanks to http://www.cadenhead.org/workbench/stories/2004/05/22/publish-mysql-data-in-rss.html)

have a bit of a look and if you want modify the $query1 to select what ever information you want to show out of Zabbix on the ticker.

3. edit the contents of the db_connect.php to access your mysql server

4. now download the news ticker from http://www.rssnewsticker.com and install on your pc. There are plenty out there.

5. add a feed that points to your php file on the zabbix server eg: http://monitor.domain.com/rss.php

That should be about it you should then start to see zabbix data scrolling accross the screen.

I hope this is useful to some people.

elkor
21-04-2006, 15:34
Neat

thanks!

crs9
22-04-2006, 00:32
This looks super simple , so I dont know what I'm doing wrong. It's not giving me any info for my news feed. I even have the db_connect in the same directory as the rss.php for testing. I have put the correct info in the db_connect, changed owner and permission to it. I have even restart httpd. Any ideas what I'm missing?

Thanks

navtek007
22-04-2006, 07:39
A simple test is to point your web browser to your rss.php file and make sure that your data is visible. It should look like a xml file with a whole bunch of items (zabbix data) listed..

If you see no items then there must be something wrong with the sql. Maybe test the sql from mysql command line first

If you dont see any xml output then try adding the following line to your httpd.conf

AddType application/x-httpd-php .xml

cybaspace
02-05-2006, 17:27
I only get the first trigger displayed, but there should be more active.

I have tested the query and that went okay.

The first time I revceived a parse error in line 19 of rss.php. the '}' was wrong, I believe it should be '{'

Please help! this would be a verry nice feature ;)

Cheers!
Rob

navtek007
03-05-2006, 06:31
what do you get when you place the rss.php file in your browser? Do you get a list of items?

cybaspace
03-05-2006, 11:01
I found the solution.

Bits of the code was appended to a comment.

After that it displayed all active triggers, but also the active triggers of 'not monitored' hosts. I changed the $query1 to:

select triggers.description description, items.lastvalue lastvalue, hosts.host host from triggers, functions, items, hosts where triggers.triggerid = functions.triggerid and items.itemid = functions.itemid and hosts.hostid = items.hostid and hosts.host like '%' and hosts.status=0 and triggers.value = 1 and triggers.status = 0;

and that fixed it.

Thanks!

ruckus37
28-11-2006, 15:27
Anyone got a clean copy of this code, the comments are all mixed with the code..

crayons
04-12-2006, 21:19
cybaspace perhaps you could attach the code that works for you. I have been unable to get mine to work as well. I tested the query and it works. I just get a blank screen when I goto the rss.php screen.

triplem
09-12-2006, 00:27
cybaspace perhaps you could attach the code that works for you. I have been unable to get mine to work as well. I tested the query and it works. I just get a blank screen when I goto the rss.php screen.

Same result here. This result is after I cleaned up the code ans tested the query as well.

AlexeyHTK
26-03-2007, 05:01
I think that this feature must included in next version of zabbix-frontend.