Vergo
New Around Here
this might actually be better answered by @Vergo
as far as I can tell the date format we're using is: MonthFormat "%Y-%m (%d)"
so I guess its simply pulling the date for the month, rather than referring to MonthRotate
Sorry for not noticing this earlier as that ping didn't result in an email notification for some reason.
In the sqlite database, "date" in the "month" table really contains only the month as information. It's being constructed with "strftime('%%Y-%%m-01', %s%s)" or "strftime('%%Y-%%m-01', datetime(%s, '-%d days')%s)" if MonthRotate isn't 1 resulting in the MonthRotate information not being included in that field at all. That's why MonthFormat "%Y-%m (%d)" doesn't work. That's actually the first time I see MonthRotate being injected to the monthly report like that... and looking at the image it produces, there's some column misalignment being created as a side effect.
I'm aware that it would be nice to have the MonthRotate information directly visible in the reports. There's for example this issue https://github.com/vergoh/vnstat/issues/72 still open for pretty much the same matter. It however does mention also a workaround that may fit your case: have a script which reads the MonthRotate value and if it's something else than 1 then reformat MonthFormat in the configuration file to "%Y-%m-N" where N is the value directly. As both "vnstat" and "vnstati" read the configuration file on every run, there's no need to restart the daemon on change as it doesn't care about that configuration entry.
I'm open to suggestions if you have ideas how the outputs should be formatted to better display a non-default MonthRotate configuration.