fix screenos memory

git-svn-id: http://www.observium.org/svn/observer/trunk@2485 61d68cd4-352d-0410-923a-c4978735b2b8
This commit is contained in:
Adam Amstrong
2011-09-16 22:45:01 +00:00
parent 835978a71c
commit 9abb874732
2 changed files with 7 additions and 4 deletions

View File

@@ -271,10 +271,13 @@ STATE;
function print_percentage_bar($width, $height, $percent, $left_text, $left_colour, $left_background, $right_text, $right_colour, $right_background)
{
if($percent > "100") { $size_percent = "100"; } else { $size_percent = $percent; }
$output = '
<div style="font-size:11px;">
<div style=" width:'.$width.'px; height:'.$height.'px; background-color:#'.$right_background.';">
<div style="width:'.$percent.'%; height:'.$height.'px; background-color:#'.$left_background.'; border-right:0px white solid;"></div>
<div style="width:'.$size_percent.'%; height:'.$height.'px; background-color:#'.$left_background.'; border-right:0px white solid;"></div>
<div style="vertical-align: middle;height: '.$height.'px;margin-top:-'.($height).'px; color:#'.$left_colour .'; padding-left :4px;"><b>'.$left_text.'</b></div>
<div style="vertical-align: middle;height: '.$height.'px;margin-top:-'.($height).'px; color:#'.$right_colour.'; padding-right:4px;text-align:right;"><b>'.$right_text.'</b></div>
</div>

View File

@@ -7,8 +7,8 @@ if ($device['os'] == "screenos")
echo("ScreenOS: ");
$used = snmp_get($device, ".1.3.6.1.4.1.3224.16.2.1.0", "-OvQ");
$total = snmp_get($device, ".1.3.6.1.4.1.3224.16.2.2.0", "-OvQ");
$free = $total - $used;
$free = snmp_get($device, ".1.3.6.1.4.1.3224.16.2.2.0", "-OvQ");
$total = $free + $used;
$percent = $used / $total * 100;
@@ -17,4 +17,4 @@ if ($device['os'] == "screenos")
discover_mempool($valid_mempool, $device, 0, "screenos", "Memory", "1", NULL, NULL);
}
}
?>
?>