Check-logs

This support forum board is for support questions relating to Nagios XI, our flagship commercial network monitoring solution.
Locked
bashar.abed
Posts: 153
Joined: Tue Oct 11, 2016 1:34 am
Location: Ramallah West Bank Palestine
Contact:

Check-logs

Post 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
dwhitfield
Former Nagios Staff
Posts: 4583
Joined: Wed Sep 21, 2016 10:29 am
Location: NoLo, Minneapolis, MN
Contact:

Re: Check-logs

Post 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
bashar.abed
Posts: 153
Joined: Tue Oct 11, 2016 1:34 am
Location: Ramallah West Bank Palestine
Contact:

Re: Check-logs

Post 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
dwhitfield
Former Nagios Staff
Posts: 4583
Joined: Wed Sep 21, 2016 10:29 am
Location: NoLo, Minneapolis, MN
Contact:

Re: Check-logs

Post 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...
bashar.abed
Posts: 153
Joined: Tue Oct 11, 2016 1:34 am
Location: Ramallah West Bank Palestine
Contact:

Re: Check-logs

Post 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
User avatar
tgriep
Madmin
Posts: 9190
Joined: Thu Oct 30, 2014 9:02 am

Re: Check-logs

Post by tgriep »

Take a look at this plugin and see if it would meet your needs.
https://github.com/tdbabas/nagios-plugin-file-age
Be sure to check out our Knowledgebase for helpful articles and solutions!
Locked