Icecast Streaming Media Server Forum Index Icecast Streaming Media Server
Icecast is a Xiph Foundation Project
 
 FAQFAQ   SearchSearch   MemberlistMemberlist   UsergroupsUsergroups   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

icecast and mrtg

 
Post new topic   Reply to topic    Icecast Streaming Media Server Forum Index -> Icecast Server
View previous topic :: View next topic  
Author Message
Lewis



Joined: 12 Jan 2010
Posts: 17
Location: Thessaloniki, Greece

PostPosted: Thu Feb 04, 2010 3:22 am    Post subject: icecast and mrtg Reply with quote

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
View user's profile Send private message
Lewis



Joined: 12 Jan 2010
Posts: 17
Location: Thessaloniki, Greece

PostPosted: Fri Feb 05, 2010 7:11 pm    Post subject: Reply with quote

none can help ?
Sad Sad
Back to top
View user's profile Send private message
karlH
Code Warrior
Code Warrior


Joined: 13 Jun 2005
Posts: 5476
Location: UK

PostPosted: Fri Feb 05, 2010 8:19 pm    Post subject: Reply with quote

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
View user's profile Send private message Send e-mail Visit poster's website
jcr
Modérateur français
Modérateur français


Joined: 14 Apr 2006
Posts: 544
Location: France, Auvergne

PostPosted: Fri Feb 05, 2010 10:19 pm    Post subject: Reply with quote

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
View user's profile Send private message Visit poster's website MSN Messenger
Lewis



Joined: 12 Jan 2010
Posts: 17
Location: Thessaloniki, Greece

PostPosted: Wed Feb 10, 2010 1:10 pm    Post subject: Reply with quote

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
View user's profile Send private message
Display posts from previous:   
Post new topic   Reply to topic    Icecast Streaming Media Server Forum Index -> Icecast Server All times are GMT
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum


Powered by phpBB © 2001, 2002 phpBB Group
subRebel style by ktauber