[Freeswitch-users] Freeswitch & Opsview Monitoring

Telecube - John john at telecube.com.au
Fri May 17 10:16:55 MSD 2013


Nice, if it's ok with you I'm going to 'borrow' this and make it work 
with Cactus

- John

On 17/05/13 3:24 PM, Alex Ynema wrote:
> 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 <mailto: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
>
> IT Consultant for Open Systems Support
> www.opensystems.net.au <http://www.opensystems.net.au/>
>
>
> _________________________________________________________________________
> Professional FreeSWITCH Consulting Services:
> consulting at freeswitch.org
> http://www.freeswitchsolutions.com
>
> 
> 
>
> Official FreeSWITCH Sites
> http://www.freeswitch.org
> http://wiki.freeswitch.org
> http://www.cluecon.com
>
> FreeSWITCH-users mailing list
> FreeSWITCH-users at lists.freeswitch.org
> http://lists.freeswitch.org/mailman/listinfo/freeswitch-users
> UNSUBSCRIBE:http://lists.freeswitch.org/mailman/options/freeswitch-users
> http://www.freeswitch.org

-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.freeswitch.org/pipermail/freeswitch-users/attachments/20130517/0e1f9d25/attachment-0001.html 


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