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?