Page 1 of 1

how can read and find phrase in log file and show in nagios

Posted: Tue Jul 19, 2016 3:52 am
by baber
Dear all
Hi

i have an application on my linux that it has a log file sometimes my application not work correctly (such as can not login or web can not open) and all of these record on log file now how can i say in nagios for example if find this phrase "Exception 242-Er52" in log file show on nagios critical error and say can not login server is down


best regards

Re: how can read and find phrase in log file and show in nag

Posted: Tue Jul 19, 2016 9:24 am
by rkennedy
I believe this is more of a job for Nagios Log Server, which is free for up to 500MB of data / day. Take a look here - https://www.nagios.com/products/nagios-log-server/

Re: how can read and find phrase in log file and show in nag

Posted: Tue Jul 19, 2016 10:44 pm
by baber
rkennedy wrote:I believe this is more of a job for Nagios Log Server, which is free for up to 500MB of data / day. Take a look here - https://www.nagios.com/products/nagios-log-server/
Thanks but i think you did not understand correctly my answer i am using nagios core free that is all features command
Now i just want nagios can read my application service log and if see a specific phrase in log show my service is down i dont think nagios core free edition need specific plugin for this

Please help me

Re: how can read and find phrase in log file and show in nag

Posted: Wed Jul 20, 2016 10:13 am
by rkennedy
I understand you are using Core, and if you're looking to monitor logs, I generally recommend Nagios Log Server. It's whole job is to analyze, collect, and allow you to do exactly what you're looking for. It is also free to use for up to 500MB of logs per day.

The one plugin that comes to mind is https://exchange.nagios.org/directory/P ... es/details - you can find a bit of documentation here https://labs.consol.de/nagios/check_logfiles/

Re: how can read and find phrase in log file and show in nag

Posted: Wed Jul 20, 2016 3:58 pm
by baber
rkennedy wrote:I understand you are using Core, and if you're looking to monitor logs, I generally recommend Nagios Log Server. It's whole job is to analyze, collect, and allow you to do exactly what you're looking for. It is also free to use for up to 500MB of logs per day.

The one plugin that comes to mind is https://exchange.nagios.org/directory/P ... es/details - you can find a bit of documentation here https://labs.consol.de/nagios/check_logfiles/

Thanks but i want know can write a script that find in log file and if see 11111 show warning in nagios and if ssdddd show critical fail serviced can do this without specific plugin

Re: how can read and find phrase in log file and show in nag

Posted: Wed Jul 20, 2016 4:17 pm
by tgriep
Have you searched out exchange site for a plugin that can do what you need?
https://exchange.nagios.org/

We also need to know what the system is that has the log file, the format of the logfile and can the Nagios system access that remote system?

Re: how can read and find phrase in log file and show in nag

Posted: Sat Jul 23, 2016 7:56 am
by baber
thanks

but i don't want use extra plugins so that i know we can do this directly with nagios i want just see in a file if see an error appear in nagios monitoring warning and if see fail show on monitoring critical

i just want this i want my self write script but just i don't know how can call that script wrote

best regards

Re: how can read and find phrase in log file and show in nag

Posted: Sun Jul 24, 2016 11:08 pm
by Box293
You'll need to install a client like NRPE on the server with the log file.

https://support.nagios.com/kb/article.php?id=515

Once you've done this, in the nrpe.cfg file you can create a new command definition. Have a look at the bottom of the file for some examples.

You'll also need to install the check_nrpe plugin on your Nagios server (info in the link above).