Log monitoring. check_file_content.pl

This support forum board is for support questions relating to Nagios XI, our flagship commercial network monitoring solution.
Locked
FrancisNagios
Posts: 58
Joined: Tue Apr 09, 2019 6:54 am

Log monitoring. check_file_content.pl

Post by FrancisNagios »

Hi,

I'm trying to monitor that if a "pattern” is not found in a "file" on a Unix server, skip a notification using the command "check_file_content.pl"

I make an example locally on the NagiosXi server successfully.
# more 33d
Uptime CRITICAL: 21 day(s) 21 hour(s) 4 minute(s) | uptime=31504.000000;5.000000;10.000000;

# ./check_file_content.pl -f /usr/local/nagios/libexec/33d -i minute -n 0
OK for /usr/local/nagios/libexec/33d (1 found)

# ./check_file_content.pl -f /usr/local/nagios/libexec/33d -i error -n 0
FAILED on /usr/local/nagios/libexec/33d


But when doing it with the tool, it gives me this error:
4.jpg

This is the definition of the command:
2.png


This is the definition of the service:
3.png

Thanks and regards
You do not have the required permissions to view the files attached to this post.
scottwilkerson
DevOps Engineer
Posts: 19396
Joined: Tue Nov 15, 2011 3:11 pm
Location: Nagios Enterprises
Contact:

Re: Log monitoring. check_file_content.pl

Post by scottwilkerson »

in the command definition change

Code: Select all

$USER1$/check_file_content 
to

Code: Select all

$USER1$/check_file_content.pl 
then restart nagios
Former Nagios employee
Creator:
Human Design Website
Get Your Human Design Chart
FrancisNagios
Posts: 58
Joined: Tue Apr 09, 2019 6:54 am

Re: Log monitoring. check_file_content.pl

Post by FrancisNagios »

Case resolved, thank you for the information and quick response

Thanks and regards
scottwilkerson
DevOps Engineer
Posts: 19396
Joined: Tue Nov 15, 2011 3:11 pm
Location: Nagios Enterprises
Contact:

Re: Log monitoring. check_file_content.pl

Post by scottwilkerson »

FrancisNagios wrote:Case resolved, thank you for the information and quick response

Thanks and regards
Great!

Locking thread
Former Nagios employee
Creator:
Human Design Website
Get Your Human Design Chart
Locked