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

fix(cisco-standard): mode configuration wrong calculation #5282

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

Conversation

garnier-quentin
Copy link
Contributor

@garnier-quentin garnier-quentin commented Nov 8, 2024

Community contributors

Description

It fixed following issue: #4908

CTOR-1081

Type of change

  • Patch fixing an issue (non-breaking change)
  • New functionality (non-breaking change)
  • Functionality enhancement or optimization (non-breaking change)
  • Breaking change (patch or feature) that might cause side effects breaking part of the Software

How this pull request can be tested ?

You can test it with following snmpwalk:

.1.3.6.1.2.1.1.3.0 = 1060544307
.1.3.6.1.4.1.9.9.43.1.1.1.0 = 1002827633
.1.3.6.1.4.1.9.9.43.1.1.2.0 = 1056874323
.1.3.6.1.4.1.9.9.43.1.1.3.0 = 1002832370

Checklist

  • I have followed the coding style guidelines provided by Centreon
  • I have commented my code, especially hard-to-understand areas of the PR.
  • I have rebased my development branch on the base branch (develop).
  • I have provide data or shown output displaying the result of this code in the plugin area concerned.

Copy link
Contributor

@omercier omercier left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hi Quentin !

closure_custom_perfdata => $self->can('custom_status_perfdata'),
closure_custom_threshold_check => \&catalog_status_threshold,
perfdatas => [
{ template => '%s', min => 0 }
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
{ template => '%s', min => 0 }
{ template => '%s', min => 0, unit => 's' }

You can use the following variables: %{running_last_changed}, %{running_last_saved}, %{startup_last_changed}

=item B<--critical-status>
=item B<--warning-*> B<--critical-*>
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
=item B<--warning-*> B<--critical-*>
=item B<--warning-config-running-ahead>
Thresholds.
=item B<--critical-config-running-ahead>

Define the conditions to match for the status to be CRITICAL (default: '%{running_last_changed} > %{running_last_saved}').
You can use the following variables: %{running_last_changed}, %{running_last_saved}, %{startup_last_changed}
Thresholds.
Can be: 'config-running-ahead'.
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
Can be: 'config-running-ahead'.

Comment on lines +91 to +93
my $ccmHistoryRunningLastChanged = $ctime - $uptime + ($results->{$oid_ccmHistoryRunningLastChanged} / 100);
my $ccmHistoryRunningLastSaved = $ctime - $uptime + ($results->{$oid_ccmHistoryRunningLastSaved} / 100);
my $ccmHistoryStartupLastChanged = $ctime - $uptime + ($results->{$oid_ccmHistoryStartupLastChanged} / 100);
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
my $ccmHistoryRunningLastChanged = $ctime - $uptime + ($results->{$oid_ccmHistoryRunningLastChanged} / 100);
my $ccmHistoryRunningLastSaved = $ctime - $uptime + ($results->{$oid_ccmHistoryRunningLastSaved} / 100);
my $ccmHistoryStartupLastChanged = $ctime - $uptime + ($results->{$oid_ccmHistoryStartupLastChanged} / 100);
my $start_time = $ctime - $uptime;
my $ccmHistoryRunningLastChanged = $start_time + ($results->{$oid_ccmHistoryRunningLastChanged} / 100);
my $ccmHistoryRunningLastSaved = $start_time + ($results->{$oid_ccmHistoryRunningLastSaved} / 100);
my $ccmHistoryStartupLastChanged = $start_time + ($results->{$oid_ccmHistoryStartupLastChanged} / 100);

Comment on lines +111 to +112
my $runningUnchangedDuration = time() - $ccmHistoryRunningLastChanged;
my $startupUnchangedDuration = time() - $ccmHistoryStartupLastChanged;
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
my $runningUnchangedDuration = time() - $ccmHistoryRunningLastChanged;
my $startupUnchangedDuration = time() - $ccmHistoryStartupLastChanged;
my $runningUnchangedDuration = $ctime - $ccmHistoryRunningLastChanged;
my $startupUnchangedDuration = $ctime - $ccmHistoryStartupLastChanged;

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

Successfully merging this pull request may close these issues.

2 participants