We've moved to a new support system!

The Nagios Answer Hub is a place where you can get help with technical questions from our experts. There, you can quickly open tickets and join discussion boards.

Request Nagios Answer Hub access here: https://info.nagios.com/answer-hub-access-new-users

After completing the access form, you will be given access to a portal where new tickets can be created. We will keep the old customer forum sections and ticket system available for current cases to be resolved.

Go to the Answer Hub

Nagios Core command to search for String and return output

This board is for questions relating to Nagios Fusion.

Nagios Core command to search for String and return output

Postby apteancloud » Tue Mar 15, 2022 3:03 pm

Hi Team,

We have a requirement on one of our unix machines to Monitor Text/log files for specific content in the file and give output.

Basically, we will get an output file(consisting of String values Green, Orange, and Red) from one of the job scripts in .txt format and we have planned to monitor the file based on it, such that
Green = Ok
Orange = Warning
Red = Critical

Could you guys please suggest which plugin suits the above requirement on UNIX machines with nrpe/ncpa agent :)

Thanks in Advance
apteancloud
 
Posts: 47
Joined: Wed Sep 09, 2020 4:05 am

Re: Nagios Core command to search for String and return outp

Postby pbroste » Wed Mar 23, 2022 1:24 pm

Hello @apteancloud

Thanks for reaching out, check_log will watch file and query for keyword.

/usr/local/nagios/libexec/check_log --help
check_log v2.3.3 (nagios-plugins 2.3.3)
The nagios plugins come with ABSOLUTELY NO WARRANTY. You may redistribute
copies of the plugins under the terms of the GNU General Public License.
For more information about these matters, see the file named COPYING.

Usage: check_log -F logfile -O oldlog -q query
Usage: check_log --help
Usage: check_log --version
Additional parameter:
-w (--max_warning) If used, determines the maximum matching value to return as warning, when finding more matching lines than this parameter will return as critical. If not used, will consider as default 0 (any matching will consider as critical)
Usage: check_log -F logfile -O oldlog -q query -w <number>


Thanks,
Perry
User avatar
pbroste
 
Posts: 1281
Joined: Tue Jun 01, 2021 1:27 pm


Return to Nagios Fusion

Who is online

Users browsing this forum: No registered users and 1 guest