Good day. Zabbix 5.2. Monitoring windows/linux through active agents or passive agents through a proxy. There is a task to keep track of the folder size. The difficulty is that me have to keep track of a different folder every day. For example, today D:\backup\2021-04-23, tomorrow D:\backup\2021-04-24, etc. I create an item and get the folder size using the key vfs.dir.size[D:\backup\2021-04-23] without any problems. But how can I replace the date with its dynamic value in the key parameter in the folder path so that today's date is substituted in the yyyy-mm-dd format?
I tried to use the {DATE} macro, which seems to be supposed to return a date in the yyyy.mm.dd format, and using the regsub function, return the date in the format I need using the following {DATE}.regsub(^\d{4}\.\d{2}\.\d{2}$, \1-\2-\3), but it does not work either in the macro format or in the key parameter vfs.dir.size[D:\backup\{{DATE}.regsub(^\d{4}\.\d{2}\.\d{2}$, \1-\2-\3)}] (although {DATE} should only work in notifications so I was initially not sure about this approach).
Of course I can use UserParameter or scripts, but I would like to avoid unnecessary actions if possible.
I tried to use the {DATE} macro, which seems to be supposed to return a date in the yyyy.mm.dd format, and using the regsub function, return the date in the format I need using the following {DATE}.regsub(^\d{4}\.\d{2}\.\d{2}$, \1-\2-\3), but it does not work either in the macro format or in the key parameter vfs.dir.size[D:\backup\{{DATE}.regsub(^\d{4}\.\d{2}\.\d{2}$, \1-\2-\3)}] (although {DATE} should only work in notifications so I was initially not sure about this approach).
Of course I can use UserParameter or scripts, but I would like to avoid unnecessary actions if possible.
These times and dates in parameters have always been a painpoint of Zabbix..
Comment