Random Project

Just change the for loop in this way to get perfdata !

$ret_string=””;
$perfvalue=””;
# Getting Individual CPU Load
$i=0;
foreach ( @pourcentage ) {
s/HOST-RESOURCES-MIB::hrProcessorLoad.d+ = INTEGER://g;
$cpuuse=$_;
$ret_string .= “CPU-$i:$cpuuse%, “;
$perfvalue .= “CPU-$i=$cpuuse%;$warning;$critical;0;100 “;
$i++;
}
print $ret_string.” | “.$perfvalue.”
“;