I thought I'd post this for people reference. I've
configured opsview (Nagios) to monitor my current sessions &
graph it so I can match performance & usage.
On the Freeswitch server install the
opsview-agent & set service to auto start
Create check_freeswitch_sessions.sh in
/usr/local/nagios/libexec & chkmod +x the script
--------------------------------------------------------
#!/bin/bash
set fsStatus=" "
/usr/local/freeswitch/bin/fs_cli -x "show calls count"
> /tmp/fsStatus
if [ $? -ne 0 ]; then
echo "Critical: Freeswitch not responding!"
rm /tmp/fsStatus
exit -1
fi
fsCalls=`grep "total."</tmp/fsStatus`
#Strip unwanted chars from the channels responses to
get pure ints.
fsCalls=${fsCalls/ total./}
# Build a message up
message="Active Sessions: $fsCalls"
echo $message
rm /tmp/fsStatus
#exit $fsCalls
exit 0
--------------------------------------------------------
The add the following to /usr/local/nagios/nrpe.cfg
--------------------------------------------------------
command[check_freeswitch_sessions]=/usr/local/nagios/libexec/check_freeswitch_Sessions.sh
--------------------------------------------------------
On Opsview server use check_nrpe service check to remotely
run the check_freeswitch_sessions service check.
Then on your opsview server
edit /usr/local/nagios/etc/map and add the following
--------------------------------------------------------
# Service type: Freeswitch Sessions
# ouput:Active Sessions: 0
/output:Active.*?(\d+)/
and push @s, [ "session",
[ "sessions", GAUGE, $1 ] ];
--------------------------------------------------------
Level 1, 409-411 Oxford Street,
Mount Hawthorne WA 6016
Office: +61 8 9427 2500
Mobile: +61 404 796 894
IT Consultant for Open Systems Support