draenor
April 10th, 2006, 03:34 PM
Hi,
I want to either make or preferably find (I'm guessing someone else already thought of this) a program/script to constatly read from a log (just like root-tail) and display it's result whenever the text matches a certain string.
Example
I want to 'listen to' /var/log/auth.log and whenever the mask IP shows up in a line, have the program/script warn me. This way I can keep track of whenever someone is trying to SSH into my server.
I'm hoping there's already a program that does this, but I've been unable to find one, but if there's not, what are the main sugestiones of the layout to my program ? I've not written 100 bash scripts, and I don't know perl/ruby, but I've got some c experience.
I'm thinking of perhaps having a script run by crond which tails the log every few seconds or so and the has some kind of sctring-recognising mechanism, does this sound like a good idea ? It sounds like a bash-script to me, but let me know of your opinion.
Thanks in advance.
I want to either make or preferably find (I'm guessing someone else already thought of this) a program/script to constatly read from a log (just like root-tail) and display it's result whenever the text matches a certain string.
Example
I want to 'listen to' /var/log/auth.log and whenever the mask IP shows up in a line, have the program/script warn me. This way I can keep track of whenever someone is trying to SSH into my server.
I'm hoping there's already a program that does this, but I've been unable to find one, but if there's not, what are the main sugestiones of the layout to my program ? I've not written 100 bash scripts, and I don't know perl/ruby, but I've got some c experience.
I'm thinking of perhaps having a script run by crond which tails the log every few seconds or so and the has some kind of sctring-recognising mechanism, does this sound like a good idea ? It sounds like a bash-script to me, but let me know of your opinion.
Thanks in advance.