This Icecast2 Monitor checks:
If the Icecast2 Server is pingable
If Icecast's status.xsl file has been downloaded
If the Icecast2 Server has any streams (sources, specifically from Darkice)
If the Icecast2 Server has the proper number of streams running
If the Icecast2 Server has zero listeners on any of those streams
For several other miscellaneous errors
If it finds any problems, the script will play specific wave/mp3 files to provide an audio warning.
It also writes status information to a log file.
icecast2-monitor-0.5.py (18KB)
mp3 audio clips (~232KB)
*****************************
icecast2-monitor.py (Initial release) (16KB)
wave audio clips (~1.9 megs)
***************************************************************************
Reasons:
I wrote this script for several reasons.
First, I needed something to notify me when Icecast 2 isn't streaming audio.
Second, Icecast 2's web-based gui is decent, but it has HORRIBLE logging (access.log and error.log) compared to Icecast 1.
Third, I was bored and wanted to have a bit of fun
***************************************************************************
Changelog:
Jan-1st-2005 -- With the release of version 0.5, icecast2-monitor now comes complete with command-line options.
***************************************************************************
Notes:
This script was written for use with Darkice and Icecast 2.2
It might work with other encoders with a bit of tweaking to the grep lines :).
(if you get others working, feel free to send any changes to me)
It was also written with the assumption that only two listeners
on only two seperate streams would be the norm.
So, if you have a different config, you'll have to do some serious rewriting to make this usable.
Set your mount points suffixes in Darkice to either ".mp3" or ".ogg"
The audio files can be found above.
You can also create your own (they'd probably sound better, anyway and my voice is grating).
Place them in your user's ~/audio_clips/ directory
****************************************************************************
Usage:
Set the ICECAST_SERVER to the icecast server of your choice
(Default: localhost)
and ICECAST_PORT variables to proper port
(Default: 8000)
Set STREAMS to the number of streams you are expecting
(Default: 2)
PINGCOMMAND is for checking access to the Icecast box
default is ("ping " + ICECAST_SERVER +" -W 2 -c 2 | grep -c '2 received'")
PLAYCOMMAND plays wave files
(Default: "play")
Set VERBOSE to 1 to make Icecast2 Monitor print out extra info to the shell
(Default: 1)
Set LOG to 1 to create a log file in ~/.icm/
START_LOG_TERM will run tail on the log file in a terminal
(Default: 1)
the log term command is
(Default: aterm -bg black -fg gray -e tail -f ' + ICECAST_LOG_FILE + ' &')
Set ALL_AUDIO to 1 to play all friendly audio messages (can get annoying :)
(Default: 0)