IPtables Email Alerting
Cameron Simpson
cs at zip.com.au
Tue Mar 16 00:10:40 UTC 2004
On 09:18 15 Mar 2004, Real Cucumber <monkcucumber at yahoo.com> 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 at zip.com.au> 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
More information about the redhat-list
mailing list