mirror of
https://github.com/munin-monitoring/contrib.git
synced 2018-11-08 00:59:34 +01:00
asterisk_inuse: fix plugin to use asterisk command from PATH and fix a whitespace issue
This commit is contained in:
parent
446de9a689
commit
137cbf74b6
@ -7,8 +7,8 @@
|
||||
#
|
||||
|
||||
if [ "$1" = "autoconf" ]; then
|
||||
if [ -x /usr/local/sbin/asterisk ]; then
|
||||
/usr/local/sbin/asterisk -rx 'sip show inuse' > /dev/null
|
||||
if [ which asterisk ]; then
|
||||
asterisk -rx 'sip show inuse' > /dev/null
|
||||
if [ $? = "0" ]; then
|
||||
echo yes
|
||||
exit 0
|
||||
@ -40,13 +40,13 @@ if [ "$1" = "config" ]; then
|
||||
exit 0
|
||||
fi
|
||||
|
||||
INUSE=`/usr/local/sbin/asterisk -rx 'sip show inuse' | grep -v "0/0" | grep -v " 0 " | grep -v " name" | wc -l`
|
||||
CONN=`/usr/local/sbin/asterisk -rx 'sip show peers' | grep OK | wc -l`
|
||||
INUSE=`asterisk -rx 'sip show inuse' | grep -v "0/0" | grep -v " 0 " | grep -v " name" | wc -l`
|
||||
CONN=`asterisk -rx 'sip show peers' | grep OK | wc -l`
|
||||
|
||||
if [ "$INUSE" -ge "1" ]; then
|
||||
echo "inuse.value"$INUSE
|
||||
echo "inuse.value "$INUSE
|
||||
else
|
||||
echo "inuse.value 0"
|
||||
fi
|
||||
|
||||
echo "connected.value"$CONN
|
||||
echo "connected.value "$CONN
|
||||
|
Loading…
Reference in New Issue
Block a user