X-Git-Url: https://git.tokkee.org/?a=blobdiff_plain;ds=sidebyside;f=plugins%2Fadmin%2Fsystems%2Fclass_terminalInfo.inc;h=7c378d679a2a5e1eed114500247b4a3f5c7c8e5d;hb=df9cf42cba6b375e7f39681c151ad9d1b22501bb;hp=cb96d63aba093c7bd2beb09e58ae95373060b5ef;hpb=e299f0ca47a924516f2afbe4e922f2418b75315c;p=gosa.git diff --git a/plugins/admin/systems/class_terminalInfo.inc b/plugins/admin/systems/class_terminalInfo.inc index cb96d63ab..7c378d679 100644 --- a/plugins/admin/systems/class_terminalInfo.inc +++ b/plugins/admin/systems/class_terminalInfo.inc @@ -26,6 +26,7 @@ class terminfo extends plugin var $cn= ""; /* attribute list for save action */ + var $ignore_account= TRUE; var $attributes= array("cn", "gotoMode", "gotoTerminalPath", "gotoFloppyEnable", "gotoCdromEnable", "ghInventoryNumber", "gotoSwapServer", "gotoSyslogServer", "gotoNtpServer", @@ -57,7 +58,7 @@ class terminfo extends plugin { /* Do we represent a valid terminal? */ if (!$this->is_account && $this->parent == NULL){ - echo " ". + echo " ". _("This 'dn' has no terminal features.").""; return; } @@ -72,6 +73,14 @@ class terminfo extends plugin $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); @@ -91,7 +100,8 @@ class terminfo extends plugin $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); @@ -99,7 +109,7 @@ class terminfo extends plugin $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 */ @@ -109,7 +119,8 @@ class terminfo extends plugin /* 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"); @@ -152,7 +163,7 @@ class terminfo extends plugin $device= preg_replace('/^STRING: */', '', $device); $usage= @snmpget($host, $community, "UCD-SNMP-MIB::dskPercent.$n"); $usage= preg_replace('/^INTEGER: */', '', $usage); - $partitions.= "$device\n"; + $partitions.= "$device".progressbar($usage,100,16,true)."\n"; } $smarty->assign("partitions", $partitions); } else {