Logs monitoring

This support forum board is for support questions relating to Nagios XI, our flagship commercial network monitoring solution.
Locked
gselvakumar
Posts: 96
Joined: Wed Mar 02, 2016 4:52 am

Logs monitoring

Post by gselvakumar »

Hi Team,

On the server for everyday there will be a file with name "xxxx_xxx_2016-11-08_0.log" on the lcoation /usr/logs the date changes every day in the file name but format is same, there is one file per day, the file content is written once in every 4 hours. It writes file content at 12 AM, 4AM, 8AM, 12 PM, 4 PM, 8 PM. A monitoring job need to go into the content around 3:30 AM, 730 AM, 1130AM , 330 PM, 730 PM go and check the file and see if it has any error as "maxretry, not synchronized" if this line is found please send an alert and create an email .Also if you see an error like "FCS Bad receipt" do the same as above.

For the above requirement I used check_logfiles plugin which works great for me.But my problem is that my log file name is the format of xxxx_xxx_2016-11-08_0.log so let me know how to pass the file name to the script.Please help me with this requirement
Thanks & Regards,
Gomathyshankar Selvakumar
User avatar
mcapra
Posts: 3739
Joined: Thu May 05, 2016 3:54 pm

Re: Logs monitoring

Post by mcapra »

I would suggest creating some sort of wrapper script that determines the current date and passes that off to check_logfiles. You would then use that wrapper script for your check command.

We also have Nagios Log Server available which is pretty good at collecting/analyzing/alerting on log files:
https://www.nagios.com/products/nagios-log-server/
Former Nagios employee
https://www.mcapra.com/
Locked