[ZBXNEXT-9414] ability to specify last day of month in scheduled interval Created: 2024 Aug 14 Updated: 2025 Jan 27 |
|
Status: | Open |
Project: | ZABBIX FEATURE REQUESTS |
Component/s: | Frontend (F), Server (S) |
Affects Version/s: | 7.0.2 |
Fix Version/s: | None |
Type: | Change Request | Priority: | Medium |
Reporter: | Gustavo Guido | Assignee: | Valdis Murzins |
Resolution: | Unresolved | Votes: | 1 |
Labels: | None | ||
Remaining Estimate: | Not Specified | ||
Time Spent: | Not Specified | ||
Original Estimate: | Not Specified |
Attachments: |
![]() |
Description |
There are some checks that need to be performed on the last day of the month, but no way to specify it in the interval. May be is possible to espedify one letter, like L, to spedify last day of month As a work arroud. it may be possible to specify 28,29,30 and 31 as day of month and discard the value if it is not the last day of the month but this will execute the item at leas 2 times every month, perhaps with some consecuences |
Comments |
Comment by Giedrius Stasiulionis [ 2025 Jan 27 ] |
You can apply javascript preprocessing and run it as needed with discarding anything but when you run on last day of the month: var today = new Date(); var lastDay = new Date(today.getFullYear(), today.getMonth() + 1, 0).getDate(); return today.getDate() === lastDay ? value : -1; If you have numeric values, now as next step discard data if <0 If it's text data, do some other evaluation. In any case, you have criteria to discard data on all other dates but last day of the month.
|
Comment by Gustavo Guido [ 2025 Jan 27 ] |
This work arround can be used but you don't avoid the colection of the data, and the colection may need a bunch of resources (executing scripts, certaiin rights etc) As far as I know yoou can return null on the java script to discard the data, avoiding the second preporcessing step. |
Comment by Giedrius Stasiulionis [ 2025 Jan 27 ] |
You are correct on both points (I was not aware of null part, now I am - thanks). For lightweight data collection items (or those that you run say once a day) it would be good enough workaround I suppose. Otherwise maybe implement this date logic already in script (or make some wrapper script) and discard when not valid. However, I support this feature request |