Quantcast
Channel: Forums - Recent Threads
Viewing all articles
Browse latest Browse all 30534

Re: How to monitor a log file in Linux

$
0
0

Hi,

I have created a bash script in conjunction with a Lua script to accomplish basic log file monitoring. The problem is that it needs to be stateful, you don't want to parse the whole file each time it's tested. You just want to check the lines that were added since the last test. You can download the scripts from dl.dropboxusercontent.com/.../ssh_logfile_search_.zip and the bash script has to be placed in a folder on your Linux machine with correct permissions for the monitoring user. I don't have much documentation for it currently but the Lua script needs three parameters; Script path (ex. /tmp/knm_logfile.sh), the path to the log file you want to monitor, and the string you are searching for.

It's far from perfected at the moment, but maybe a start for you?

Regards,


Viewing all articles
Browse latest Browse all 30534

Trending Articles