Might be a daft question: How do you like to monitor your usage

Status
Not open for further replies.

Andyd358

Member
Aug 23, 2018
243
8
18
55
UK
Cut a long story short I think I have over provisioned the Channels on my shared sip trunk. Currently have a number of customers on a shared trunk with X amount of Channels. So basically its first come first served. I dont imagine that the maximum number of calls at ayone time actaully reaches the limits of the amount of Channels. For the life of me I cant see an easy way in Fusion to monitor the Channel usage easily, or I'm just not seeing it. What would you recomend?
 

Adrian Fretwell

Well-Known Member
Aug 13, 2017
1,383
364
83
I pass all carrier related SIP traffic via OpenSIPS and use that to actively monitor channel usage. I find we often have more inbound than outbound especially if customers run conference centres.

Just off the top of my head...
A simple check within a single instance of FusionPBX would be Status->Active Calls and then click "Show All". You will of course see internal as well.

At the command line you could do something like:

Code:
fs_cli -x "show calls" | grep external | wc -l
 

KonradSC

Active Member
Mar 10, 2017
166
98
28
I use scripts that run fs_cli commands & sqlite queries. I have SNMP run these shell scripts and then chart the values using a monitoring application called PRTG.

Example of my script to show the calls on the system:
#!/bin/bash

CALLS=`/usr/bin/fs_cli -x "show calls count" | grep total | awk {'print $1'}`
echo $CALLS
exit $CALLS

Example for registrations from sqlite
#!/bin/bash
if [ "$(id -u)" != "0" ]; then
exec sudo "$0" "$@"
fi

sqlite3 /usr/local/freeswitch/db/core.db 'SELECT COUNT(reg_user) from registrations;'

Example for channels
#!/bin/bash

CHANNELS=`/usr/bin/fs_cli -x "show channels count" | grep total | awk {'print $1'}`
echo $CHANNELS
exit $CHANNELS

Example for Sessions Per Second
#!/bin/bash

CALLS=`/usr/bin/fs_cli -x "show status" | grep "session(s) per Sec" | awk {'print $1'}`
echo $CALLS
exit $CALLS

Add these scripts to /etc/snmp/snmp.conf
extend registrations /etc/fusionpbx/get_registrations.sh
extend calls /etc/fusionpbx/get_calls.sh
extend channels /etc/fusionpbx/get_channels.sh
extend sps /etc/fusionpbx/get_sps.sh

I had to allow sudo access for snmpd to run these commands. So I ran "sudo visudo" and added this:
snmp ALL = NOPASSWD: /etc/fusionpbx/root_get_internal_reg.sh
snmp ALL = NOPASSWD: /etc/fusionpbx/get_registrations.sh
snmp ALL = NOPASSWD: /etc/fusionpbx/get_calls.sh
snmp ALL = NOPASSWD: /etc/fusionpbx/get_channels.sh

Now you need to find out the MIB values for each script. Use snmptranslate:
snmptranslate -On NET-SNMP-EXTEND-MIB::nsExtendOutputFull.\"registrations\"
snmptranslate -On NET-SNMP-EXTEND-MIB::nsExtendOutputFull.\"calls\"
snmptranslate -On NET-SNMP-EXTEND-MIB::nsExtendOutputFull.\"channels\"

Slap those MIBs into your monitoring server, chart the values, then sit back and watch people make telephone calls.
 
Status
Not open for further replies.