Skip to content

new mode "output-banks" for plugin APC-ATS#6206

Open
rmorandell-pgum wants to merge 4 commits into
centreon:developfrom
i-Vertix:hardware-ats-apc-outputbank
Open

new mode "output-banks" for plugin APC-ATS#6206
rmorandell-pgum wants to merge 4 commits into
centreon:developfrom
i-Vertix:hardware-ats-apc-outputbank

Conversation

@rmorandell-pgum

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

Copy link
Copy Markdown
Contributor

Community contributors

Description

APC-ATS has output banks

image

The new mode checks the total/overall status and perf data and the single bank data.

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 ?

powernet441.mib.txt

atsOutputBankTable -> atsOutputBankEntry

image image

Here is the walk:

ats.snmpwalk.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 22, 2026 08:55
@rmorandell-pgum rmorandell-pgum requested review from sdepassio and removed request for a team May 22, 2026 08:55
}
}

if (!defined($self->{global}) && scalar(keys %{$self->{bank}}) <= 0) {

@aikido-pr-checks aikido-pr-checks Bot May 22, 2026

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

The check uses keys %{$self->{bank}} even when $self->{bank} may be undefined, which can crash instead of reaching the "No banks matching" path.

Suggested change
if (!defined($self->{global}) && scalar(keys %{$self->{bank}}) <= 0) {
if (!defined($self->{global}) && (!defined($self->{bank}) || scalar(keys %{$self->{bank}}) <= 0)) {
Details

✨ AI Reasoning
​The final emptiness check assumes two containers may both be empty, but one of them is not initialized before being dereferenced. If no per-bank entry is stored during selection and the overall entry is also missing, evaluating the hash key count on an undefined reference can fail before the intended "No banks matching" message is emitted.

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