Usamos cookies para medir audiência e melhorar sua experiência. Você pode aceitar ou recusar a qualquer momento. Veja sobre o iMasters.
estou fazendo um aplicativo PHP que mede o Armazenamento da memoria e o Uso da CPU
quando eu uso com o FF fica tudo bem assim
/applications/core/interface/imageproxy/imageproxy.php?img=http://lh5.ggpht.com/_rlXg7mYtd7M/TBEAJO23SxI/AAAAAAAAAE4/a7acw3QLnWw/firefox.jpg&key=388758f050b538c5eda92c231c4a744655df8a143a3afcf75f5628394439fd0c" alt="Imagem Postada" />
mas no IE, qualquer versao fica assim
/applications/core/interface/imageproxy/imageproxy.php?img=http://lh6.ggpht.com/_rlXg7mYtd7M/TBEAJHWkFgI/AAAAAAAAAE8/6Afujtiq9K4/IE.jpeg&key=26684c5819831062f1acdb8102631cb43eb566eee6b6c196cc5a9fc674083087" alt="Imagem Postada" />
com o codigo
/************************
//Espaço em disco
//************************
$armazenamento = FileSystems();
$armazenamento_total = 0;
$armazenamento_usado = 0;
$armazenamento_livre = 0;
$armazenamento_porcentagen_usado = 0;
$armazenamento_porcentagen_total = "100%";
$armazenamento_porcentagen_livre = 0;
$total_percent = 0; if($armazenamento[$i]['mount'] == "/"){
$armazenamento_livre += $armazenamento[$i]['free'];
$armazenamento_usado += $armazenamento[$i]['used'];
$armazenamento_total += $armazenamento[$i]['size'];
$armazenamento_porcentagen_usado += $armazenamento[$i]['percent'];
}
}
$armazenamento_porcentagen_livre = (100 - $armazenamento_porcentagen_usado);
$armazenamento_alert = 90;
$used = ($armazenamento_porcentagen_usado * $fator);
$usado = $used -2;
$nonused = $armazenamento_porcentagen_livre * $fator;
$armazenamento_porcentagen_livre .= '%';
$armazenamento_porcentagen_usado .= "%"; // $color = "redbar";
$space_bar = "<img src='images/redbar_left.gif' width='3' height='11' style='margin:$margin' align='bottom'/><img src='images/redbar_middle.gif' width='$usado' height='11' style='margin:$margin' align='bottom'/><img src='images/nobar_middle.gif' width='$nonused' height='11' style='margin:$margin' align='bottom'/><img src='images/redbar_right.gif' width='3' height='11' style='margin:$margin' align='bottom'/> $armazenamento_porcentagen_usado"; // $color = "bar";
$space_bar = "<img src='images/bar_left.gif' width='3' height='11' style='margin:$margin'/><img src='images/bar_middle.gif' width='$usado' height='11' style='margin:$margin'/><img src='images/nobar_middle.gif' width='$nonused' height='11' style='margin:$margin'/><img src='images/bar_right.gif' width='3' height='11' style='margin:$margin'/> $armazenamento_porcentagen_usado";
}
//====================================
//Uso da CPU
//====================================
$cpu_usage = shell_exec("/usr/bin/mpstat | grep all");
$cpu_usage = preg_replace('/\s+/', ' ', $cpu_usage);
$fields = preg_split('/\s/', $cpu_usage);
$nonused = round($fields[8], 0);
$used = ((100 - $nonused ) * $fator);
$usado = $used -2;
$percent = 100 - $nonused;
$nonused = $nonused * $fator;
if($percent > 95)
// $color = "redbar";
$cpu_usage = "<img src='images/redbar_left.gif' width='3' height='11' style='margin:$margin' align='bottom'/><img src='images/redbar_middle.gif' width='$usado' height='11' style='margin:$margin' align='bottom'/><img src='images/nobar_middle.gif' width='$nonused' height='11' style='margin:$margin' align='bottom'/><img src='images/redbar_right.gif' width='3' height='11' style='margin:$margin' align='bottom'/> $percent%</td></tr>";
else
// $color = "bar";
$cpu_usage = "<img src='images/bar_left.gif' width='3' height='11' style='margin:$margin'/><img src='images/bar_middle.gif' width='$usado' height='11' style='margin:$margin'/><img src='images/nobar_middle.gif' width='$nonused' height='11' style='margin:$margin'/><img src='images/bar_right.gif' width='3' height='11' style='margin:$margin'/> $percent%</td></tr>";
nao sei, mas deve ser meu html que ta de forma incompativel com o IE
alguem ai?
Carregando comentários...