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

If statement added when $total == 0 #5141

Closed

Conversation

jouleSoft
Copy link

@jouleSoft jouleSoft commented Aug 21, 2024

Community contributors

Description

There are cases when storage-pools with totalCapacity property equal to "0". For example, Casette Tape Backup Libraries:

<Api_GetStoragePoolListResp>
    <storagePoolList numberOfNodes="1" poolRetentionPeriodDays="365" cloudStorageClassNumber="-1" isArchiveStorage="0" libraryVendorType="0" totalFreeSpace="0" storagePoolType="2" storageSubType="0" totalCapacity="0" wormStoragePoolFlag="0" storageType="4" reserved1="1" status="Online" statusCode="0">
        [... text omited ...]
    </storagePoolList>
</Api_GetStoragePoolListResp>

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 ?

Just executing the plugin against a CommServe API when StoragePools with totalCapacity property equal to "0".

Without the fix, the return string will be:

UNKNOWN: Illegal division by zero at /usr/lib/centreon/plugins//centreon_commvault_commserve_restapi.pl line 1547.

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.

@gagzou
Copy link

gagzou commented Nov 6, 2024

Hi, fix is ok for me (OK: All storage pools are ok)

@omercier
Copy link
Contributor

PR followed by #5305
Thanks for contributing to centreon-plugins 💯

@omercier omercier closed this Nov 29, 2024
omercier added a commit that referenced this pull request Nov 29, 2024
Co-authored-by: Julio Jimenez Delgado <j.jimenez.delgado@ibermatica.com>

Refs: CTOR-851
@sdouce
Copy link

sdouce commented Dec 31, 2024

Hello,
Same problem on our Commvault monitoring , tested the Fix and it works fine .
Any date for rpm updated on repo ?
Thank You .

@lucie-dubrunfaut
Copy link
Contributor

Hello @sdouce

This enhancement was added in the December release (see release note) with this PR #5305
Can you tell us if you still struggling find it on the repo?

@sdouce
Copy link

sdouce commented Jan 8, 2025

Hello @sdouce

This enhancement was added in the December release (see release note) with this PR #5305 Can you tell us if you still struggling find it on the repo?

Hi Lucie ,
On my repo i only find this package :
centreon-plugin-Applications-Commvault-Commserve-Restapi-20241107-152627.el8.noarch

This one contains /usr/lib/centreon/plugins/centreon_commvault_commserve_restapi.pl and divided by zero still there

@omercier
Copy link
Contributor

omercier commented Jan 9, 2025

Hi @sdouce can you try again after dnf clean all?

On a Alma8 server I get this:

Available Packages
Name         : centreon-plugin-Applications-Commvault-Commserve-Restapi
Version      : 20241206
Release      : 130840.el8
Architecture : noarch
Size         : 67 k
Source       : centreon-plugin-Applications-Commvault-Commserve-Restapi-20241206-130840.el8.src.rpm
Repository   : centreon-plugins-22.10-stable-noarch
Summary      : centreon-plugin-Applications-Commvault-Commserve-Restapi
URL          : https://centreon.com
License      : Apache-2.0
Description  : centreon-plugin-Applications-Commvault-Commserve-Restapi
             : Commit: a7f30fd48a2433203139e9f15d54d93259a43e29

@sdouce
Copy link

sdouce commented Jan 9, 2025

Ok with the centreon standard repo.
Problem is on our nexus (proxy) configuration .

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

Successfully merging this pull request may close these issues.

5 participants