Take the 2-minute tour ×
Server Fault is a question and answer site for professional system and network administrators. It's 100% free, no registration required.

I am trying to exec command to perform checks through snmp.

I am on Debian 6.0

Here is my snmpd.conf file

rwcommunity public 172.23.129.0/29
syslocation "Blah
syscontact admin@domain.net
sysname belleville.domain.net
sysdescr "Syslog Domain Server"

disk /

load 5 10 10

#exec 1.3.6.1.4.1.2021.8 /usr/bin/python /usr/local/domain/tools/check-syslog.py
exec 1.3.6.1.4.1.2021.8 /usr/bin/python /tmp/check-syslog.py

Here is the output of snmpget:

snmpget -Of -cpublic -v1 belleville 1.3.6.1.4.1.2021.8.1.101.1
.iso.3.6.1.4.1.2021.8.1.101.1 = STRING: "/usr/bin/python: can't open file '/tmp/check-syslog.py': [Errno 13] Permission denied"

I don't understand the permission issue, as the rights on the file are 711 and owner root:root, located in /tmp folder. Anyway, this script is executed by root user, isn't it? So 700 should be enough anyway? This makes me think that this does not look like a permission trouble, even with this error message.

I hope someone has ever met this issue, and would be able to give me some advice :/

Thanks a lot for any piece of advice :)

share|improve this question
add comment

2 Answers 2

snmpd might run with a different accout than root as well.

Check out by executing a test-script that executes "id".

share|improve this answer
    
When I change the rights from 711 to 771, I still get the same problem. I have to change the rights to 777 to have an other output: –  philippe Jul 19 '11 at 16:06
    
Sounds as if I am right. So what is the output of "id" after you did your 777? –  Nils Jul 19 '11 at 19:58
add comment

You've said that the script is located in /tmp; is your /tmp partition mounted noexec by any chance? That can be an occasional source of confusion.

share|improve this answer
    
Hi, Thx for you answer, but there is nothing like that in my /tmp dir –  philippe Jul 19 '11 at 15:41
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.