vendredi 10 février 2012

check_centreon_remote_storage returns negative value for a disk

You monitor a disk with a capacity of several terra bytes.

The values ​​returned by the plugin check_centreon_remote_storage are negative.

You can fix this by editing the plugin check_centreon_remote_storage.

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

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

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

And everything will be OK!

Aucun commentaire:

Enregistrer un commentaire