I'm searching for script that can tail and the check the log for certain words(like a filter).
I saw alot of check log files script but they will check the whole log. I only need to check the last entry in the log file.
This needs to be for a linux machine and also need to work with nrpe for remote check.
Is there an script to check log files?
Re: Is there an script to check log files?
Hi ruffsense,
This plugin is good:
Good luck!
Kind Regards,
Gary Shergill
This plugin is good:
It stores the location of the last search, so continues on from there (i.e. won't keep searching the whole log file).
Good luck!
Kind Regards,
Gary Shergill
-
scottwilkerson
- DevOps Engineer
- Posts: 19396
- Joined: Tue Nov 15, 2011 3:11 pm
- Location: Nagios Enterprises
- Contact:
Re: Is there an script to check log files?
One this to note with this plugin, if you test it as root from the command line before deploying to nagios, make sure the nagios user has permissions to read/write the seek file.
Re: Is there an script to check log files?
Not working for me...
Plug-in error: time out after 15 seconds
Plug-in error: time out after 15 seconds
-
slansing
- Posts: 7698
- Joined: Mon Apr 23, 2012 4:28 pm
- Location: Travelling through time and space...
Re: Is there an script to check log files?
Can you show us the format of the command you were running, as if running it from the command line? Were you running the plugin locally, or to a remote system?..
Re: Is there an script to check log files?
slansing wrote:Can you show us the format of the command you were running, as if running it from the command line? Were you running the plugin locally, or to a remote system?..
check_log3.pl -l /var/log/audit.log -s /tmp/audit.seek -p 'errors' -w 0 -c 1
Re: Is there an script to check log files?
How big is the log?
Former Nagios employee
"It is turtles. All. The. Way. Down. . . .and maybe an elephant or two."
VI VI VI - The editor of the Beast!
Come to the Dark Side.
"It is turtles. All. The. Way. Down. . . .and maybe an elephant or two."
VI VI VI - The editor of the Beast!
Come to the Dark Side.
Re: Is there an script to check log files?
46870862387 May 24 11:50 rtfenqueue.logabrist wrote:How big is the log?
It is really big.
Re: Is there an script to check log files?
You should run the script locally from the remote host's cli. Time it. You will need to make sure the timeout on the check is a bit longer than the average length of time it takes for the script to run. Or run the script passively and then report the result back to the Nagios server.
Former Nagios employee
"It is turtles. All. The. Way. Down. . . .and maybe an elephant or two."
VI VI VI - The editor of the Beast!
Come to the Dark Side.
"It is turtles. All. The. Way. Down. . . .and maybe an elephant or two."
VI VI VI - The editor of the Beast!
Come to the Dark Side.