1

I would like to check the size of a log file created day earlier. In nrpe.cfg I have tried to achieve this through command:

command[example_command] =/usr/lib64/nagis/plugins/check_file_age -w 172800 -c 172800 -W 250 -C 250 -f /path/to/file/$(date +%F -d "yesterday")-data1.log

When I try to run this check from my nagios server, I receive a response that FILE_AGE CRITICAL: File not found - /backup/esxbackup/log/backup/2018-05-06-data1.log$ which makes sense: there really is no $ symbol at the end of the filename I am checking.

How have I achieved this? Is there a way to get rid of the $ symbol?

GoodDog
  • 33
  • 4

1 Answers1

1

Try the good old

command[example_command] =/usr/lib64/nagis/plugins/check_file_age -w 172800 -c 172800 -W 250 -C 250 -f /path/to/file/`date +%F -d "yesterday"`-data1.log

I had the same issue some months ago, seems NRPE is still old school.

SBO
  • 544
  • 1
  • 5
  • 12