Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update licenses.pm #4875

Open
wants to merge 2 commits into
base: develop
Choose a base branch
from
Open

Update licenses.pm #4875

wants to merge 2 commits into from

Conversation

SavCent
Copy link

@SavCent SavCent commented Feb 2, 2024

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).

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:

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.
@cgagnaire
Copy link
Contributor

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.

Hi, sorry i forgot to add the code...
@SavCent
Copy link
Author

SavCent commented Mar 18, 2024

i changed the code

@cgagnaire
Copy link
Contributor

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:

$item.expiration_time = (get-date -date $license.ExpirationDate.ToUniversalTime() -UFormat ' . "'%s'" . ')

which is actually used in "expires" counter:
if (defined($license->{expiration_time})) {

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants