Page 1 of 1

monitoring a text file in the NASstrorage

Posted: Fri Dec 15, 2017 4:24 pm
by naranant
Hi,

I have a requirement to monitor a text file saved in the NAS storage. Look for Error text: ERROR in the log file and generate alert. Can you suggest ways for monitoring this file?

As this is NAS storage i can't install the Nagios agent on that.

We have Nagios XI in our environment.

Re: monitoring a text file in the NASstrorage

Posted: Sun Dec 17, 2017 11:02 pm
by tacolover101
i think an agent would be required, unless you could get fancy with SNMP.

regardless if you use an agent or not, you're going to need a script or something to parse the log file.

another angle, is using a log collector for this - https://www.nagios.com/products/nagios-log-server/ - most NAS's support sending syslog by default.

Re: monitoring a text file in the NASstrorage

Posted: Mon Dec 18, 2017 11:14 am
by kyang
Thanks for the help @tacolover101!

naranant, he's right. To me, an agent would make it less complicated.

Have you searched for any script on the Nagios Exchange?
https://exchange.nagios.org/

+1 for Nagios Log Server to collect logs from the NAS and send those alerts to XI.

Re: monitoring a text file in the NASstrorage

Posted: Mon Dec 18, 2017 11:59 am
by mcapra
Alternatively, if the NAS is accessible from the Nagios XI machine (as a samba share, SFTP/FTP pipe, etc), something like check_log3 could be used to read the file from a local Linux mount.
  • Mount the NAS on the Nagios XI machine
  • Point check_log3 at the file you want to examine
The first problem to solve would be how you can access the file from the Nagios XI machine. The searching is trivial and can be done with basic Linux and Bash stuff.

Re: monitoring a text file in the NASstrorage

Posted: Mon Dec 18, 2017 2:14 pm
by kyang
Thanks for the help @mcapra!

naranant, let us know if you have any more questions.

Re: monitoring a text file in the NASstrorage

Posted: Tue Dec 19, 2017 3:13 pm
by naranant
Thank you everyone i will try these option and will keep you posted.

Re: monitoring a text file in the NASstrorage

Posted: Tue Dec 19, 2017 3:27 pm
by kyang
Sounds good.

Let us know if you have any more questions.