Want to check file under /tmp directory on AIX server

This support forum board is for support questions relating to Nagios XI, our flagship commercial network monitoring solution.
Locked
wiproltdwiv
Posts: 281
Joined: Sat Sep 08, 2012 12:52 am

Want to check file under /tmp directory on AIX server

Post by wiproltdwiv »

HI all ,

I want to check file under /tmp directory on AIX server through nagiosXI.

Please check Functionality of Checking the existence of file (For Eg : /tmp/hwerror.txt ) in AIX Server.

If any hardware issue file created nagios should send alerts. So please provide suitable plugin for this.
jdalrymple
Skynet Drone
Posts: 2620
Joined: Wed Feb 11, 2015 1:56 pm

Re: Want to check file under /tmp directory on AIX server

Post by jdalrymple »

check_file_age should work for you. If you don't care to actually check the file age just put in numbers for -w and -c that are large enough to never cause an error. If the file doesn't exist you will get CRITICAL. If you want to negate it - do so:

Code: Select all

[jdalrymple@localhost libexec]$ ./check_file_age -w 80000000000000000000000000 -c 80000000000000000000000000000000 -f check_nrpe1
FILE_AGE CRITICAL: File not found - check_nrpe1
[jdalrymple@localhost libexec]$ ./check_file_age -w 80000000000000000000000000 -c 80000000000000000000000000000000 -f check_nrpe
FILE_AGE OK: check_nrpe is 5486963 seconds old and 76801 bytes
[jdalrymple@localhost libexec]$ ./negate ./check_file_age -w 80000000000000000000000000 -c 80000000000000000000000000000000 -f check_nrpe1
FILE_AGE CRITICAL: File not found - check_nrpe1
[jdalrymple@localhost libexec]$ echo $?
0
[jdalrymple@localhost libexec]$ ./negate ./check_file_age -w 80000000000000000000000000 -c 80000000000000000000000000000000 -f check_nrpe
FILE_AGE OK: check_nrpe is 5487046 seconds old and 76801 bytes
[jdalrymple@localhost libexec]$ echo $?
2
Locked