| View previous topic :: View next topic |
| Author |
Message |
Lewis
Joined: 12 Jan 2010 Posts: 17 Location: Thessaloniki, Greece
|
Posted: Thu Feb 04, 2010 3:22 am Post subject: icecast and mrtg |
|
|
hello all,
i want a script to count Current Listeners and Peak Listeners for mrtg use..
i suppose this does not need authentication, since these stats are displayed in /status.xml file..
anyone who could help ? |
|
| Back to top |
|
 |
Lewis
Joined: 12 Jan 2010 Posts: 17 Location: Thessaloniki, Greece
|
Posted: Fri Feb 05, 2010 7:11 pm Post subject: |
|
|
none can help ?
 |
|
| Back to top |
|
 |
karlH Code Warrior

Joined: 13 Jun 2005 Posts: 5476 Location: UK
|
Posted: Fri Feb 05, 2010 8:19 pm Post subject: |
|
|
maybe people with mtrg experience haven't read this yet. Obviously a customised xsl in webroot would be fairly simple (eg status2.xsl) to help parse those details.
karl. |
|
| Back to top |
|
 |
jcr Modérateur français

Joined: 14 Apr 2006 Posts: 544 Location: France, Auvergne
|
Posted: Fri Feb 05, 2010 10:19 pm Post subject: |
|
|
Le Wiki 404 has a script for icecast & shoutcast which could give you most of what you need. _________________ Epsilon Friends Radio Icecast Radio on CentovaCast admin panel. Icecast hosting |
|
| Back to top |
|
 |
Lewis
Joined: 12 Jan 2010 Posts: 17 Location: Thessaloniki, Greece
|
Posted: Wed Feb 10, 2010 1:10 pm Post subject: |
|
|
well, i finally managed to create mrtg graphs from the icecast server page..
this is the script:
| Code: |
#!/bin/bash
# Written by Russell Hatch
# ShoutCast stats retriever for MRTG v1.0
# This simple script will connect to the ShoutCast
# server defined by SERVER and output the number of listners
# in the form MRTG accepts. SPATH is basically
# just where this script will be operating from, and
# NAME is the name of your shoutcast server.
# dhatch1 at tampabay.rr.com
SERVER=http://imagine.1stepstream.com:8000/
SPATH=/home/koutsimaria/scripts
NAME=Imagine897
env no_proxy='*' /usr/bin/lynx -dump -connect_timeout=30 $SERVER 1> $SPATH/dumpfile 2> /dev/null
if [ ! `grep -c "Icecast2 Status" $SPATH/dumpfile` -eq 0 ]; then
# 10th arg in awk
CURLISTENERS=`cat $SPATH/dumpfile | grep 'Current Listeners' | awk '{print $3;}'`
MAXLISTENERS=`cat $SPATH/dumpfile | grep 'Peak Listeners:' | awk '{print $3;}'`
UPTIME=`uptime | cut -d ',' -f -2 | cut -d ' ' -f 5-`
echo $CURLISTENERS
echo $MAXLISTENERS
echo $UPTIME
echo $NAME
else
echo 0
echo 0
echo "server down"
echo $NAME
fi
|
and this is the mrtg.conf file..
| Code: |
WorkDir: /home/koutsimaria/public_html/stats
Refresh: 300
Interval: 5
Language: english
Unscaled[_]:
WithPeak[_]: dwmy
Directory[_]: Imagine
XSize[_]: 600
YSize[_]: 200
YTics[_]: 5
Step[_]: 180
Options[_]: nopercent, integer, gauge, growright
YLegend[_]: Listeners
ShortLegend[_]: Listeners
Legend1[_]: Listeners
Legend2[_]: Max. Listeners
Legend3[_]: .
Legend4[_]: .
LegendI[_]: Now:
LegendO[_]: Maximum:
Target[imagine]: `/home/koutsimaria/scripts/imagine.sh`
MaxBytes[imagine]: 10
AbsMax[imagine]: 2000
Title[imagine]: Listeners of Imagine Radio
PageTop[imagine]: <H1>Stats of Imagine Radio</H1>
|
the result is this:
 |
|
| Back to top |
|
 |
|