mirror of
https://github.com/stylersnico/librenms.git
synced 2026-07-28 08:02:41 +02:00
use precision for processors
git-svn-id: http://www.observium.org/svn/observer/trunk@1321 61d68cd4-352d-0410-923a-c4978735b2b8
This commit is contained in:
@@ -35,7 +35,7 @@ while($mempool = mysql_fetch_array($mempool_data)) {
|
||||
### Do we need a generic mempool poller?
|
||||
}
|
||||
|
||||
$percent = round($mempool['used'] * $mempool['total'] * 100);
|
||||
$percent = round($mempool['used'] * $mempool['total'] * 100, 2);
|
||||
|
||||
echo($percent."% ");
|
||||
|
||||
@@ -52,4 +52,6 @@ while($mempool = mysql_fetch_array($mempool_data)) {
|
||||
|
||||
}
|
||||
|
||||
echo("\n");
|
||||
|
||||
?>
|
||||
|
||||
@@ -13,8 +13,6 @@ while($processor = mysql_fetch_array($proc_data)) {
|
||||
$proc = snmp_get ($device, $processor['processor_oid'], "-O Uqnv");
|
||||
}
|
||||
|
||||
|
||||
|
||||
$procrrd = $config['rrd_dir'] . "/" . $device['hostname'] . "/" . safename("processor-" . $processor['processor_type'] . "-" . $processor['processor_index'] . ".rrd");
|
||||
|
||||
if (!is_file($procrrd)) {
|
||||
@@ -30,6 +28,8 @@ while($processor = mysql_fetch_array($proc_data)) {
|
||||
$proc = trim(str_replace("\"", "", $proc));
|
||||
list($proc) = preg_split("@\ @", $proc);
|
||||
|
||||
$proc = round($proc / $processor['processor_precision'],2);
|
||||
|
||||
echo($proc . "%\n");
|
||||
|
||||
rrdtool_update($procrrd,"N:$proc");
|
||||
|
||||
Reference in New Issue
Block a user