Skip to content

new plugin for Stormagic SvSAN#6198

Open
rmorandell-pgum wants to merge 8 commits into
centreon:developfrom
i-Vertix:stormagic-vsan
Open

new plugin for Stormagic SvSAN#6198
rmorandell-pgum wants to merge 8 commits into
centreon:developfrom
i-Vertix:stormagic-vsan

Conversation

@rmorandell-pgum

@rmorandell-pgum rmorandell-pgum commented May 20, 2026

Copy link
Copy Markdown
Contributor

Community contributors

Description

Modes Available:

  • sensors
  • uptime

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 ?

stormagic-svsan.snmpwalk.txt
STORMAGIC-MIB.mib.txt

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.

@rmorandell-pgum rmorandell-pgum requested a review from a team as a code owner May 20, 2026 10:07
@rmorandell-pgum rmorandell-pgum requested review from lucie-tirand and removed request for a team May 20, 2026 10:07
free => $free,
capacity => $capacity,
used => $used,
prct_used => defined($capacity) && $capacity > 0 ? $free * 100 / $capacity : undef,

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

prct_used is calculated from $free and prct_free from $used, so pool usage percentages are inverted and produce wrong output/threshold behavior.

Details

✨ AI Reasoning
​The logic is computing pool usage statistics for output and thresholds. In this calculation block, the percentage assigned to used space is derived from free space, and the percentage assigned to free space is derived from used space. Since these values are later displayed and used for threshold checks under their current names, the code will systematically report inverted percentages.

🔧 How do I fix it?
Trace execution paths carefully. Ensure precondition checks happen before using values, validate ranges before checking impossible conditions, and don't check for states that the code has already ruled out.

Reply @AikidoSec feedback: [FEEDBACK] to get better review comments in the future.
Reply @AikidoSec ignore: [REASON] to ignore this issue.
More info

Comment on lines +392 to +393
prct_used => defined($size) && $size > 0 ? $free * 100 / $size : undef,
prct_free => defined($size) && $size > 0 ? $used * 100 / $size : undef,

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Cache percentages are inverted: prct_used uses $free and prct_free uses $used, causing incorrect cache usage values and alert evaluation.

Suggested change
prct_used => defined($size) && $size > 0 ? $free * 100 / $size : undef,
prct_free => defined($size) && $size > 0 ? $used * 100 / $size : undef,
prct_used => defined($size) && $size > 0 ? $used * 100 / $size : undef,
prct_free => defined($size) && $size > 0 ? $free * 100 / $size : undef,
Details

✨ AI Reasoning
​This block computes cache usage metrics. The assigned percentages are reversed relative to their variable names: the used percentage is based on free bytes and the free percentage is based on used bytes. That contradiction guarantees incorrect cache usage reporting and any checks that depend on these values will be evaluated against inverted data.

Reply @AikidoSec feedback: [FEEDBACK] to get better review comments in the future.
Reply @AikidoSec ignore: [REASON] to ignore this issue.
More info

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.

2 participants