[icecast] parsing icecast 1 and icecast2 logs in GUI web format

Thomas B. Ruecker, DM8TBR dm8tbr at afthd.tu-darmstadt.de
Wed Nov 12 18:38:44 UTC 2003

Hi Kerry,

Some time ago I had to setup mrtg graphing too.
I'll try to give a short outline of what I did:

1. how do I get listener numbers into MRTG?
2. how to interface XSLT with MRTG?
3. how to set up MRTG?

1. I chose to use the xslt-features provided by Icecast and placed files called lstn-*.xsl for every mountpoint in the icecast web-root. The sole purpose of this xslt-sheet is returning the current number of listeners for a mountpoint as a plain-text string.

2. mrtg was written for SNMP but accepts also data from other sources if they follow certain conventions (refer to the comments in the perl-script or one of the available howtos for details). So I hacked up a short perl-script that gets the current number of listeners by http and feeds it into mrtg along with some additional data (like description etc.). You can find an example perl-script attached to this mail. It was hacked up in only a few minutes and because it was running ok I never touched it again, although some features (e.g. uptime) are not used. ;)
Note: the script requires some perl-libraries to run.

3. MRTG calls the Script created in 2. (see mrtg.cfg) Everything else happens automagically. ;)

A result can be seen here: http://dk0td.afthd.tu-darmstadt.de/mrtg/icecast/radio.ogg_and_radio+.ogg.html

Probably there is an easier way to accomplish this, but it works fine for me. Of course the Perl part could have been done in php or $YOUR_FAVOURITE_SCRIPTING_LANGUAGE...

One thing I noticed during organizing the relay for http://www.subether.de/ was: the stats seem to get off pretty much. This may have been caused by an unstable connection to the source server, but it shouldn't have happened anyway. This issue was addressed in an email to the list some time ago, but no one answered to it IIRC. Is this still happening?


-------------- next part --------------
A non-text attachment was scrubbed...
Name: lstn-radio.xsl
Type: text/xml
Size: 327 bytes
Desc: lstn-radio.xsl
URL: <http://lists.xiph.org/pipermail/icecast/attachments/20031112/e45d2f82/attachment.xml>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: icemon-radio
Type: application/octet-stream
Size: 673 bytes
Desc: icemon-radio
URL: <http://lists.xiph.org/pipermail/icecast/attachments/20031112/e45d2f82/attachment.obj>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: mrtg.cfg
Type: application/octet-stream
Size: 1222 bytes
Desc: mrtg.cfg
URL: <http://lists.xiph.org/pipermail/icecast/attachments/20031112/e45d2f82/attachment-0001.obj>

More information about the Icecast mailing list