Server Fault is a question and answer site for system and network administrators. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

I'd like to know how/if it is possible to get my linux (ubuntu) box to exec a command (script) on incoming icmp/ping (or other network events) requests?

Like e.g. playing a "ping" sound when being pinged, or playing an alert sound on specific source IP match.

share|improve this question
up vote 1 down vote accepted

I suspect that to do this with a dedicated program (that intercepts IP packets) would be a fairly heavyweight bit of programming. If this is just a casual thing then judicious use of logging with iptables or tcpdump along with tail to watch the log and a simple shell script or scripts would do the job.

share|improve this answer
thanks, i'll try that. – nonchip Jun 6 '11 at 12:18

Your Answer


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.