diff options
author | rudson <rudson@370017ae-e619-0410-ac65-c121f96126d4> | 2006-11-15 23:33:50 +0000 |
---|---|---|
committer | rudson <rudson@370017ae-e619-0410-ac65-c121f96126d4> | 2006-11-15 23:33:50 +0000 |
commit | 4c047569a7fb213df74643e7e92d8b82be8f25c8 (patch) | |
tree | 86d2886ceea65b7c5f3740172c9b77e4b4ad9bcf /net/analyzer/munin/plugins/icecast | |
parent | 36dfae9b5a58be5a5ad46c4741c0565eebc352d5 (diff) | |
download | slackbuilds-4c047569a7fb213df74643e7e92d8b82be8f25c8.tar.gz slackbuilds-4c047569a7fb213df74643e7e92d8b82be8f25c8.tar.bz2 |
movendo...
git-svn-id: svn+slack://slack.fluxo.info/var/svn/slackbuilds@684 370017ae-e619-0410-ac65-c121f96126d4
Diffstat (limited to 'net/analyzer/munin/plugins/icecast')
-rw-r--r-- | net/analyzer/munin/plugins/icecast | 59 |
1 files changed, 59 insertions, 0 deletions
diff --git a/net/analyzer/munin/plugins/icecast b/net/analyzer/munin/plugins/icecast new file mode 100644 index 00000000..b5fea517 --- /dev/null +++ b/net/analyzer/munin/plugins/icecast @@ -0,0 +1,59 @@ +#!/bin/bash +# +# icecast munin plugin +# feedback: rhatto at riseup.net | gpl +# +# configuration example: +# +# [icecast] +# env.host localhost +# evn.port 8000 +# env.stats /munin.xsl +# env.lynx /usr/bin/lynx +# +# munin.xsl example: +# +# <xsl:stylesheet xmlns:xsl = "http://www.w3.org/1999/XSL/Transform" version = "1.0" > +# <xsl:output omit-xml-declaration="no" method="xml" doctype-public="-//W3C//DTD XHTML 1.0 Strict//EN" +# doctype-system="http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd" indent="yes" encoding="UTF-8" /> +# <xsl:template match = "/icestats" > +# <xsl:for-each select="source"> +# <xsl:value-of select="@mount" />.value, <xsl:value-of select="listeners" /><br /> +# </xsl:for-each> +# </xsl:template> +# </xsl:stylesheet> +# + +if [ -z "$host" ]; then + host="localhost" +fi + +if [ -z "$port" ]; then + port="8000" +fi + +if [ -z "$stats" ]; then + stats="munin.xsl" +fi + +if [ -z "$lynx" ]; then + lynx="/usr/bin/lynx" +fi + +if [ "$1" == "config" ]; then + cat << EOF +graph_title Icecast usage +graph_vlabel Listeners +graph_category other +EOF + +for mount in `$lynx http://$host:$port/$stats -dump | cut -d , -f 1 | sed -e 's/\///g' -e 's/^ //' -e 's/.value//' -e 's/\./_/g' `; do + echo $mount.label $mount +done + +exit 0 +else + + $lynx http://$host:$port/$stats -dump | sed -e 's/,//g' -e 's/\///g' -e 's/^ //' -e 's/\.ogg/_ogg/' + +fi |