mirror of
https://github.com/munin-monitoring/contrib.git
synced 2018-11-08 00:59:34 +01:00
17f784270a
* remove trailing whitespace * remove empty lines at the end of files
32 lines
729 B
Bash
Executable File
32 lines
729 B
Bash
Executable File
#! /bin/sh
|
|
# Munin plugin
|
|
# Gets number of active channels
|
|
# By Eugene Varnavsky
|
|
# Converted to /bin/sh by Steve Schnepp
|
|
# June 2012
|
|
# Version 1.0
|
|
#
|
|
# Run as root or make sure munin user can run 'asterisk -r' command
|
|
#
|
|
# [asterisk_channels]
|
|
# user root
|
|
#
|
|
# LGPL License
|
|
|
|
if [ "$1" = "autoconf" ]; then
|
|
[ -z $(which asterisk) ] && echo "no" || echo "yes"
|
|
exit 0
|
|
fi
|
|
|
|
if [ "$1" = "config" ]; then
|
|
echo "graph_title Asterisk Channels"
|
|
echo "graph_args --base 1000 -l 0"
|
|
echo "graph_vlabel Channels"
|
|
echo "graph_category voip"
|
|
echo "channels.label Channels"
|
|
exit 0
|
|
fi
|
|
|
|
asterisk -rx "core show channels" | awk '/active channels/ { print "channels.value " $1 }'
|
|
exit 0
|