Page 1 of 1

Want to check file under /tmp directory on AIX server

Posted: Fri Jun 26, 2015 8:27 am
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.

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

Posted: Fri Jun 26, 2015 9:13 am
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