Asteriskstats.sh

From Ye Ole Stash
Jump to: navigation, search
#!/bin/bash
 
AC='asterisk -r -x'
 
#Uniq Peers
$AC 'sip show channels' | awk '{print $1}' | grep [0-255].[0-255] | uniq | wc -l
 
#sip channel commands
$AC 'sip show channels' | grep g729 | grep Tx | wc -l
$AC 'sip show channels' | grep g729 | grep Rx | wc -l
 
$AC 'sip show channels' | grep ulaw | grep Tx | wc -l
$AC 'sip show channels' | grep ulaw | grep Rx | wc -l
 
#Shows channels and calls
$AC 'core show channels' | grep active | awk '{print $1}'
 
#Threads in use
$AC 'core show threads' | wc -l
 
#system and Asterisk uptime
$AC 'core show uptime'
Personal tools