source: npl/phone/asterisk_monitoring/syn3-asteriskresourcecheck

Last change on this file was c5c522c, checked in by Edwin Eefting <edwin@datux.nl>, 8 years ago

initial commit, transferred from cleaned syn3 svn tree

  • Property mode set to 100644
File size: 916 bytes
Line 
1#!/bin/bash
2
3#Generate and fill the RRD with asterisk resource values
4
5############# ASTERISK ACTIVE CALLS
6syn3-graphcreate asterisk-active-calls --step=60 --use=MAX \
7        active_calls=GAUGE:120:0:U
8
9ACTIVE_CALLS="`asterisk -r -x 'show channels' | grep 'active call' | cut -d ' ' -f 1`"
10syn3-graph asterisk-active-calls active_calls="$ACTIVE_CALLS"
11
12
13
14############# ASTERISK REGED SIPS and ACTIVE PEERS
15syn3-graphcreate asterisk-connections --step=60 --use=MAX \
16        sip_phones=GAUGE:120:0:U \
17        sip_trunks=GAUGE:120:0:U
18
19OUTPUT=`asterisk -r -x "sip show peers" | grep "sip peers"`;
20VALUE1=`echo $OUTPUT | cut -d ' ' -f 5`;
21VALUE2=`echo $OUTPUT | cut -d ' ' -f 10`;
22ONLINE_SIP_PHONES=`echo "$VALUE1 + $VALUE2" | bc`
23SIP_TRUNKS=`asterisk -r -x "sip show registry" |  grep 'Registered' | wc -l`
24#cut of the header.
25syn3-graph asterisk-connections sip_phones="$ONLINE_SIP_PHONES" sip_trunks="$SIP_TRUNKS"
Note: See TracBrowser for help on using the repository browser.