Re: IPtables Email Alerting

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On 09:18 15 Mar 2004, Real Cucumber <monkcucumber@xxxxxxxxx> wrote:
| Does anyone know if there is a way to have email alerts sent for when certain IPtables triggered events occur?
| I know it is possible to use -j LOG to log such events, hoping there is a -j MAIL option?

You'd need to just use "LOG" and do something like this:

	tail -f /var/log/messages \
	| while read line
	  do
	    if echo "$line" | grep -s 'the line you want'
	    then
		echo "$line" | mail ....... # dispatch email here
	    fi
	  done

The while/read stuff if to avoid stdio buffering latency.

Cheers,
-- 
Cameron Simpson <cs@xxxxxxxxxx> DoD#743
http://www.cskk.ezoshosting.com/cs/

There is no justification for taking away individuals' freedom in the guise
of public safety.       - Thomas Jefferson


-- 
redhat-list mailing list
unsubscribe mailto:redhat-list-request@xxxxxxxxxx?subject=unsubscribe
https://www.redhat.com/mailman/listinfo/redhat-list

[Index of Archives]     [CentOS]     [Kernel Development]     [PAM]     [Fedora Users]     [Red Hat Development]     [Big List of Linux Books]     [Linux Admin]     [Gimp]     [Asterisk PBX]     [Yosemite News]     [Red Hat Crash Utility]


  Powered by Linux