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

Support forum for Nagios Core, Nagios Plugins, NCPA, NRPE, NSCA, NDOUtils and more. Engage with the community of users including those using the open source solutions.
Locked
baber
Posts: 308
Joined: Wed Oct 21, 2015 4:39 am

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

Post 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
rkennedy
Posts: 6579
Joined: Mon Oct 05, 2015 11:45 am

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

Post 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/
Former Nagios Employee
baber
Posts: 308
Joined: Wed Oct 21, 2015 4:39 am

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

Post 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
rkennedy
Posts: 6579
Joined: Mon Oct 05, 2015 11:45 am

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

Post 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/
Former Nagios Employee
baber
Posts: 308
Joined: Wed Oct 21, 2015 4:39 am

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

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

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

Post 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?
Be sure to check out our Knowledgebase for helpful articles and solutions!
baber
Posts: 308
Joined: Wed Oct 21, 2015 4:39 am

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

Post 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
User avatar
Box293
Too Basu
Posts: 5126
Joined: Sun Feb 07, 2010 10:55 pm
Location: Deniliquin, Australia
Contact:

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

Post 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).
As of May 25th, 2018, all communications with Nagios Enterprises and its employees are covered under our new Privacy Policy.
Locked