#!/bin/bash #Generate and fill the RRD with asterisk resource values ############# ASTERISK ACTIVE CALLS syn3-graphcreate asterisk-active-calls --step=60 --use=MAX \ active_calls=GAUGE:120:0:U ACTIVE_CALLS="`asterisk -r -x 'show channels' | grep 'active call' | cut -d ' ' -f 1`" syn3-graph asterisk-active-calls active_calls="$ACTIVE_CALLS" ############# ASTERISK REGED SIPS and ACTIVE PEERS syn3-graphcreate asterisk-connections --step=60 --use=MAX \ sip_phones=GAUGE:120:0:U \ sip_trunks=GAUGE:120:0:U OUTPUT=`asterisk -r -x "sip show peers" | grep "sip peers"`; VALUE1=`echo $OUTPUT | cut -d ' ' -f 5`; VALUE2=`echo $OUTPUT | cut -d ' ' -f 10`; ONLINE_SIP_PHONES=`echo "$VALUE1 + $VALUE2" | bc` SIP_TRUNKS=`asterisk -r -x "sip show registry" | grep 'Registered' | wc -l` #cut of the header. syn3-graph asterisk-connections sip_phones="$ONLINE_SIP_PHONES" sip_trunks="$SIP_TRUNKS"