fix(storage::exagrid::snmp): fixed landing_used calculation to prevent negative values in server-usage mode #5863
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Community contributors
Description
In some situations exagrid reports available landing space larger than configured space. In that case the plugin returns used landing space as negative.
Type of change
How this pull request can be tested ?
nagios@********:~$ '/usr/lib/nagios/plugins/centreon_plugins.pl' '--critical-landing-usage' '90' '--filter-counters' 'landing-usage' '--hostname' '...' '--mode' 'server-usage' '--plugin' 'storage::exagrid::snmp::plugin' '--snmp-community' '****' '--snmp-version' '2' '--warning-landing-usage' '80' --debug
CRITICAL: Landing Usage Total: 31.88 TB Used: -3.58 TB (-11.24%) Free: 35.47 TB (111.24%) | 'landing_used'=-3941000000000B;0:28043200000000;0:31548600000000;0;35054000000000
.1.3.6.1.4.1.14941.4.1.1.0 = 35054
.1.3.6.1.4.1.14941.4.1.2.0 = 833000000
.1.3.6.1.4.1.14941.4.1.3.0 = 38995
.1.3.6.1.4.1.14941.4.1.4.0 = 397762437
nagios@********:~$ '/usr/lib/nagios/plugins/centreon_plugins.pl' '--critical-landing-usage' '90' '--filter-counters' 'landing-usage' '--hostname' '...' '--mode' 'server-usage' '--plugin' 'storage::exagrid::snmp::plugin' '--snmp-community' '****' '--snmp-version' '2' '--warning-landing-usage' '80' --debug
OK: Landing Usage Total: 31.88 TB Used: 0.00 B (0.00%) Free: 31.88 TB (100.00%) | 'landing_used'=0B;0:28043200000000;0:31548600000000;0;35054000000000
.1.3.6.1.4.1.14941.4.1.1.0 = 35054
.1.3.6.1.4.1.14941.4.1.2.0 = 833000000
.1.3.6.1.4.1.14941.4.1.3.0 = 38995