Announcement

Collapse
No announcement yet.

check_centreon_snmp_remote_storage bug

Collapse
X
  • Filter
  • Time
  • Show
Clear All
new posts

  • check_centreon_snmp_remote_storage bug

    Hi all,

    Just to inform that /usr/lib/nagios/plugins/check_centreon_snmp_remote_storage doesn't support volumes bigger than 4TB.
    The bytes value cannot be stored in an integer and provides wrong (negative) results.

    That would be great is the script could be fixed so we don't have to fix it manually after each upgrade :-)

    here is the fix:
    /usr/lib/nagios/plugins/check_centreon_snmp_remote_storage
    ~line 351:

    replaces this
    ##############################
    $tot = 1;
    $tot = $Size * $AllocationUnits;
    if (!$tot){$tot = 1;}
    $used = $Used * $AllocationUnits;
    $pourcent = ($used * 100) / $tot;
    ##############################

    by this
    ##############################
    $tot = 1;
    # begin modification
    if ($Size < 0){$Size += 2**32;}
    if ($Used < 0){$Used += 2**32;}
    # end modification

    $tot = $Size * $AllocationUnits;
    if (!$tot){$tot = 1;}
    $used = $Used * $AllocationUnits;
    $pourcent = ($used * 100) / $tot;
    ##############################

    then it works great.

    source: http://sysadminconcombre.blogspot.fr...e-returns.html

    Thank you.
    Regards,
Working...
X