net snmp pass persist script, can not run a bash script!!
Hi all
i wanted to extend the net-snmp to monitor my server (i wrote a custom module for FreeRadius). i saw that every one is using perl, so i started learning perl. i started with a simple example (http://net-snmp.git.sourceforge.net/...s/heads/master) and modified it, i only changed the types and made a function to get the values from a bash script (using radclient). when i run the script from the command line, it works fine, i can print PING and i get PONG, get and getnext works fine. if i run snmpd in debug mode, every thing is ok too, snmpwalk works perfectly. however runing it as a service is not working, the sub function i wrote is getting stuck at running the bash script, and i can't figure what is the problem. currently i am using CentOS 6.2. here is my function: Code:
sub callRadclient { |
looking at it now, i think this would fit better in a programming forum... any one recommends a good perl related one?? did not find one here at LQ. it would be awesome if it dose:cool:
|
you try /path/to/radclient in the perl script?
bash scripts usually have exported or parsed ENV values where cron does not. |
damn that think drove me crazy for the past couple of days :banghead:... thanks Habitual, it works smoothly now after adding the "/path/to/radclient" :doh: how did i missed that :confused:
|
Glad it worked out. ;)
|
All times are GMT -5. The time now is 12:59 AM. |