Page 1 of 1
Check-logs
Posted: Wed May 17, 2017 2:03 am
by bashar.abed
Hi,
we have Nagios XI Version 5.4.2 VM ,we have Linux server and we need to check if written in specific logs files,
we have already installed NRPE agent on these servers
Thanks
Re: Check-logs
Posted: Wed May 17, 2017 9:40 am
by dwhitfield
I don't understand your question. Are you saying you want Nagios to monitor remote log files? Nagios Log Server might be the way to go if you want to monitor logs:
https://www.nagios.com/news/2016/01/7181/
There's a wizard in XI to talk to Nagios Log Server.
You might also want to take a look at
https://exchange.nagios.org//directory/ ... /Log-Files
Re: Check-logs
Posted: Thu May 18, 2017 4:25 am
by bashar.abed
Hi,
currently we have Nagios Log server but i will try to test it ,currently we need to check if there is a real written remotely log file or may be check if the size of the log file changed ,
note remote server which as a log file already has NRPE agent
Thanks
Re: Check-logs
Posted: Thu May 18, 2017 10:13 am
by dwhitfield
bashar.abed wrote: we need to check if there is a real written remotely log file
I'm not sure what this means. It may hold the key to getting you the answer you want. If you just want to see that a log file is present, we can certainly do that.
Based on the rest of the post, I don't think this is going to be a super easy thing to do. The problem is you need to store the old info somewhere.
This quote is from 2011:
Well keeping track of file size would required you to keep a record of what each file you checked was, which would be cumbersome. You could do it if you wanted to however by (start developer speak) creating some sort of database (could be MySQL, could be a simple flat file) stores as CSV [filepath], [filesize] and then your check go through the database looking for the path and if it didn't find one, create a new entry and start keeping track. If it did find one then it would compare the file size to what it is now and return whatever value you wanted based on the delta.
In discussing this in the office, this was also said:
still holds true though I think. I was thinking the same thing - check the file size, update a flat file/database with the filename/size, use those as input for the next check, etc...
Re: Check-logs
Posted: Sun May 21, 2017 8:43 am
by bashar.abed
Hi,
we need to check by notification dates of the log files , that will give us good indication if written in the log file ,
so please what is the best nagios plugin that i can used for that
Thanks
Re: Check-logs
Posted: Mon May 22, 2017 12:46 pm
by tgriep
Take a look at this plugin and see if it would meet your needs.
https://github.com/tdbabas/nagios-plugin-file-age