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