Hi,
Here i will post scripts to monitor total and live connections for wowza servers. This will work on Linux(or Unix ?) platforms.
Someone may find this useful.
You will need the JMX command-line interface(you can download it from this forums).
I think this is the JMX command-line tool : http://community.wowza.com/t/-/59
MRTG
Create script /root/scripts/get_wowza_connections.sh
#!/bin/bash
TOTALCONNS=`java -cp /root/scripts JMXCommandLine -jmx service:jmx:rmi://$1:8084/jndi/rmi://$1:8085/jmxrmi -user admin -pass jmxpassword getConnectionCounts`
LIVECONNS=`java -cp /root/scripts JMXCommandLine -jmx service:jmx:rmi://$1:8084/jndi/rmi://$1:8085/jmxrmi -user admin -pass jmxpassword getConnectionCounts _defaultVHost_:liverepeater`
echo "$TOTALCONNS"
echo "$LIVECONNS"
Be sure to replace the values for username and password .
liverepeater is the name of your live app.
Test the script :
/root/scripts/get_wowza_connections.sh 10.0.0.1
It should print two numbers : Total connections and connections to your live application.
Put this snippet in your mrtg.conf
Target[edge1.conns]: `/root/scripts/get_wowza_connections.sh 10.0.0.1`
Directory[edge1.conns]: myhostname
Options[edge1.conns]: nopercent,growright,gauge,noinfo
Title[edge1.conns]: Open Wowza connections -- edge1.btvcluster
PageTop[edge1.conns]: <H1>Open Wowza connections -- edge1.btvcluster</H1>
MaxBytes[edge1.conns]: 10000
YLegend[edge1.conns]: # conns
ShortLegend[edge1.conns]: connections
LegendI[edge1.conns]: Total Connections:
LegendO[edge1.conns]: Live Cons
Legend1[edge1.conns]: Open Wowza connections -- myhostname
Munin:
Create script /root/scripts/get_wowza_connections.sh
#!/bin/bash
TOTALCONNS=`java -cp /root/scripts JMXCommandLine -jmx service:jmx:rmi://$1:8084/jndi/rmi://$1:8085/jmxrmi -user admin -pass jmxpassword getConnectionCounts`
LIVECONNS=`java -cp /root/scripts JMXCommandLine -jmx service:jmx:rmi://$1:8084/jndi/rmi://$1:8085/jmxrmi -user admin -pass jmxpassword getConnectionCounts _defaultVHost_:liverepeater`
echo "$TOTALCONNS $LIVECONNS"
Create munin plugin as follows (usually in /etc/munin/plugins/ ):
#!/bin/sh
case $1 in
config)
cat <<'EOM'
graph_title Wowza connections
graph_scale no
graph_category wowza
graph_vlabel connections
total_connections.label total connections
live_connections.label live connections
total_connections.draw AREA
live_connections.draw LINE1
EOM
exit 0;;
esac
cons=`/root/scripts/get_wowza_connections.sh 10.0.0.1`
tot=`echo $cons | cut -d' ' -f1`
live=`echo $cons | cut -d' ' -f2`
echo -n "total_connections.value "
echo $tot
echo -n "live_connections.value "
echo $live
Here is the result: