SNMP fs_cli: Permission denied"
Hi I'm trying to export calls count into snmp for graphing with zenoss. I used this post for cacti. http://wiki.freeswitch.org/wiki/Snmp_Cacti Script: #!/bin/bash /usr/local/freeswitch/bin/fs_cli -x "show calls count" | grep total | awk '{print $1}' Permissions: -rwxrwxrwx 1 root staff 295 Jan 29 17:01 curcalls in snmpd.conf I have following: ### ---- FreeSWITCH Active Calls ---- extend .1.3.6.1.4.1.2021.8.1.101 curcalls /usr/local/scripts/curcalls When I run: snmpwalk localhost -c public -v2c .1.3.6.1.4.1.2021.8.1.101 I get following output: iso.3.6.1.4.1.2021.8.1.101.1.0 = INTEGER: 1 iso.3.6.1.4.1.2021.8.1.101.2.1.2.8.99.117.114.99.97.108.108.115 = STRING: "/usr/local/freeswitch/bin/fs_cli -x 'show calls count' | grep total | awk '{print $1}'" iso.3.6.1.4.1.2021.8.1.101.2.1.3.8.99.117.114.99.97.108.108.115 = "" iso.3.6.1.4.1.2021.8.1.101.2.1.4.8.99.117.114.99.97.108.108.115 = "" iso.3.6.1.4.1.2021.8.1.101.2.1.5.8.99.117.114.99.97.108.108.115 = INTEGER: 5 iso.3.6.1.4.1.2021.8.1.101.2.1.6.8.99.117.114.99.97.108.108.115 = INTEGER: 1 iso.3.6.1.4.1.2021.8.1.101.2.1.7.8.99.117.114.99.97.108.108.115 = INTEGER: 1 iso.3.6.1.4.1.2021.8.1.101.2.1.20.8.99.117.114.99.97.108.108.115 = INTEGER: 4 iso.3.6.1.4.1.2021.8.1.101.2.1.21.8.99.117.114.99.97.108.108.115 = INTEGER: 1 iso.3.6.1.4.1.2021.8.1.101.3.1.1.8.99.117.114.99.97.108.108.115 = STRING: "/usr/local/freeswitch/bin/fs_cli: Permission denied" iso.3.6.1.4.1.2021.8.1.101.3.1.2.8.99.117.114.99.97.108.108.115 = STRING: "/usr/local/freeswitch/bin/fs_cli: Permission denied" iso.3.6.1.4.1.2021.8.1.101.3.1.3.8.99.117.114.99.97.108.108.115 = INTEGER: 1 iso.3.6.1.4.1.2021.8.1.101.3.1.4.8.99.117.114.99.97.108.108.115 = INTEGER: 1 iso.3.6.1.4.1.2021.8.1.101.4.1.2.8.99.117.114.99.97.108.108.115.1 = STRING: "/usr/local/freeswitch/bin/fs_cli: Permission denied" I run on Debian 6.0 with FreeSWITCH version: FreeSWITCH Version 1.2.15+git~20131210T035405Z~b1288520bc~64bit (git b128852 2013-12-10 03:54:05Z 64bit) Any input will be appreciated. Thank you -- Deon
The user running snmpd does it have perms to execute fs_cli? Just because it can exec the shell script doesn¹t mean it has perms to exec fs_cli On 1/29/14 10:46 AM, "Deon Vermeulen" <vermeulen.deon@gmail.com> wrote:
Hi
I'm trying to export calls count into snmp for graphing with zenoss. I used this post for cacti. http://wiki.freeswitch.org/wiki/Snmp_Cacti
Script:
#!/bin/bash /usr/local/freeswitch/bin/fs_cli -x "show calls count" | grep total | awk '{print $1}'
Permissions:
-rwxrwxrwx 1 root staff 295 Jan 29 17:01 curcalls
in snmpd.conf I have following:
### ---- FreeSWITCH Active Calls ---- extend .1.3.6.1.4.1.2021.8.1.101 curcalls /usr/local/scripts/curcalls
When I run:
snmpwalk localhost -c public -v2c .1.3.6.1.4.1.2021.8.1.101
I get following output:
iso.3.6.1.4.1.2021.8.1.101.1.0 = INTEGER: 1 iso.3.6.1.4.1.2021.8.1.101.2.1.2.8.99.117.114.99.97.108.108.115 = STRING: "/usr/local/freeswitch/bin/fs_cli -x 'show calls count' | grep total | awk '{print $1}'" iso.3.6.1.4.1.2021.8.1.101.2.1.3.8.99.117.114.99.97.108.108.115 = "" iso.3.6.1.4.1.2021.8.1.101.2.1.4.8.99.117.114.99.97.108.108.115 = "" iso.3.6.1.4.1.2021.8.1.101.2.1.5.8.99.117.114.99.97.108.108.115 = INTEGER: 5 iso.3.6.1.4.1.2021.8.1.101.2.1.6.8.99.117.114.99.97.108.108.115 = INTEGER: 1 iso.3.6.1.4.1.2021.8.1.101.2.1.7.8.99.117.114.99.97.108.108.115 = INTEGER: 1 iso.3.6.1.4.1.2021.8.1.101.2.1.20.8.99.117.114.99.97.108.108.115 = INTEGER: 4 iso.3.6.1.4.1.2021.8.1.101.2.1.21.8.99.117.114.99.97.108.108.115 = INTEGER: 1 iso.3.6.1.4.1.2021.8.1.101.3.1.1.8.99.117.114.99.97.108.108.115 = STRING: "/usr/local/freeswitch/bin/fs_cli: Permission denied" iso.3.6.1.4.1.2021.8.1.101.3.1.2.8.99.117.114.99.97.108.108.115 = STRING: "/usr/local/freeswitch/bin/fs_cli: Permission denied" iso.3.6.1.4.1.2021.8.1.101.3.1.3.8.99.117.114.99.97.108.108.115 = INTEGER: 1 iso.3.6.1.4.1.2021.8.1.101.3.1.4.8.99.117.114.99.97.108.108.115 = INTEGER: 1 iso.3.6.1.4.1.2021.8.1.101.4.1.2.8.99.117.114.99.97.108.108.115.1 = STRING: "/usr/local/freeswitch/bin/fs_cli: Permission denied"
I run on Debian 6.0 with FreeSWITCH version: FreeSWITCH Version 1.2.15+git~20131210T035405Z~b1288520bc~64bit (git b128852 2013-12-10 03:54:05Z 64bit)
Any input will be appreciated.
Thank you
-- Ken http://www.FreeSWITCH.org http://www.ClueCon.com http://www.OSTAG.org irc.freenode.net #freeswitch Twitter: @FreeSWITCH
Ken, I'm not sure what I'm missing, but I've done pretty much all I know, but still not getting any ware. Here is info I can supply atm. SNMP: ps aux | grep snmp snmp 16011 0.0 0.0 49200 5520 ? S 22:13 0:00 /usr/sbin/snmpd -Lsd -Lf /dev/null -u snmp -g snmp -I -smux -p /var/run/snmpd.pid SNMP.CONF ### ---- FreeSWITCH Active Calls ---- extend .1.3.6.1.4.1.2021.8.1.101 curcalls /usr/local/scripts/curcalls USER: id snmp uid=105(snmp) gid=106(snmp) groups=106(snmp),0(root),1(daemon) FS INIT: /etc/init.d/freeswitch FS_USER=freeswitch FS_GROUP=daemon # # Function that starts the daemon/service # do_start() { # Set user to run as if [ $FS_USER ] ; then DAEMON_ARGS="`echo $DAEMON_ARGS` -u $FS_USER" fi # Set group to run as if [ $FS_GROUP ] ; then DAEMON_ARGS="`echo $DAEMON_ARGS` -g $FS_GROUP" fi FS_CLI: -rwxrwxrwx 1 root daemon 596002 Dec 10 08:42 fs_cli SCRIPT: -rwxrwxrwx 1 root daemon 364 Jan 29 22:15 curcalls #!/bin/bash /usr/local/freeswitch/bin/fs_cli -x "show calls count" | grep total | awk '{print $1}' SNMPWALK OUTPUT: snmpwalk localhost -c public -v2c .1.3.6.1.4.1.2021.8.1.101 iso.3.6.1.4.1.2021.8.1.101.1.0 = INTEGER: 1 iso.3.6.1.4.1.2021.8.1.101.2.1.2.8.99.117.114.99.97.108.108.115 = STRING: "/usr/local/scripts/curcalls" iso.3.6.1.4.1.2021.8.1.101.2.1.3.8.99.117.114.99.97.108.108.115 = "" iso.3.6.1.4.1.2021.8.1.101.2.1.4.8.99.117.114.99.97.108.108.115 = "" iso.3.6.1.4.1.2021.8.1.101.2.1.5.8.99.117.114.99.97.108.108.115 = INTEGER: 5 iso.3.6.1.4.1.2021.8.1.101.2.1.6.8.99.117.114.99.97.108.108.115 = INTEGER: 1 iso.3.6.1.4.1.2021.8.1.101.2.1.7.8.99.117.114.99.97.108.108.115 = INTEGER: 1 iso.3.6.1.4.1.2021.8.1.101.2.1.20.8.99.117.114.99.97.108.108.115 = INTEGER: 4 iso.3.6.1.4.1.2021.8.1.101.2.1.21.8.99.117.114.99.97.108.108.115 = INTEGER: 1 iso.3.6.1.4.1.2021.8.1.101.3.1.1.8.99.117.114.99.97.108.108.115 = STRING: "/usr/local/scripts/curcalls: line 6: /usr/local/freeswitch/bin/fs_cli: Permission denied" iso.3.6.1.4.1.2021.8.1.101.3.1.2.8.99.117.114.99.97.108.108.115 = STRING: "/usr/local/scripts/curcalls: line 6: /usr/local/freeswitch/bin/fs_cli: Permission denied" iso.3.6.1.4.1.2021.8.1.101.3.1.3.8.99.117.114.99.97.108.108.115 = INTEGER: 1 iso.3.6.1.4.1.2021.8.1.101.3.1.4.8.99.117.114.99.97.108.108.115 = INTEGER: 0 iso.3.6.1.4.1.2021.8.1.101.4.1.2.8.99.117.114.99.97.108.108.115.1 = STRING: "/usr/local/scripts/curcalls: line 6: /usr/local/freeswitch/bin/fs_cli: Permission denied" Hope the above provides enough information to find solution. Thanks -- Deon
Ken Rice <mailto:krice@freeswitch.org> January 29, 2014 at 6:53 PM The user running snmpd does it have perms to execute fs_cli? Just because it can exec the shell script doesn't mean it has perms to exec fs_cli
On 1/29/14 10:46 AM, "Deon Vermeulen" <vermeulen.deon@gmail.com> wrote:
-- Ken _http://www.FreeSWITCH.org http://www.ClueCon.com http://www.OSTAG.org _irc.freenode.net #freeswitch Twitter: @FreeSWITCH
_________________________________________________________________________ Professional FreeSWITCH Consulting Services: consulting@freeswitch.org http://www.freeswitchsolutions.com
FreeSWITCH-powered IP PBX: The CudaTel Communication Server http://www.cudatel.com
Official FreeSWITCH Sites http://www.freeswitch.org http://wiki.freeswitch.org http://www.cluecon.com
FreeSWITCH-users mailing list FreeSWITCH-users@lists.freeswitch.org http://lists.freeswitch.org/mailman/listinfo/freeswitch-users UNSUBSCRIBE:http://lists.freeswitch.org/mailman/options/freeswitch-users http://www.freeswitch.org Deon Vermeulen <mailto:vermeulen.deon@gmail.com> January 29, 2014 at 6:46 PM Hi
I'm trying to export calls count into snmp for graphing with zenoss. I used this post for cacti. http://wiki.freeswitch.org/wiki/Snmp_Cacti
Script:
#!/bin/bash /usr/local/freeswitch/bin/fs_cli -x "show calls count" | grep total | awk '{print $1}'
Permissions:
-rwxrwxrwx 1 root staff 295 Jan 29 17:01 curcalls
in snmpd.conf I have following:
### ---- FreeSWITCH Active Calls ---- extend .1.3.6.1.4.1.2021.8.1.101 curcalls /usr/local/scripts/curcalls
When I run:
snmpwalk localhost -c public -v2c .1.3.6.1.4.1.2021.8.1.101
I get following output:
iso.3.6.1.4.1.2021.8.1.101.1.0 = INTEGER: 1 iso.3.6.1.4.1.2021.8.1.101.2.1.2.8.99.117.114.99.97.108.108.115 = STRING: "/usr/local/freeswitch/bin/fs_cli -x 'show calls count' | grep total | awk '{print $1}'" iso.3.6.1.4.1.2021.8.1.101.2.1.3.8.99.117.114.99.97.108.108.115 = "" iso.3.6.1.4.1.2021.8.1.101.2.1.4.8.99.117.114.99.97.108.108.115 = "" iso.3.6.1.4.1.2021.8.1.101.2.1.5.8.99.117.114.99.97.108.108.115 = INTEGER: 5 iso.3.6.1.4.1.2021.8.1.101.2.1.6.8.99.117.114.99.97.108.108.115 = INTEGER: 1 iso.3.6.1.4.1.2021.8.1.101.2.1.7.8.99.117.114.99.97.108.108.115 = INTEGER: 1 iso.3.6.1.4.1.2021.8.1.101.2.1.20.8.99.117.114.99.97.108.108.115 = INTEGER: 4 iso.3.6.1.4.1.2021.8.1.101.2.1.21.8.99.117.114.99.97.108.108.115 = INTEGER: 1 iso.3.6.1.4.1.2021.8.1.101.3.1.1.8.99.117.114.99.97.108.108.115 = STRING: "/usr/local/freeswitch/bin/fs_cli: Permission denied" iso.3.6.1.4.1.2021.8.1.101.3.1.2.8.99.117.114.99.97.108.108.115 = STRING: "/usr/local/freeswitch/bin/fs_cli: Permission denied" iso.3.6.1.4.1.2021.8.1.101.3.1.3.8.99.117.114.99.97.108.108.115 = INTEGER: 1 iso.3.6.1.4.1.2021.8.1.101.3.1.4.8.99.117.114.99.97.108.108.115 = INTEGER: 1 iso.3.6.1.4.1.2021.8.1.101.4.1.2.8.99.117.114.99.97.108.108.115.1 = STRING: "/usr/local/freeswitch/bin/fs_cli: Permission denied"
I run on Debian 6.0 with FreeSWITCH version: FreeSWITCH Version 1.2.15+git~20131210T035405Z~b1288520bc~64bit (git b128852 2013-12-10 03:54:05Z 64bit)
Any input will be appreciated.
Thank you --
Check the permissions of every component of the /usr/local/freeswitch/bin/fs_cli path - the permissions of the binary might be ok but the user may still be denied access at one of the directory levels. Try running the command through the su command as the snmp user to see if you can debug it interactively that way On 29 January 2014 20:30, Deon Vermeulen <vermeulen.deon@gmail.com> wrote:
Ken,
I'm not sure what I'm missing, but I've done pretty much all I know, but still not getting any ware. Here is info I can supply atm.
SNMP: ps aux | grep snmp snmp 16011 0.0 0.0 49200 5520 ? S 22:13 0:00 /usr/sbin/snmpd -Lsd -Lf /dev/null -u snmp -g snmp -I -smux -p /var/run/snmpd.pid
SNMP.CONF
### ---- FreeSWITCH Active Calls ---- extend .1.3.6.1.4.1.2021.8.1.101 curcalls /usr/local/scripts/curcalls
USER: id snmp uid=105(snmp) gid=106(snmp) groups=106(snmp),0(root),1(daemon)
FS INIT: /etc/init.d/freeswitch
FS_USER=freeswitch FS_GROUP=daemon
# # Function that starts the daemon/service # do_start() { # Set user to run as if [ $FS_USER ] ; then DAEMON_ARGS="`echo $DAEMON_ARGS` -u $FS_USER" fi # Set group to run as if [ $FS_GROUP ] ; then DAEMON_ARGS="`echo $DAEMON_ARGS` -g $FS_GROUP" fi
FS_CLI: -rwxrwxrwx 1 root daemon 596002 Dec 10 08:42 fs_cli
SCRIPT: -rwxrwxrwx 1 root daemon 364 Jan 29 22:15 curcalls
#!/bin/bash /usr/local/freeswitch/bin/fs_cli -x "show calls count" | grep total | awk '{print $1}'
SNMPWALK OUTPUT:
snmpwalk localhost -c public -v2c .1.3.6.1.4.1.2021.8.1.101 iso.3.6.1.4.1.2021.8.1.101.1.0 = INTEGER: 1 iso.3.6.1.4.1.2021.8.1.101.2.1.2.8.99.117.114.99.97.108.108.115 = STRING: "/usr/local/scripts/curcalls"
iso.3.6.1.4.1.2021.8.1.101.2.1.3.8.99.117.114.99.97.108.108.115 = "" iso.3.6.1.4.1.2021.8.1.101.2.1.4.8.99.117.114.99.97.108.108.115 = "" iso.3.6.1.4.1.2021.8.1.101.2.1.5.8.99.117.114.99.97.108.108.115 = INTEGER: 5 iso.3.6.1.4.1.2021.8.1.101.2.1.6.8.99.117.114.99.97.108.108.115 = INTEGER: 1 iso.3.6.1.4.1.2021.8.1.101.2.1.7.8.99.117.114.99.97.108.108.115 = INTEGER: 1 iso.3.6.1.4.1.2021.8.1.101.2.1.20.8.99.117.114.99.97.108.108.115 = INTEGER: 4 iso.3.6.1.4.1.2021.8.1.101.2.1.21.8.99.117.114.99.97.108.108.115 = INTEGER: 1 iso.3.6.1.4.1.2021.8.1.101.3.1.1.8.99.117.114.99.97.108.108.115 = STRING: "/usr/local/scripts/curcalls: line 6: /usr/local/freeswitch/bin/fs_cli: Permission denied" iso.3.6.1.4.1.2021.8.1.101.3.1.2.8.99.117.114.99.97.108.108.115 = STRING: "/usr/local/scripts/curcalls: line 6: /usr/local/freeswitch/bin/fs_cli: Permission denied" iso.3.6.1.4.1.2021.8.1.101.3.1.3.8.99.117.114.99.97.108.108.115 = INTEGER: 1 iso.3.6.1.4.1.2021.8.1.101.3.1.4.8.99.117.114.99.97.108.108.115 = INTEGER: 0 iso.3.6.1.4.1.2021.8.1.101.4.1.2.8.99.117.114.99.97.108.108.115.1 = STRING: "/usr/local/scripts/curcalls: line 6: /usr/local/freeswitch/bin/fs_cli: Permission denied"
Hope the above provides enough information to find solution.
Thanks -- Deon
Ken Rice <krice@freeswitch.org> January 29, 2014 at 6:53 PM The user running snmpd does it have perms to execute fs_cli? Just because it can exec the shell script doesn't mean it has perms to exec fs_cli
On 1/29/14 10:46 AM, "Deon Vermeulen" <vermeulen.deon@gmail.com> wrote:
-- Ken
*http://www.FreeSWITCH.org <http://www.FreeSWITCH.org> http://www.ClueCon.com <http://www.ClueCon.com> http://www.OSTAG.org <http://www.OSTAG.org> *irc.freenode.net #freeswitch Twitter: @FreeSWITCH
_________________________________________________________________________ Professional FreeSWITCH Consulting Services: consulting@freeswitch.org http://www.freeswitchsolutions.com
FreeSWITCH-powered IP PBX: The CudaTel Communication Server http://www.cudatel.com
Official FreeSWITCH Sites http://www.freeswitch.org http://wiki.freeswitch.org http://www.cluecon.com
FreeSWITCH-users mailing list FreeSWITCH-users@lists.freeswitch.org http://lists.freeswitch.org/mailman/listinfo/freeswitch-users UNSUBSCRIBE:http://lists.freeswitch.org/mailman/options/freeswitch-users http://www.freeswitch.org Deon Vermeulen <vermeulen.deon@gmail.com> January 29, 2014 at 6:46 PM Hi
I'm trying to export calls count into snmp for graphing with zenoss. I used this post for cacti. http://wiki.freeswitch.org/wiki/Snmp_Cacti
Script:
#!/bin/bash /usr/local/freeswitch/bin/fs_cli -x "show calls count" | grep total | awk '{print $1}'
Permissions:
-rwxrwxrwx 1 root staff 295 Jan 29 17:01 curcalls
in snmpd.conf I have following:
### ---- FreeSWITCH Active Calls ---- extend .1.3.6.1.4.1.2021.8.1.101 curcalls /usr/local/scripts/curcalls
When I run:
snmpwalk localhost -c public -v2c .1.3.6.1.4.1.2021.8.1.101
I get following output:
iso.3.6.1.4.1.2021.8.1.101.1.0 = INTEGER: 1 iso.3.6.1.4.1.2021.8.1.101.2.1.2.8.99.117.114.99.97.108.108.115 = STRING: "/usr/local/freeswitch/bin/fs_cli -x 'show calls count' | grep total | awk '{print $1}'" iso.3.6.1.4.1.2021.8.1.101.2.1.3.8.99.117.114.99.97.108.108.115 = "" iso.3.6.1.4.1.2021.8.1.101.2.1.4.8.99.117.114.99.97.108.108.115 = "" iso.3.6.1.4.1.2021.8.1.101.2.1.5.8.99.117.114.99.97.108.108.115 = INTEGER: 5 iso.3.6.1.4.1.2021.8.1.101.2.1.6.8.99.117.114.99.97.108.108.115 = INTEGER: 1 iso.3.6.1.4.1.2021.8.1.101.2.1.7.8.99.117.114.99.97.108.108.115 = INTEGER: 1 iso.3.6.1.4.1.2021.8.1.101.2.1.20.8.99.117.114.99.97.108.108.115 = INTEGER: 4 iso.3.6.1.4.1.2021.8.1.101.2.1.21.8.99.117.114.99.97.108.108.115 = INTEGER: 1 iso.3.6.1.4.1.2021.8.1.101.3.1.1.8.99.117.114.99.97.108.108.115 = STRING: "/usr/local/freeswitch/bin/fs_cli: Permission denied" iso.3.6.1.4.1.2021.8.1.101.3.1.2.8.99.117.114.99.97.108.108.115 = STRING: "/usr/local/freeswitch/bin/fs_cli: Permission denied" iso.3.6.1.4.1.2021.8.1.101.3.1.3.8.99.117.114.99.97.108.108.115 = INTEGER: 1 iso.3.6.1.4.1.2021.8.1.101.3.1.4.8.99.117.114.99.97.108.108.115 = INTEGER: 1 iso.3.6.1.4.1.2021.8.1.101.4.1.2.8.99.117.114.99.97.108.108.115.1 = STRING: "/usr/local/freeswitch/bin/fs_cli: Permission denied"
I run on Debian 6.0 with FreeSWITCH version: FreeSWITCH Version 1.2.15+git~20131210T035405Z~b1288520bc~64bit (git b128852 2013-12-10 03:54:05Z 64bit)
Any input will be appreciated.
Thank you --
_________________________________________________________________________ Professional FreeSWITCH Consulting Services: consulting@freeswitch.org http://www.freeswitchsolutions.com
FreeSWITCH-powered IP PBX: The CudaTel Communication Server http://www.cudatel.com
Official FreeSWITCH Sites http://www.freeswitch.org http://wiki.freeswitch.org http://www.cluecon.com
FreeSWITCH-users mailing list FreeSWITCH-users@lists.freeswitch.org http://lists.freeswitch.org/mailman/listinfo/freeswitch-users UNSUBSCRIBE:http://lists.freeswitch.org/mailman/options/freeswitch-users http://www.freeswitch.org
Hi, I use this script, located in ~/bin of my freeswitch user, to graph channel usage. #!/bin/sh # script to gather channel usage per customer CHANNELS=`/usr/local/freeswitch/bin/fs_cli -x "limit_usage db channels testcustomer"` echo .1.3.6.1.4.1.2021.8.0 echo integer echo $CHANNELS Then in snmpd.conf pass .1.3.6.1.4.1.2021.8.0 /bin/sh /home/fsadmin/bin/channel_usage.sh Zenoss Advanced – monitoring templates Create a new template under linux servers for freeswitch add data point with snmp oid. Set graph creation to GUAGE and set cmd to RRA:AVERAGE:0.5:1:600 RRA:AVERAGE:0.5:6:600 RRA:AVERAGE:0.5:24:600 RRA:AVERAGE:0.5:288:600 RRA:MAX:0.5:6:600 RRA:MAX:0.5:24:600 RRA:MAX:0.5:288:600 RRA:LAST:0.5:1:600 RRA:LAST:0.5:6:600 RRA:LAST:0.5:24:600 RRA:LAST:0.5:288:600 Add graph definition and the manage graph point. Update consolidation to LAST. Also change format to %5.0lf%s Hope this helps Anthony On 29 Jan 2014, at 16:46, Deon Vermeulen <vermeulen.deon@gmail.com> wrote:
Hi
I'm trying to export calls count into snmp for graphing with zenoss. I used this post for cacti. http://wiki.freeswitch.org/wiki/Snmp_Cacti
Script:
#!/bin/bash /usr/local/freeswitch/bin/fs_cli -x "show calls count" | grep total | awk '{print $1}'
Permissions:
-rwxrwxrwx 1 root staff 295 Jan 29 17:01 curcalls
in snmpd.conf I have following:
### ---- FreeSWITCH Active Calls ---- extend .1.3.6.1.4.1.2021.8.1.101 curcalls /usr/local/scripts/curcalls
When I run:
snmpwalk localhost -c public -v2c .1.3.6.1.4.1.2021.8.1.101
I get following output:
iso.3.6.1.4.1.2021.8.1.101.1.0 = INTEGER: 1 iso.3.6.1.4.1.2021.8.1.101.2.1.2.8.99.117.114.99.97.108.108.115 = STRING: "/usr/local/freeswitch/bin/fs_cli -x 'show calls count' | grep total | awk '{print $1}'" iso.3.6.1.4.1.2021.8.1.101.2.1.3.8.99.117.114.99.97.108.108.115 = "" iso.3.6.1.4.1.2021.8.1.101.2.1.4.8.99.117.114.99.97.108.108.115 = "" iso.3.6.1.4.1.2021.8.1.101.2.1.5.8.99.117.114.99.97.108.108.115 = INTEGER: 5 iso.3.6.1.4.1.2021.8.1.101.2.1.6.8.99.117.114.99.97.108.108.115 = INTEGER: 1 iso.3.6.1.4.1.2021.8.1.101.2.1.7.8.99.117.114.99.97.108.108.115 = INTEGER: 1 iso.3.6.1.4.1.2021.8.1.101.2.1.20.8.99.117.114.99.97.108.108.115 = INTEGER: 4 iso.3.6.1.4.1.2021.8.1.101.2.1.21.8.99.117.114.99.97.108.108.115 = INTEGER: 1 iso.3.6.1.4.1.2021.8.1.101.3.1.1.8.99.117.114.99.97.108.108.115 = STRING: "/usr/local/freeswitch/bin/fs_cli: Permission denied" iso.3.6.1.4.1.2021.8.1.101.3.1.2.8.99.117.114.99.97.108.108.115 = STRING: "/usr/local/freeswitch/bin/fs_cli: Permission denied" iso.3.6.1.4.1.2021.8.1.101.3.1.3.8.99.117.114.99.97.108.108.115 = INTEGER: 1 iso.3.6.1.4.1.2021.8.1.101.3.1.4.8.99.117.114.99.97.108.108.115 = INTEGER: 1 iso.3.6.1.4.1.2021.8.1.101.4.1.2.8.99.117.114.99.97.108.108.115.1 = STRING: "/usr/local/freeswitch/bin/fs_cli: Permission denied"
I run on Debian 6.0 with FreeSWITCH version: FreeSWITCH Version 1.2.15+git~20131210T035405Z~b1288520bc~64bit (git b128852 2013-12-10 03:54:05Z 64bit)
Any input will be appreciated.
Thank you -- Deon _________________________________________________________________________ Professional FreeSWITCH Consulting Services: consulting@freeswitch.org http://www.freeswitchsolutions.com
FreeSWITCH-powered IP PBX: The CudaTel Communication Server http://www.cudatel.com
Official FreeSWITCH Sites http://www.freeswitch.org http://wiki.freeswitch.org http://www.cluecon.com
FreeSWITCH-users mailing list FreeSWITCH-users@lists.freeswitch.org http://lists.freeswitch.org/mailman/listinfo/freeswitch-users UNSUBSCRIBE:http://lists.freeswitch.org/mailman/options/freeswitch-users http://www.freeswitch.org
Anthony thanks for your input. I'll check it out with our sysadmin of Zenoss tomorrow when back in office regards -- Deon
Anthony McGarry <mailto:agtmcgarry@icloud.com> January 29, 2014 at 7:31 PM Hi,
I use this script, located in ~/bin of my freeswitch user, to graph channel usage.
#!/bin/sh # script to gather channel usage per customer
CHANNELS=`/usr/local/freeswitch/bin/fs_cli -x "limit_usage db channels testcustomer"`
echo .1.3.6.1.4.1.2021.8.0 echo integer echo $CHANNELS
Then in snmpd.conf
pass .1.3.6.1.4.1.2021.8.0 /bin/sh /home/fsadmin/bin/channel_usage.sh
Zenoss Advanced -- monitoring templates Create a new template under linux servers for freeswitch add data point with snmp oid.
Set graph creation to GUAGE and set cmd to
RRA:AVERAGE:0.5:1:600 RRA:AVERAGE:0.5:6:600 RRA:AVERAGE:0.5:24:600 RRA:AVERAGE:0.5:288:600 RRA:MAX:0.5:6:600 RRA:MAX:0.5:24:600 RRA:MAX:0.5:288:600 RRA:LAST:0.5:1:600 RRA:LAST:0.5:6:600 RRA:LAST:0.5:24:600 RRA:LAST:0.5:288:600
Add graph definition and the manage graph point.
Update consolidation to LAST.
Also change format to %5.0lf%s
Hope this helps
Anthony
_________________________________________________________________________ Professional FreeSWITCH Consulting Services: consulting@freeswitch.org http://www.freeswitchsolutions.com
FreeSWITCH-powered IP PBX: The CudaTel Communication Server http://www.cudatel.com
Official FreeSWITCH Sites http://www.freeswitch.org http://wiki.freeswitch.org http://www.cluecon.com
FreeSWITCH-users mailing list FreeSWITCH-users@lists.freeswitch.org http://lists.freeswitch.org/mailman/listinfo/freeswitch-users UNSUBSCRIBE:http://lists.freeswitch.org/mailman/options/freeswitch-users http://www.freeswitch.org Deon Vermeulen <mailto:vermeulen.deon@gmail.com> January 29, 2014 at 6:46 PM Hi
I'm trying to export calls count into snmp for graphing with zenoss. I used this post for cacti. http://wiki.freeswitch.org/wiki/Snmp_Cacti
Script:
#!/bin/bash /usr/local/freeswitch/bin/fs_cli -x "show calls count" | grep total | awk '{print $1}'
Permissions:
-rwxrwxrwx 1 root staff 295 Jan 29 17:01 curcalls
in snmpd.conf I have following:
### ---- FreeSWITCH Active Calls ---- extend .1.3.6.1.4.1.2021.8.1.101 curcalls /usr/local/scripts/curcalls
When I run:
snmpwalk localhost -c public -v2c .1.3.6.1.4.1.2021.8.1.101
I get following output:
iso.3.6.1.4.1.2021.8.1.101.1.0 = INTEGER: 1 iso.3.6.1.4.1.2021.8.1.101.2.1.2.8.99.117.114.99.97.108.108.115 = STRING: "/usr/local/freeswitch/bin/fs_cli -x 'show calls count' | grep total | awk '{print $1}'" iso.3.6.1.4.1.2021.8.1.101.2.1.3.8.99.117.114.99.97.108.108.115 = "" iso.3.6.1.4.1.2021.8.1.101.2.1.4.8.99.117.114.99.97.108.108.115 = "" iso.3.6.1.4.1.2021.8.1.101.2.1.5.8.99.117.114.99.97.108.108.115 = INTEGER: 5 iso.3.6.1.4.1.2021.8.1.101.2.1.6.8.99.117.114.99.97.108.108.115 = INTEGER: 1 iso.3.6.1.4.1.2021.8.1.101.2.1.7.8.99.117.114.99.97.108.108.115 = INTEGER: 1 iso.3.6.1.4.1.2021.8.1.101.2.1.20.8.99.117.114.99.97.108.108.115 = INTEGER: 4 iso.3.6.1.4.1.2021.8.1.101.2.1.21.8.99.117.114.99.97.108.108.115 = INTEGER: 1 iso.3.6.1.4.1.2021.8.1.101.3.1.1.8.99.117.114.99.97.108.108.115 = STRING: "/usr/local/freeswitch/bin/fs_cli: Permission denied" iso.3.6.1.4.1.2021.8.1.101.3.1.2.8.99.117.114.99.97.108.108.115 = STRING: "/usr/local/freeswitch/bin/fs_cli: Permission denied" iso.3.6.1.4.1.2021.8.1.101.3.1.3.8.99.117.114.99.97.108.108.115 = INTEGER: 1 iso.3.6.1.4.1.2021.8.1.101.3.1.4.8.99.117.114.99.97.108.108.115 = INTEGER: 1 iso.3.6.1.4.1.2021.8.1.101.4.1.2.8.99.117.114.99.97.108.108.115.1 = STRING: "/usr/local/freeswitch/bin/fs_cli: Permission denied"
I run on Debian 6.0 with FreeSWITCH version: FreeSWITCH Version 1.2.15+git~20131210T035405Z~b1288520bc~64bit (git b128852 2013-12-10 03:54:05Z 64bit)
Any input will be appreciated.
Thank you --
participants (4)
-
Anthony McGarry
-
Deon Vermeulen
-
Ken Rice
-
Steven Ayre