I'm consulting for a small ISP that uses sendmail. We are being hammered by spammers, so I felt a perl solutions would be more than sufficient. What I'm attempting to do is monitor /var/log/messages for the hoards of "User unknown" messages resulting from name-list spam techniques. The messages log contains the pid of the sendmail process in question. I can then run a ps aux, match up the pid, and get the IP of the spammer, so that I can then add it to my firewall's block list.
This sounds like a fairly simple job for
perl, however I am running into extreme difficulty
splitting the ps aux into a usable format. Proc::ProcessTable is incredibly poorly documented, so
it has been of little aid to this point. Here is a sample
of a line from ps aux that I would need to extract the
IP address from:
root 27979 0.0 0.7 1468 1008 ? S 14:59 0:00 sendmail: s +erver foo.bar.org [222.22.22.21] cmd read
Any suggestions for handling the ps aux and extracting the IP would be greatly appreciated!
-Jerry http://www.digilliance.net
In reply to ps aux and perl by Jerry
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |