diff --git a/plugins/admin/systems/class_terminalInfo.inc b/plugins/admin/systems/class_terminalInfo.inc
index 4b41bfbfdfd8603d1f49b7255881e2f0c0a5ca13..e41f7295b4f57c3f90392807f025460c4804d726 100644 (file)
function execute()
{
+ /* Call parent execute */
+ plugin::execute();
+
/* Do we represent a valid terminal? */
if (!$this->is_account && $this->parent == NULL){
echo "<img alt=\"\" src=\"images/stop.png\" align=middle> <b>".
$smarty= get_smarty();
$display= "";
+ $smarty->assign("staticAddress", "");
+
+
+ /* Prevent undefined variable .... */
+ $smarty->assign("load", progressbar(0,100,15,true));
+ $smarty->assign("mem", progressbar(0,100,15,true));
+ $smarty->assign("swap", progressbar(0,100,15,true));
+
/* Check if terminal is online */
$query= "fping -q -r 1 -t 500 ".$this->cn;
exec ($query, $dummy, $retval);
$MemTotal= @snmpget($host, $community, "UCD-SNMP-MIB::memory.memTotalReal.0");
$MemTotal= preg_replace('/^.*[=:] ([0-9.]+)$/', '\\1', $MemTotal);
if ($MemTotal != 0){
- $smarty->assign("mem", (int)(($MemTotal - $MemFree)*100/$MemTotal));
+ $smarty->assign("mem",progressbar( (int)(($MemTotal - $MemFree)*100/$MemTotal),100,15,true));
+ ;
}
$SwapFree= @snmpget($host, $community, "UCD-SNMP-MIB::memory.memAvailSwap.0");
$SwapFree= preg_replace('/^.*[=:] ([0-9.]+)$/', '\\1', $SwapFree);
$SwapTotal= preg_replace('/^.*[=:] ([0-9.]+)$/', '\\1', $SwapTotal);
if ($SwapTotal != 0){
#$smarty->assign("swap", (int)(($SwapTotal - $SwapFree)*100/$SwapTotal));
- $smarty->assign("swap", 0);
+ $smarty->assign("swap", progressbar(0,100,15,true));
}
/* Get system uptime */
/* Get system load */
$sysload= @snmpget($host, $community, "UCD-SNMP-MIB::laLoad.2");
$sysload= preg_replace('/^.*[=:] ([0-9.]+)$/', '\\1', $sysload);
- $smarty->assign("load", $sysload*100);
+
+ $smarty->assign("load", progressbar($sysload*100,100,15,true));
/* Get status for key processes */
$processes= @snmpwalk($host, $community, "UCD-SNMP-MIB::prNames");
}
switch ($eflag){
case 0:
- $smarty->assign("$pname", "<img alt=\"\" alt=\""._("running")."\" src=\"images/true.png\">");
+ $smarty->assign("$pname", "<img alt=\""._("running")."\" src=\"images/true.png\">");
break;
case 1:
- $smarty->assign("$pname", "<img alt=\"\" alt=\""._("not running")."\" src=\"images/false.png\">");
+ $smarty->assign("$pname", "<img alt=\""._("not running")."\" src=\"images/false.png\">");
break;
default:
$smarty->assign("$pname", _("not defined"));
$device= preg_replace('/^STRING: */', '', $device);
$usage= @snmpget($host, $community, "UCD-SNMP-MIB::dskPercent.$n");
$usage= preg_replace('/^INTEGER: */', '', $usage);
- $partitions.= "<tr><td><b>$device</b></td><td><img alt=\"\" src=\"progress.php?x=100&y=16&p=$usage\" align=\"middle\"></td></tr>\n";
+ $partitions.= "<tr><td><b>$device</b></td><td>".progressbar($usage,100,16,true)."</td></tr>\n";
}
$smarty->assign("partitions", $partitions);
} else {