2012-06-29 11:10:28 +02:00
|
|
|
#! /bin/sh
|
|
|
|
# Munin plugin
|
|
|
|
# Gets number of active channels
|
|
|
|
# By Eugene Varnavsky
|
|
|
|
# Converted to /bin/sh by Steve Schnepp
|
|
|
|
# June 2012
|
|
|
|
# Version 1.0
|
|
|
|
#
|
|
|
|
# LGPL License
|
2012-06-28 21:26:07 +02:00
|
|
|
|
2012-06-29 11:10:28 +02:00
|
|
|
if [ $1 = "autoconf" ]; then
|
|
|
|
echo "yes"
|
|
|
|
exit 0
|
|
|
|
fi
|
2012-06-28 21:26:07 +02:00
|
|
|
|
2012-06-29 11:10:28 +02:00
|
|
|
if [ $1 = "config" ]; then
|
|
|
|
echo "graph_title Asterisk Channels"
|
|
|
|
echo "graph_args --base 1000 -l 0"
|
|
|
|
echo "graph_vlabel Channels"
|
|
|
|
echo "graph_category asterisk"
|
|
|
|
echo "channels.label Channels"
|
|
|
|
exit 0
|
|
|
|
fi
|
2012-06-28 21:26:07 +02:00
|
|
|
|
2012-06-29 11:10:28 +02:00
|
|
|
asterisk -x "core show channels" | awk '/active channels/ { print "channels.value " $1 }'
|
|
|
|
exit 0
|