z

Commercial Support Clients: Clients with support contracts can get escalated support assistance by visiting Nagios Answer Hub. These forums are for community support services. Although we at Nagios try our best to help out on the forums here, we always give priority support to our support clients.

Nagios Core command to search for String and return output

This support forum 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

cron