Hi all,
I am trying to configure a check for monitoring the size and age of a single file on a Windows server. I have managed to do it, by adjusting the configuration in the Checkmk Agent YAML file, under C:\Program Files (x86)\checkmk\service\check_mk.yml, under this section,
fileinfo:
enabled: yes
path: [
- 'C:\tmp\test.txt'
]
then I created the monitoring rule under WATO in Checkmk, Setup > Service monitoring rules > Size and age of single files. Everything works properly and I get the notifications I need.
Here’s the thing, the actual file I would like to monitor, rolls over every night and the date changes to the current, for example today the log file is 20220315.log and tomorrow, it will become 20220316.log. So I need a way to adjust it dynamically, based on current date.
I have used the examples for using the date variable from this link, https://docs.checkmk.com/latest/en/mk_filestats.html - $DATE:%Y%m%d$, but I think it does not work properly for Windows hosts, here’s how it looks like,
fileinfo:
enabled: yes
path: [
- 'C:\logs\$DATE:%Y%m%d$.log'
]
when running C:\Program Files (x86)\checkmk\service> .\check_mk_agent.exe test to test it out, I get the following,
C:\logs\$DATE:%Y%m%d$.log|missing|1647332814
Any thoughts on making it work?
Thank you.