enh(apps::backup::veeam::local): added new options in licenses mode
The modifications aim to integrate support expiration information into the existing script and allow for monitoring and alerting based on support expiration thresholds Added a New Key for Support Expiration Time:
Added a New Key for Support Expiration Time: A new key support_expiration_time has been added to the license information in the manage_selection function. The corresponding PowerShell command Get-VBRInstalledLicense is expected to provide the value for this key, and it represents the expiration time for support.
Custom Output for Support Expiration: Custom output and threshold functions (custom_support_expires_perfdata and custom_support_expires_threshold) have been added to handle the display of the support expiration time.
Display Support Expiration in Output: The license information displayed in the output now includes the support expiration time along with other details.
Updated Comments: Comments have been added to the script to provide explanations for each block of code, particularly focusing on the new modifications related to support expiration.
Thresholds for Support Expiration: New threshold options (--warning-expire-support and --critical-expire-support) have been suggested to set alerting conditions based on the support expiration time.
Description
PLEASE MAKE SURE THAT THE BRANCH PR INCLUDES JIRA TICKET ID (for centreon-internal)
Please include a short resume of the changes and what is the purpose of PR. Any relevant information should be added to help:
- QA Team (Quality Assurance) with tests.
- reviewers to understand what are the stakes of the pull request.
Fixes # (issue)
Type of change
- [ ] Patch fixing an issue (non-breaking change)
- [ ] New functionality (non-breaking change)
- [ ] Breaking change (patch or feature) that might cause side effects breaking part of the Software
Target serie
- [ ] 22.04.x
- [ ] 22.10.x
- [ ] 23.04.x
- [ ] 23.10.x
- [ ] 24.04.x (master)
How this pull request can be tested ?
Please describe the procedure to verify that the goal of the PR is matched. Provide clear instructions so that it can be correctly tested.
Any relevant details of the configuration to perform the test should be added.
Checklist
Community contributors & Centreon team
- [ ] I have followed the coding style guidelines provided by Centreon
- [ ] I have commented my code, especially new classes, functions or any legacy code modified. (docblock)
- [ ] I have commented my code, especially hard-to-understand areas of the PR.
- [ ] I have rebased my development branch on the base branch (master, maintenance).
Hi @SavCent, Your PR does not bring any code changes, only comments. But actually those are not comments but titles or labels I don't really know but surely it doesn't "provide explanations for each block of code". Current code maintainers need to state about the "we like comments at Centreon" thing cause there are ways to do such things, and it needs to be specified in the project. Ultimately this PR removes the only useful comment which is an example of what the powershell part returns.
i changed the code
Hi @SavCent,
This is not how counters work. You can't just add a key and expect it to be used.
Moreover "support_expiration_time" does not exist as the powershell part returns expiration_time:
https://github.com/centreon/centreon-plugins/blob/0abb9253e19acdf6f571c73c29cca05897b9efd7/src/centreon/common/powershell/veeam/licenses.pm#L64
which is actually used in "expires" counter:
https://github.com/centreon/centreon-plugins/blob/0abb9253e19acdf6f571c73c29cca05897b9efd7/src/apps/backup/veeam/local/mode/licenses.pm#L269
and can be used with --warning-/critical-expires thresholds in combination with the --unit options like --unit=d --warning-expires=10: to be warned when the license will expire in less than 10 days.
So I don't see the point of that PR.