loadavg($loadbar) : $sysinfo->loadavg()); for ($i = 0; $i < count($ar_buf['avg']); $i++) { $load_avg .= $ar_buf['avg'][$i] . ' '; } $_text = " \n" . " " . htmlspecialchars($sysinfo->chostname(), ENT_QUOTES) . "\n" . " " . htmlspecialchars($sysinfo->ip_addr(), ENT_QUOTES) . "\n" . " " . htmlspecialchars($sysinfo->kernel(), ENT_QUOTES) . "\n" . " " . htmlspecialchars($sysinfo->distro(), ENT_QUOTES) . "\n" . " " . htmlspecialchars($sysinfo->distroicon(), ENT_QUOTES) . "\n" . " " . htmlspecialchars($sysinfo->uptime(), ENT_QUOTES) . "\n" . " " . htmlspecialchars($sysinfo->users(), ENT_QUOTES) . "\n" . " " . htmlspecialchars(trim($load_avg), ENT_QUOTES) . "\n"; if (isset($ar_buf['cpupercent'])) $_text .= " " . htmlspecialchars(round($ar_buf['cpupercent'], 2), ENT_QUOTES) . ""; $_text .= " \n"; return $_text; } // html_vitals() function html_vitals () { global $webpath; global $XPath; global $text; $textdir = direction(); $scale_factor = 2; $loadbar = ""; $uptime = ""; if($XPath->match("/phpsysinfo/Vitals/CPULoad")) $loadbar = "
" . create_bargraph($XPath->getData("/phpsysinfo/Vitals/CPULoad"), 100, $scale_factor) . " " . $XPath->getData("/phpsysinfo/Vitals/CPULoad") . "%"; $_text = "\n" . " \n" . " \n" . " \n" . " \n" . " \n" . " \n" . " \n" . " \n" . " \n" . " \n" . " \n" . " \n" . " \n" . " \n" . " \n" . " \n" . " \n" . " \n" . " \n" . " \n" . " \n" . " \n" . " \n" . " \n" . " \n" . " \n" . " \n" . "
" . $text['hostname'] . "" . $XPath->getData("/phpsysinfo/Vitals/Hostname") . "
" . $text['ip'] . "" . $XPath->getData("/phpsysinfo/Vitals/IPAddr") . "
" . $text['kversion'] . "" . $XPath->getData("/phpsysinfo/Vitals/Kernel") . "
" . $text['dversion'] . "\"\"getData("/phpsysinfo/Vitals/Distroicon") . "\"> " . $XPath->getData("/phpsysinfo/Vitals/Distro") . "
" . $text['uptime'] . "" . uptime($XPath->getData('/phpsysinfo/Vitals/Uptime')) . "
" . $text['users'] . "" . $XPath->getData("/phpsysinfo/Vitals/Users") . "
" . $text['loadavg'] . "" . $XPath->getData("/phpsysinfo/Vitals/LoadAvg") . $loadbar . "
\n"; return $_text; } function wml_vitals () { global $XPath; global $text; $_text = "\n" . "

" . $text['hostname'] . ":
\n" . "- " . $XPath->getData("/phpsysinfo/Vitals/Hostname") . "

\n" . "

" . $text['ip'] . ":
\n" . "- " . $XPath->getData("/phpsysinfo/Vitals/IPAddr") . "

\n" . "

" . $text['kversion'] . ":
\n" . "- " . $XPath->getData("/phpsysinfo/Vitals/Kernel") . "

\n" . "

" . $text['uptime'] . ":
\n" . "- " . uptime($XPath->getData('/phpsysinfo/Vitals/Uptime')) . "

" . "

" . $text['users'] . ":
" . "- " . $XPath->getData("/phpsysinfo/Vitals/Users") . "

" . "

" . $text['loadavg'] . ":
" . "- " . $XPath->getData("/phpsysinfo/Vitals/LoadAvg") . "

" . "
\n"; return $_text; } ?>