[Freeswitch-users] Freeswitch & Opsview Monitoring

Alex Ynema alex at opensystems.net.au
Fri May 17 09:24:17 MSD 2013


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 ] ];
--------------------------------------------------------

*Alex Ynema** *| IT Consultant
alex at opensystems.net.au

Level 1, 409-411 Oxford Street, Mount Hawthorne WA 6016
Office: +61 8 9427 2500
Mobile: +61 404 796 894
<http://www.ynema.net/>
<http://www.ynema.net/>IT Consultant for Open Systems Support
www.opensystems.net.au
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.freeswitch.org/pipermail/freeswitch-users/attachments/20130517/1eeefdae/attachment.html 


Join us at ClueCon 2011 Aug 9-11, 2011
More information about the FreeSWITCH-users mailing list