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.

My server is running CentOS 6. I have a Sprint Broadband device connected as ppp0. This connection has a tendency to need restarted, so I'm trying to monitor it with Nagios (this is used for other monitoring of my network already). I have a nagios script written that tries to ping out over this interface using this command:

enter ping -c 1 -I ppp0 google.com | grep ttl

Running this as the root user works fine, and give me the the response of a single ping reply, or nothing if the connection is dead. However, if I run this same command as the user "nagios", I get the following error:

Warning: cannot bind to specified iface, falling back: Operation not permitted

The ping falls back to my eth0 interface for the ping.

It seems that the interface's permissions won't allow the nagios user to use it. I'm not sure what to change to allow this user to ping over this interface. Any suggestions? Thanks

share|improve this question

1 Answer 1

Since ping needs to write raw packets, it needs root access. Normally ping would have the setuid bit set in order to accomplish this. If you check the permission of ping with, for example: stat -c %a $(which ping). Most systems would return 4775. The leading 4 is the setuid bit, which says that when running this program it runs under the uid of the user owning the file. If this is instead returning 755. You could add the setuid bit by running chmod u+s $(which ping)

share|improve this answer
    
I looked into this and the ping command returned 4755. I tried setting it to 4775, but that didn't change anything. Thanks though. –  dw.emplod Jul 10 '12 at 16:16

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.