function getmem() { $os = new os_system(); $html = $os->html_Memory_usage(); $tpl = new templates(); echo $tpl->_ENGINE_parse_body($html); }
function getmem() { include_once "ressources/class.os.system.tools.inc"; $os = new os_system(); $html = $os->html_Memory_usage(); $tpl = new templates(); echo $tpl->_ENGINE_parse_body($html); }
function mem_status() { $t = $_GET["t"]; $tpl = new templates(); include_once "ressources/class.os.system.tools.inc"; $os = new os_system(); $html = RoundedLightGrey($os->html_Memory_usage()) . "<br>"; echo $tpl->_ENGINE_parse_body($html); echo "<script>LoadAjax('squid-stats-{$t}','android.squid.stats.status.php');</script>"; }
function home_c(){ $t=$_GET["t"]; $os=new os_system(); $mem=$os->html_Memory_usage(); $page=CurrentPageName(); $tpl=new templates(); $html=" <table style='width:98%' class=form id='system-task-manager'> <tr> <td>$mem</td> </tr> </table> <div style='width:100%;text-align:right'>". imgtootltip("refresh-32.png","{refresh}","RefreshTab('main_taskmanager_tabs')")."</div> <script> function Startc$t(){ setTimeout('xStart$t()',11000); } function xStartc$t(){ LoadAjax('$t-c','$page?home-c=yes&t=$t'); } </script> "; echo $tpl->_ENGINE_parse_body($html); }
function memory() { include_once "ressources/class.os.system.tools.inc"; $page = CurrentPageName(); $os = new os_system(); return $os->html_Memory_usage() . "<script>\n\t\tLoadAjax('system-events','artica.events.php?tri=yes&context=system&process=&without-tri=yes');\n\t\t\n\tfunction articaShowEvent(ID){\n\t\t YahooWin6('750','artica.events.php?ShowID='+ID,'EV::'+ID);\n\t}\n\t</script>\n\t"; }
function SendStatus() { emergency(true); $pidfile = "/etc/artica-postfix/pids/" . basename(__FILE__) . "." . __FUNCTION__ . ".pid"; $sock = new sockets(); $EnableSargGenerator = $sock->GET_INFO("EnableSargGenerator"); if (TestsCron($pidfile)) { $ArticaMetaPingEnable = $sock->GET_INFO("ArticaMetaPingEnable"); events("SendPing={$ArticaMetaPingEnable}", __FUNCTION__, __FILE__, __LINE__); if ($ArticaMetaPingEnable == 1) { SendPing(); } return true; } $ArticaMetaEnabled = $sock->GET_INFO("ArticaMetaEnabled"); if ($ArticaMetaEnabled != 1) { return; } $t1 = time(); if (!is_file("/usr/share/artica-postfix/ressources/logs/global.status.ini")) { events("Unable to stat /usr/share/artica-postfix/ressources/logs/global.status.ini", __FUNCTION__, __FILE__, __LINE__); return null; } $unix = new unix(); $pid = @file_get_contents($pidfile); if ($unix->process_exists($pid, basename(__FILE__))) { $ptime = $unix->PROCESS_TTL($pid); if ($ptime > $GLOBALS["MAXTTL"]) { events("killing process {$pid} ttl:{$ptime} minutes", __FUNCTION__, __FILE__, __LINE__); unix_system_kill_force($pid); } else { events("Already executed, process {$pid}", __FUNCTION__, __FILE__, __LINE__); die; } } events("Running pid " . getmypid(), __FUNCTION__, __FILE__, __LINE__); @file_put_contents($pidfile, getmypid()); CheckNetwork(); $http = new httpget(); $meta = new artica_meta(); $filecache = "/etc/artica-postfix/artica-meta-files.cache"; events("My uuid=\"{$meta->uuid}\"", __FUNCTION__, __FILE__, __LINE__); $memCache = "/usr/share/artica-postfix/ressources/logs/status.memory.hash"; $cpu_graphs = "/opt/artica/share/www/system/rrd/01cpu-1day.png"; $server_status = "/usr/share/artica-postfix/ressources/logs/status.right.1.html"; $squid_realtime = "/etc/artica-postfix/squid-realtime.cache"; $datasToSend = base64_encode(serialize($meta->GLOBAL_ARRAY)); $ini = new Bs_IniHandler(); $ini->loadFile("/usr/share/artica-postfix/ressources/logs/global.status.ini"); $ArrayFileCache = unserialize(@file_get_contents($filecache)); if (is_file($memCache)) { $MEM_CACHE = base64_encode(@file_get_contents($memCache)); } else { include_once "ressources/class.os.system.tools.inc"; $os = new os_system(); $os->html_Memory_usage(); $MEM_CACHE = base64_encode(serialize($os->meta_array)); } if (is_file($cpu_graphs)) { if ($ArrayFileCache["STATS_DAY"] != filemtime($cpu_graphs)) { $http->uploads["STATS_DAY"] = $cpu_graphs; $ArrayFileCache["STATS_DAY"] = filemtime($cpu_graphs); @file_put_contents($filecache, serialize($ArrayFileCache)); } } if (is_file($server_status)) { if ($ArrayFileCache["SERVER_STATUS"] != filemtime($server_status)) { $http->uploads["SERVER_STATUS"] = $server_status; $ArrayFileCache["SERVER_STATUS"] = filemtime($server_status); @file_put_contents($filecache, serialize($ArrayFileCache)); } } if (is_file($squid_realtime)) { if ($ArrayFileCache["SQUID_REALTIME"] != filemtime($squid_realtime)) { $http->uploads["SQUID_REALTIME"] = $squid_realtime; $ArrayFileCache["SQUID_REALTIME"] = filemtime($squid_realtime); @file_put_contents($filecache, serialize($ArrayFileCache)); } } if ($EnableSargGenerator == 1) { $push_sarg = false; $sock = new sockets(); $SargOutputDir = $sock->GET_INFO("SargOutputDir"); if ($SargOutputDir == null) { $SargOutputDir = "/var/www/html/squid-reports"; } if (is_file("{$SargOutputDir}/index.html")) { if (!is_file("/etc/artica-postfix/sarg.tgz")) { shell_exec("cd {$SargOutputDir} && tar -cjf /etc/artica-postfix/sarg.tgz ./*"); $push_sarg = true; } else { if ($ArrayFileCache["SQUID_SARG"] != filemtime("{$SargOutputDir}/index.html")) { @unlink("/etc/artica-postfix/sarg.tgz"); shell_exec("cd {$SargOutputDir} && tar -cjf /etc/artica-postfix/sarg.tgz ./*"); $push_sarg = true; } } if ($push_sarg) { $http->uploads["SQUID_SARG"] = "/etc/artica-postfix/sarg.tgz"; } } } $users = new usersMenus(); $status = base64_encode(serialize($ini->_params)); $pasmoinsaux = pasmoinsaux(); if ($users->VMWARE_HOST) { $VMWARE_HOST = 1; } else { $VMWARE_HOST = 0; } shell_exec(LOCATE_PHP5_BIN2() . " " . dirname(__FILE__) . "/exec.dmidecode.php"); $dmidecode = base64_encode(@file_get_contents("/etc/artica-postfix/dmidecode.cache")); //SQUID if ($users->SQUID_INSTALLED) { $sock = new sockets(); $SQUIDEnable = $sock->GET_INFO("SQUIDEnable"); if (!is_numeric($SQUIDEnable)) { $SQUIDEnable = 1; } if ($SQUIDEnable == 1) { $SQUID_CACHES = base64_encode(serialize($unix->squid_get_cache_infos())); } if (is_array($SQUID_CACHES)) { $squid = new squidbee(); $cacheconf = $squid->cache_list; $cacheconf[$squid->CACHE_PATH]["cache_type"] = $squid->CACHE_TYPE; $cacheconf[$squid->CACHE_PATH]["cache_size"] = $squid->CACHE_SIZE; $cacheconf[$squid->CACHE_PATH]["cache_dir_level1"] = 16; $cacheconf[$squid->CACHE_PATH]["cache_dir_level2"] = 256; events("Caches: " . count($cacheconf), __FILE__, __LINE__); $SQUID_CACHES_CONFIG = base64_encode(serialize($cacheconf)); } } if ($users->SAMBA_INSTALLED) { _CheckSambaConfig(); } if ($users->ZARAFA_INSTALLED) { if (is_file("/etc/artica-postfix/settings/Daemons/ZarafaLicenseInfos")) { $ZARAFA_LICENSE = @file_get_contents("/etc/artica-postfix/settings/Daemons/ZarafaLicenseInfos"); } else { $ZARAFA_LICENSE = "Free edition"; } } if (is_file("/etc/artica-postfix/zarafa-export.db")) { $ZARAFA_DB = @file_get_contents("/etc/artica-postfix/zarafa-export.db"); } $body = $http->send("{$meta->ArticaMetaHostname}/lic.status.server.php", "post", array("DATAS" => $datasToSend, "STATUS" => $status, "MEMORIES" => $MEM_CACHE, "VERSION" => $users->ARTICA_VERSION, "DISTRI" => $users->LinuxDistriCode, "UPTIME" => getUptime(), "DISTRINAME" => $users->LinuxDistriFullName, "MAIN_PRODUCTS" => base64_encode(serialize(array("ZARAFA" => $users->ZARAFA_INSTALLED, "POSTFIX" => $users->POSTFIX_INSTALLED, "SQUID" => $users->SQUID_INSTALLED, "SAMBA" => $users->SAMBA_INSTALLED, "CYRUS" => $users->cyrus_imapd_installed, "OPENVPN" => $users->OPENVPN_INSTALLED))), "PROCESSES" => base64_encode($pasmoinsaux), "TOP_PROCESSES" => top10cpumem(), "NETS" => Networks(), "VMWARE_HOST" => $VMWARE_HOST, "SETTINGS_INC" => base64_encode(serialize(settings_inc())), "LOCAL_VERSIONS" => LocalVersions(), "VBOXGUESTS" => VirtualBoxList(), "APTCHECK" => APTCHECK(), "DMIDECODE" => $dmidecode, "SQUID_CACHES" => $SQUID_CACHES, "SQUID_CACHES_CONFIG" => $SQUID_CACHES_CONFIG, "OPENPORTS" => OpenPorts($meta->serial, $meta->uuid), "OPENVPN_CLIENTS_STATUS" => @file_get_contents("/usr/share/artica-postfix/ressources/logs/openvpn-clients.status"), "ZARAFA_DB" => $ZARAFA_DB, "ZARAFA_LICENSE" => $ZARAFA_LICENSE)); $EXEC_NICE = EXEC_NICE(); if (is_file("/usr/bin/nohup")) { $nohup = "/usr/bin/nohup "; } if (preg_match("#NOTIFY_DISCONNECT#is", $body)) { events("NOTIFY_DISCONNECT detected -> unregister_server()", __FUNCTION__, __FILE__, __LINE__); unregister_server(); return; } if (preg_match("#NOTIFY_EXPORT_USERS#is", $body)) { events("NOTIFY_EXPORT_USERS -> {$nohup}{$EXEC_NICE}exec.artica.meta.users.php --export-all", __FUNCTION__, __FILE__, __LINE__); shell_exec($nohup . $EXEC_NICE . LOCATE_PHP5_BIN() . " " . dirname(__FILE__) . "/exec.artica.meta.users.php --export-all >/dev/null 2>&1 &"); } if (preg_match("#NOTIFY_EXPORT_DOMAINS#is", $body)) { events("NOTIFY_EXPORT_DOMAINS -> {$nohup}{$EXEC_NICE}exec.artica.meta.users.php --export-all-domains", __FUNCTION__, __FILE__, __LINE__); shell_exec($nohup . $EXEC_NICE . LOCATE_PHP5_BIN() . " " . dirname(__FILE__) . "/exec.artica.meta.users.php --export-all-domains >/dev/null 2>&1 &"); } if (preg_match("#NOTIFY_EXPORT_OU#is", $body)) { events("NOTIFY_EXPORT_OU -> {$nohup}{$EXEC_NICE}exec.artica.meta.users.php --export-all-ou", __FUNCTION__, __FILE__, __LINE__); shell_exec($nohup . $EXEC_NICE . LOCATE_PHP5_BIN() . " " . dirname(__FILE__) . "/exec.artica.meta.users.php --export-all-ou >/dev/null 2>&1 &"); } if (preg_match("#NOTIFY_EXPORT_GROUPS#is", $body)) { events("NOTIFY_EXPORT_GROUPS -> {$nohup}{$EXEC_NICE}exec.artica.meta.users.php --export-all-groups", __FUNCTION__, __FILE__, __LINE__); shell_exec($nohup . $EXEC_NICE . LOCATE_PHP5_BIN() . " " . dirname(__FILE__) . "/exec.artica.meta.users.php --export-all-groups >/dev/null 2>&1 &"); } if (preg_match("#NOTIFY_EXPORT_SETTINGS#is", $body)) { $cmd = $EXEC_NICE . LOCATE_PHP5_BIN() . " " . dirname(__FILE__) . "/exec.artica.meta.users.php --export-all-settings >/dev/null 2>&1 &"; events("NOTIFY_EXPORT_SETTINGS -> {$cmd}", __FUNCTION__, __FILE__, __LINE__); shell_exec($cmd); } if (preg_match("#NOTIFY_EXPORT_COMPUTERS#is", $body)) { $cmd = $nohup . $EXEC_NICE . LOCATE_PHP5_BIN() . " " . dirname(__FILE__) . "/exec.artica.meta.users.php --export-all-computers >/dev/null 2>&1 &"; events("NOTIFY_EXPORT_SETTINGS -> {$cmd}", __FUNCTION__, __FILE__, __LINE__); shell_exec($cmd); } if (preg_match("#NOTIFY_EXPORT_DNS_ENTRIES#is", $body)) { $cmd = $nohup . $EXEC_NICE . LOCATE_PHP5_BIN() . " " . dirname(__FILE__) . "/exec.artica.meta.users.php --export-all-dns >/dev/null 2>&1 &"; events("NOTIFY_EXPORT_DNS_ENTRIES -> {$cmd}", __FUNCTION__, __FILE__, __LINE__); shell_exec($cmd); } if (preg_match("#NOTIFY_EXPORT_GROUPWARES#is", $body)) { $cmd = $nohup . $EXEC_NICE . LOCATE_PHP5_BIN() . " " . dirname(__FILE__) . "/exec.artica.meta.users.php --export-all-groupwares >/dev/null 2>&1 &"; events("NOTIFY_EXPORT_GROUPWARES -> {$cmd}", __FUNCTION__, __FILE__, __LINE__); shell_exec($cmd); } if (preg_match("#NOTIFY_EXPORT_FETCHMAIL_RULES#is", $body)) { $cmd = $nohup . $EXEC_NICE . LOCATE_PHP5_BIN() . " " . dirname(__FILE__) . "/exec.artica.meta.users.php --export-fetchmail-rules >/dev/null 2>&1 &"; events("NOTIFY_EXPORT_FETCHMAIL_RULES -> {$cmd}", __FUNCTION__, __FILE__, __LINE__); shell_exec($cmd); } if (preg_match("#<TASKS>(.+?)</TASKS>#is", $body, $re)) { events("Save tasks to /etc/artica-postfix/artica-meta.tasks", __FUNCTION__, __FILE__, __LINE__); @file_put_contents("/etc/artica-postfix/artica-meta.tasks", $re[1]); $cmd = $nohup . $EXEC_NICE . LOCATE_PHP5_BIN() . " " . dirname(__FILE__) . "/exec.artica.meta.tasks.php >/dev/null 2>&1 &"; events("TASKS ->{$cmd}", __FUNCTION__, __FILE__, __LINE__); shell_exec($cmd); } else { events("No tasks ordered for me...", __FUNCTION__, __FILE__, __LINE__); @unlink("/etc/artica-postfix/artica-meta.tasks"); } if (preg_match("#<HOST_CONF>(.+?)</HOST_CONF>#is", $body, $re)) { ParseMyConf($re[1]); } else { events("No configuration for me...", __FUNCTION__, __FILE__, __LINE__); } shell_exec($nohup . $EXEC_NICE . LOCATE_PHP5_BIN() . " " . dirname(__FILE__) . "/exec.artica.meta.users.php --socks >/dev/null 2>&1 &"); if (users_queue()) { $cmd = $nohup . $EXEC_NICE . LOCATE_PHP5_BIN() . " " . dirname(__FILE__) . "/exec.artica.meta.users.php --user-queue >/dev/null 2>&1 &"; events("users settings queue is not empty -> {$cmd}", __FUNCTION__, __FILE__, __LINE__); shell_exec($cmd); } if (computer_queue()) { $cmd = $nohup . $EXEC_NICE . LOCATE_PHP5_BIN() . " " . dirname(__FILE__) . "/exec.artica.meta.users.php --computer-queue >/dev/null 2>&1 &"; events("computer settings queue is not empty -> {$cmd}", __FUNCTION__, __FILE__, __LINE__); shell_exec($cmd); } if ($users->OPENVPN_INSTALLED) { $cmd = $nohup . $EXEC_NICE . LOCATE_PHP5_BIN() . " " . dirname(__FILE__) . "/exec.artica.meta.users.php --export-openvpn-logs >/dev/null 2>&1 &"; events("OpenVpn is installed -> {$cmd}", __FUNCTION__, __FILE__, __LINE__); shell_exec($cmd); } $time_iptables = file_time_min("/etc/artica-postfix/artica.meta.iptables.time"); if ($time_iptables > 180) { $cmd = $nohup . $EXEC_NICE . LOCATE_PHP5_BIN() . " " . dirname(__FILE__) . "/exec.artica.meta.users.php --iptables >/dev/null 2>&1 &"; events("iptables -> {$cmd}", __FUNCTION__, __FILE__, __LINE__); shell_exec($cmd); $cmd = $EXEC_NICE . LOCATE_PHP5_BIN() . " " . dirname(__FILE__) . "/exec.artica.meta.users.php --export-all-settings >/dev/null 2>&1 &"; events("{$cmd}", __FUNCTION__, __FILE__, __LINE__); @unlink("/etc/artica-postfix/artica.meta.iptables.time"); @file_put_contents("/etc/artica-postfix/artica.meta.iptables.time", "#"); } $t2 = time(); $time_duration = distanceOfTimeInWords($t1, $t2); events("Send status to {$meta->ArticaMetaHostname} DONE ({$time_duration})", __FUNCTION__, __FILE__, __LINE__); }
function main_status() { include_once "ressources/class.os.system.tools.inc"; $os = new os_system(); $arraycpu = $os->cpu_info(); $cpuspeed = round($arraycpu["cpuspeed"] / 1000 * 100) / 100; $html = "\n\t<table style='width:100%'>\n\t<tr>\n\t<td width=1% valign='top'><img src='img/64-computer.png'></td>\n\t<td valign='top'>\n\t<table style='width:100%'>\n\t\t<tr>\n\t\t\t<td width=1% nowrap align='right' valign='top'>cpu:</td>\n\t\t\t<td width=99%><strong>{$arraycpu["model"]}</strong></td>\n\t\t</tr>\n\t\t<tr>\n\t\t\t<td width=1% nowrap align='right' valign='top'>Cache:</td>\n\t\t\t<td width=99%><strong>{$arraycpu["cache"]}</strong></td>\n\t\t</tr>\t\t\n\t\t<tr>\n\t\t\t<td width=1% nowrap align='right'>{cpu_number}:</td>\n\t\t\t<td width=99%>{$arraycpu["cpus"]}</td>\n\t\t</tr>\n\t\t<tr>\n\t\t\t<td width=1% nowrap align='right'>{status}:</td>\n\t\t\t<td width=99%>{$cpuspeed}GHz</td>\n\t\t</tr>\t\t\t\t\t\n\t</table>\n\t</td>\n\t</tr>\n\t</table>\n\t"; $mem = $os->html_Memory_usage(); $mem = RoundedLightGreen($mem); $html = RoundedLightGreen($html) . "<br>{$mem}"; $tpl = new templates(); echo $tpl->_ENGINE_parse_body($html); }
function server_status() { $PHP5_CURRENT_MEMORY = null; if (!$GLOBALS["VERBOSE"]) { if (!isset($_GET["without-cache"])) { unset($_GET["_"]); $md5CacheF = md5("server_status{$_SESSION["uid"]}{$tpl->language}" . serialize($_GET)); $cachefile = "/usr/share/artica-postfix/ressources/interface-cache/{$md5CacheF}"; if (file_time_sec_Web($cachefile) < 10) { return @file_get_contents($cachefile); } } } $BOGOMIPS = 0; if (is_file("/usr/share/artica-postfix/ressources/interface-cache/processor_type")) { $processor_type = unserialize(@file_get_contents("/usr/share/artica-postfix/ressources/interface-cache/processor_type")); $BOGOMIPS = intval($processor_type["BOGOMIPS"]); } $icon = "server-128-ok.png"; $os = new os_system(); $sock = new sockets(); $users = new usersMenus(); $Warn = false; $HyperWarn = true; $tpl = new templates(); $EnableMsftncsi = intval(@file_get_contents("/etc/artica-postfix/settings/Daemons/EnableMsftncsi")); $EnableIntelCeleron = intval($sock->GET_INFO("EnableIntelCeleron")); $ArticaAutoUpateOfficial = $sock->GET_INFO("ArticaAutoUpateOfficial"); $ArticaAutoUpateNightly = intval($sock->GET_INFO("ArticaAutoUpateNightly")); $ArticaUpdateIntervalAllways = intval($sock->GET_INFO("ArticaUpdateIntervalAllways")); if (!is_numeric($ArticaAutoUpateOfficial)) { $ArticaAutoUpateOfficial = 1; } $RootPasswordChanged = intval($sock->GET_INFO("RootPasswordChanged")); $influxdb_version = @file_get_contents("{$GLOBALS["BASEDIR"]}/influxdb_version"); $influxdbversionBin = $influxdb_version; $RegisterCloudBadEmail = intval($sock->GET_INFO("RegisterCloudBadEmail")); $InfluxUseRemote = intval($sock->GET_INFO("InfluxUseRemote")); $InfluxUseRemoteInfo = intval($sock->GET_INFO("InfluxUseRemoteInfo")); $SessionPathInMemory = intval($sock->GET_INFO("SessionPathInMemory")); $EnableBandwithCalculation = intval($sock->GET_INFO("EnableBandwithCalculation")); $DashBoardDNSPerfsStats = $sock->GET_INFO("DashBoardDNSPerfsStats"); $BigDatav3Read = intval($sock->GET_INFO("BigDatav3Read")); $EnableArticaMetaClient = intval($sock->GET_INFO("EnableArticaMetaClient")); $SquidPerformance = intval($sock->GET_INFO("SquidPerformance")); $ArticaTechNetInfluxRepo = unserialize(base64_decode($sock->GET_INFO("ArticaTechNetInfluxRepo"))); $LicenseInfos = unserialize(base64_decode($sock->GET_INFO("LicenseInfos"))); $EnableArticaMetaServer = intval(@file_get_contents("/etc/artica-postfix/settings/Daemons/EnableArticaMetaServer")); if ($EnableArticaMetaServer == 1) { $EnableArticaMetaClient = 0; } if ($EnableArticaMetaClient == 1) { $ArticaMetaHost = $sock->GET_INFO("ArticaMetaHost"); if ($ArticaMetaHost == null) { $err[] = proxy_status_warning("{incorrect_meta_server_address}", "{click_to_edit}", "GotoArticaMeta()"); } } if ($SessionPathInMemory > 0) { exec("/bin/df -h /var/lib/php5 2>&1", $results); while (list($num, $ligne) = each($results)) { if (!preg_match("#tmpfs\\s+(.+?)\\s+(.+?)\\s+(.+?)\\s+(.+?)%\\s+#", $ligne, $re)) { continue; } $PHP5_CURRENT_MEMORY = $re[4]; $PHP5_CURRENT_MEMORY_SIZE = $re[1]; } } if (!is_file("/usr/share/artica-postfix/ressources/interface-cache/CPU_NUMBER")) { $sock = new sockets(); $CPU_NUMBER = intval($sock->getFrameWork("services.php?CPU-NUMBER=yes")); } else { $CPU_NUMBER = intval(@file_get_contents("/usr/share/artica-postfix/ressources/interface-cache/CPU_NUMBER")); } if ($CPU_NUMBER < 2) { if ($EnableIntelCeleron == 0) { $warn[] = status_important_event("{performance_issue_cpu_number_text}", "{click_to_fix}", "GotoOptimizeSystem()"); } } if ($EnableMsftncsi == 1) { $msftncsiStatus = intval(@file_get_contents("/etc/artica-postfix/settings/Daemons/msftncsiStatus")); if ($msftncsiStatus == 3) { $warn[] = status_important_event("{network_awareness} !!", "", "GotoWatchdog()"); } } $results = array(); exec("/usr/bin/pgrep -l -f \"philesight --db\" 2>&1", $results); while (list($num, $ligne) = each($results)) { $ligne = trim($ligne); if ($ligne == null) { continue; } if (preg_match("#pgrep#", $ligne)) { continue; } if (!preg_match("#^([0-9]+)\\s+#", $ligne)) { $warn[] = status_important_event("{APP_PHILESIGHT_INDEXING}", null, "blur()"); break; } } $curs = "OnMouseOver=\"this.style.cursor='pointer';\"\n\tOnMouseOut=\"this.style.cursor='auto'\""; $os->html_Memory_usage(); $EnableKerbAuth = intval($sock->GET_INFO("EnableKerbAuth")); $MAIN = $os->meta_array; $PHP5_CURRENT_MEMORY_COLOR = "black"; $LOAD_COLOR = "black"; $ORG_LOAD = $MAIN["LOAD"]["ORG_LOAD"]; $CPU_NUMBER = $MAIN["LOAD"]["CPU_NUMBER"]; $MAXOVER = $MAIN["LOAD"]["MAXOVER"]; $MEM_USED_POURC = $MAIN["MEM"]["MEM_USED_POURC"]; $MEM_USED_COLOR = "black"; $SWAP_POURC = $MAIN["SWAP_POURC"]; $DISKY = array(); $MAXOVER2 = $CPU_NUMBER - 1; if ($MAXOVER2 == 0) { $MAXOVER2 = 1.5; } $EnableIntelCeleronText = null; $CURVER = @file_get_contents("VERSION"); $CURVER_KEY = str_replace(".", "", $CURVER); if ($EnableIntelCeleron == 1) { $EnableIntelCeleronText = "{intel_celeron_support}"; $MAXOVER2 = 2; } $INFO_WORKING_TASK = INFO_WORKING_TASK(); if (is_array($INFO_WORKING_TASK)) { $INFOS = $INFO_WORKING_TASK; } if (!$users->STATS_APPLIANCE) { if ($InfluxUseRemote == 0) { if ($EnableIntelCeleron == 0) { if ($InfluxUseRemoteInfo == 0) { if ($SquidPerformance < 2) { $INFOS[] = status_info_event("{suggest_remote_statistics_appliance}", "{suggest_remote_statistics_appliance}<br>{click_here}", "Loadjs('influx.remote.suggest.php')"); } } } } } if ($ORG_LOAD > $MAXOVER2) { $LOAD_COLOR = "#F59C44"; $Warn = true; $icon = "server-128-warn.png"; $microerror_text = "{overloaded} {$ORG_LOAD} » {$MAXOVER2}"; } $SWAPERR = false; if ($ORG_LOAD > $MAXOVER) { $HyperWarn = true; $LOAD_COLOR = "#D32D2D"; $icon = "server-128-critic.png"; $microerror_text = "{overloaded} {$ORG_LOAD} » {$MAXOVER}"; } if ($MEM_USED_POURC > 79) { $microerror_text = "{memory_warning}"; if (!$HyperWarn) { $icon = "server-128-warn.png"; } $MEM_USED_COLOR = "#F59C44"; $jsOn = "GotoSystemMemory()"; if (!$users->AsArticaAdministrator) { $jsOn = "blur()"; } $err[] = "<tr><td style='font-size:18px;color:#d32d2d;vertical-align:middle'>\n\t\t<img src='img/warn-red-32.png' style='float:left;margin-right:10px'>\n\t\t<span style='text-decoration:underline' {$curs} OnClick=\"javascript:{$jsOn}\">{overloaded_memory}</span>\n\t\t</td></tr>"; $SWAPERR = true; } if ($MEM_USED_POURC > 90) { $microerror_text = "{memory_alert}"; $icon = "server-128-critic.png"; $MEM_USED_COLOR = "#D32D2D"; if (!$SWAPERR) { $jsOn = "GotoSystemMemory()"; if (!$users->AsArticaAdministrator) { $jsOn = "blur()"; } $icon = "disks-128-warn.png"; $err[] = "<tr><td style='font-size:18px;color:#d32d2d;vertical-align:middle'>\n\t\t\t<img src='img/warn-red-32.png' style='float:left;margin-right:10px'>\n\t\t\t<span style='text-decoration:underline' {$curs} OnClick=\"javascript:{$jsOn}\">{overloaded_memory}</span>\n\t\t\t</td></tr>"; $SWAPERR = true; } } if ($SWAP_POURC > 20) { if (!$HyperWarn) { $microerror_text = "{swap_warning}"; $icon = "server-128-warn.png"; } $SWAP_COLOR = "#F59C44"; } if ($PHP5_CURRENT_MEMORY > 80) { if (!$HyperWarn) { $microerror_text = "{swap_warning}"; $icon = "server-128-warn.png"; } $PHP5_CURRENT_MEMORY_COLOR = "#F59C44"; } if ($SWAP_POURC > 30) { if (!$HyperWarn) { $microerror_text = "{swap_warning}"; $icon = "server-128-warn.png"; } $SWAP_COLOR = "#D32D2D"; } if ($SWAP_POURC > 50) { $microerror_text = "{swap_alert}"; $icon = "server-128-critic.png"; $SWAP_COLOR = "#D32D2D"; $jsOn = "GotoSystemMemory()"; if (!$users->AsArticaAdministrator) { $jsOn = "blur()"; } $err[] = proxy_status_warning("{high_swap_value}", "{high_swap_value}", $jsOn); } if ($PHP5_CURRENT_MEMORY > 95) { if (!$HyperWarn) { $microerror_text = "{session_memory_warning}"; $icon = "server-128-warn.png"; } $PHP5_CURRENT_MEMORY_COLOR = "#D32D2D"; } if ($EnableIntelCeleron == 0) { $sock->getFrameWork("postgres.php?is-installed=yes"); $PostgresInstalled = intval($sock->GET_INFO("PostgresInstalled")); if ($PostgresInstalled == 0) { $jsOn = "Loadjs('influxdb.install.progress.php');"; if (!$users->AsArticaAdministrator) { $jsOn = "blur()"; } $err[] = proxy_status_warning("{influx_not_installed}", "{click_to_install}", $jsOn); } else { $influxdb_tests = influxdb_tests(); if ($influxdb_tests != null) { $err[] = $influxdb_tests; } } } if (isset($LicenseInfos["FINAL_TIME"])) { if (is_numeric($LicenseInfos["FINAL_TIME"])) { $FINAL_TIME = intval($LicenseInfos["FINAL_TIME"]); $ExpiresSoon = intval(time_between_day_Web($FINAL_TIME)); $jsOn = "GoToArticaLicense()"; $distanceOfTimeInWords = distanceOfTimeInWords(time(), $FINAL_TIME); if (!$users->AsSystemAdministrator) { $jsOn = null; } $corporate_licence_will_expire_explain = $tpl->_ENGINE_parse_body("{corporate_licence_will_expire_explain}"); $corporate_licence_will_expire_explain = str_replace("%d", $ExpiresSoon, $corporate_licence_will_expire_explain); if (time() > $FINAL_TIME) { $err[] = proxy_status_warning("{license2}: {license_expired} !!", "{license_expired_explain}", $jsOn); } if ($FINAL_TIME > time()) { if ($ExpiresSoon < 10) { $err[] = proxy_status_warning("{corporate_licence_will_expire} ({$ExpiresSoon} {days})", "{$corporate_licence_will_expire_explain}", $jsOn); } if ($ExpiresSoon < 31) { $ExpiresSoon = $ExpiresSoon + 1; $warn[] = status_important_event("{license2}: {trial_period} - {$ExpiresSoon} {days} -", "{expiredate}:" . $tpl->time_to_date($FINAL_TIME) . " ({$distanceOfTimeInWords})", $jsOn); } } } } if (!$users->CGROUPS_INSTALLED) { $jsOn = "Loadjs('cgroups.install.progress.php');"; if (!$users->AsArticaAdministrator) { $jsOn = "blur()"; } $warn[] = status_important_event("{cgroups_not_installed}", "{click_to_install}", $jsOn); } if ($RegisterCloudBadEmail == 1) { $warn[] = status_important_event("{incorrect_email_address}", "{incorrect_email_address_cloud}", "GoToArticaLicense()"); } if (!extension_loaded('pgsql')) { $warn[] = status_important_event("{missing_postgres_library}", "{missing_postgres_library_explain}", "Loadjs('admin.pgsql.php')"); } else { if (!function_exists("pg_connect")) { $warn[] = status_important_event("{missing_postgres_library}", "{missing_postgres_library_explain}", "Loadjs('admin.pgsql.php')"); } } if ($BOGOMIPS > 0) { if ($users->CGROUPS_INSTALLED) { if ($BOGOMIPS < 3500) { if ($EnableIntelCeleron == 0) { $jsOn = "Loadjs('system.optimize.celeron.wizard.php');"; $err[] = status_important_event("{low_performance}", "{low_performance_link_explain}", $jsOn); } } } } $q = new mysql(); $perfs_queue = $q->COUNT_ROWS("perfs_queue", "artica_events"); if ($perfs_queue > 0) { $dashboard_perfs_queue = $tpl->_ENGINE_parse_body("{dashboard_perfs_queue}"); $dashboard_perfs_queue = str_replace("%s", $perfs_queue, $dashboard_perfs_queue); $warn[] = status_important_event($dashboard_perfs_queue, "{$dashboard_perfs_queue}", "GotoDashBoardPerfQueue()"); } $HostType = null; if ($users->VMWARE_HOST) { $HostType = "VMWare Edition"; $HostTypejs = "GotoVMWareClient();"; if (trim($sock->getFrameWork("services.php?vmtools_installed=yes")) != "TRUE") { $jsOn = "Loadjs('vmware.install.progress.php');"; if (!$users->AsArticaAdministrator) { $jsOn = "blur()"; } $warn[] = status_important_event("{APP_VMWARE_TOOLS_NOT_INSTALLED}", "{click_to_install}", $jsOn); } } if (is_array($MAIN["DISKS"])) { while (list($disk, $array) = each($MAIN["DISKS"])) { $POURC = $array["POURC"]; $LABEL = $array["LABEL"]; if ($LABEL == null) { $LABEL = $disk; } if ($POURC < 80) { continue; } $DISK_COLOR = "#F59C44"; $icon = "server-128-warn.png"; $microerror_text = "{partition_warning}"; $diskZ = "\t\n\t\t\t<tr>\n\t\t\t<td style='font-size:20px;color:{$DISK_COLOR}'>{$LABEL} {$POURC}% {used}</td>\n\t\t\t</tr>"; if ($POURC > 95) { $DISK_COLOR = "#D32D2D"; $icon = "server-128-critic.png"; $diskZ = "\t<tr>\n\t\t\t<td style='font-size:20px;color:{$DISK_COLOR}'>{$LABEL} {$POURC}% {used}</td>\n\t\t\t</tr>"; } $DISKY[] = $diskZ; } } if ($RootPasswordChanged == 0) { $jsOn = "Loadjs('system.root.pwd.php')"; if (!$users->AsSystemAdministrator) { $jsOn = null; } $err[] = status_important_event("{root_password_not_changed}", "{root_password_not_changed_text}", $jsOn); } if (count($err) > 0) { $errT[] = "<tr><td style='font-size:32px;color:#d32d2d;vertical-align:middle'>" . count($err) . " {issues}</td></tr>\n\t\t<tr><td colspan=2> </td></tr>\n\t\t"; } $GotoSpeedTests = "GotoSpeedTests()"; $GotoBandwidthdStats = "GotoBandwidthdStats()"; $GoToSystem = "GoToSystem()"; $GotToArticaUpdate = "GotToArticaUpdate()"; $GotoOptimizeSystem = "GotoOptimizeSystem()"; $GotoDNSPerfs = "GotoDNSPerfs()"; $GotoSystemMemory = "GotoSystemMemory()"; $GotoStatsSystem = "GotoStatsSystem()"; $GotoStatsSystem_underline = "underline"; $HostTypejs_underline = "underline"; if (!$users->AsSystemAdministrator) { $microerror_text = null; $HostTypejs_underline = "none"; $GotoStatsSystem_underline = "none"; $HostTypejs = "blur();"; $GoToSystem = "blur()"; $GotoStatsSystem = "blur()"; $GotoSystemMemory = "blur()"; $GotoDNSPerfs = "blur()"; $GotoOptimizeSystem = "blur()"; $GotToArticaUpdate = "blur()"; $GotoBandwidthdStats = "blur()"; $GotoSpeedTests = "blur()"; } if ($EnableBandwithCalculation == 1) { $q = new mysql(); $sql = "SELECT * FROM speedtests ORDER BY zDate DESC LIMIT 0,1"; $speedtests = null; $ligne = mysql_fetch_array($q->QUERY_SQL($sql, "artica_events")); $download = $ligne["download"]; $upload = $ligne["upload"]; $ISP = $ligne["ISP"]; //Kbi/s upload 51.2 Kbi/s if ($download > 0) { $speedtests = "\n\t\t\t\t<tr>\n\t\t\t\t<td> </td>\n\t\t\t\t</tr>\n\t\t\t\t<tr>\n\t\t\t\t<td style='font-size:16px;'>\n\t\t\t\t<span style='color:black'><a href=\"javascript:blur();\"\n\t\t\t\tOnClick=\"javascript:{$GotoSpeedTests};\" style='text-decoration:{$GotoStatsSystem_underline}'>\n\t\t\t\t{bandwidth}: <i style='font-size:16px'>{$download}Kbit/sec {download2}</i></td>\n\t\t\t\t</tr><tr>\n\t\t\t\t<td style='font-size:16px;'>\n\t\t\t\t<span style='color:black'><a href=\"javascript:blur();\"\n\t\t\t\tOnClick=\"javascript:{$GotoSpeedTests};\" style='text-decoration:{$GotoStatsSystem_underline}'>\n\t\t\t\t{bandwidth}: <i style='font-size:16px'>{$upload}Kbit/sec {upload}</a> ({$ISP})</span></i></td>\n\t\t\t\t</tr>"; } } if ($sock->Bandwidthd_enabled() == 1) { $q = new mysql_squid_builder(); $bandwidthd_today = $q->COUNT_ROWS("bandwidthd_today"); if ($bandwidthd_today > 0) { $speedtests = $speedtests . "\n\t\t\t<tr>\n\t\t\t<td style='font-size:18px;'>\n\t\t\t<table style='width:100%'>\n\t\t\t<tr>\n\t\t\t<td valign='middle' style='width:25px'><img src='img/graph-24.png'></td>\n\t\t\t<td valign='middle'>\n\t\t\t<span style='color:black'><a href=\"javascript:blur();\"\n\t\t\tOnClick=\"javascript:{$GotoBandwidthdStats};\" style='text-decoration:{$GotoStatsSystem_underline}'>\n\t\t\t<span style='font-size:18px;font-weight:bold'>{$bandwidthd_today}</span> <span style='font-size:18px;'>{nodes}</span></td>\n\t\t\t</tr>\n\t\t\t</table>\n\t\t\t</td>\n\t\t\t</tr>"; } } if ($users->AsSystemAdministrator) { if ($EnableArticaMetaClient == 0) { if ($ArticaAutoUpateOfficial == 1) { $ArticaUpdateRepos = unserialize($sock->GET_INFO("ArticaUpdateRepos")); $key_nightly = update_find_latest_nightly($ArticaUpdateRepos); $key_offical = update_find_latest($ArticaUpdateRepos); $OFFICIALS = $ArticaUpdateRepos["OFF"]; $Lastest = $OFFICIALS[$key_offical]["VERSION"]; $MAIN_URI = $OFFICIALS[$key_offical]["URL"]; $MAIN_MD5 = $OFFICIALS[$key_offical]["MD5"]; $MAIN_FILENAME = $OFFICIALS[$key_offical]["FILENAME"]; if ($key_offical > $CURVER_KEY) { $err[] = "<tr><td style='font-size:18px;color:#46a346;vertical-align:middle' nowrap>\n\t\t\t\t<img src='img/32-install-soft.png' style='float:left;margin-right:10px'>\n\t\t\t\t" . texttooltip("{new_version}: {$Lastest}", "{NEW_RELEASE_TEXT}", "{$GotToArticaUpdate}") . "\n\t\t\t\t</td></tr>"; } } } } if ($EnableIntelCeleron == 1) { $EnableIntelCeleron_explain = "<tr><td style='font-size:16px;color:#000000;vertical-align:middle' nowrap>\n\t\t\t\t<i>" . texttooltip("{CELERON_METHOD}", "{CELERON_METHOD_EXPLAIN}", $GotoOptimizeSystem) . "</i>\n\t\t\t\t</td></tr>"; } $EnableDNSPerfs = intval(@file_get_contents("/etc/artica-postfix/settings/Daemons/EnableDNSPerfs")); if ($EnableDNSPerfs == 1) { if ($EnableIntelCeleron == 0) { $DNS_COLOR = "black;"; if ($DashBoardDNSPerfsStats != null) { $DashBoardDNSPerfsStats = round($DashBoardDNSPerfsStats, 2); if ($DashBoardDNSPerfsStats < 30) { $DNS_COLOR = "#D32D2D"; } $DashBoardDNSPerfsStats_text = "\n\t\t\t\t\t<tr>\n\t\t\t\t\t<td style='font-size:20px;color:{$DNS_COLOR}'>" . texttooltip("{dns_performance}", "{dnsperf_explain}", "{$GotoDNSPerfs}") . ": {$DashBoardDNSPerfsStats}%</td>\n\t\t\t\t\t</tr>"; } } } if ($microerror_text != null) { $microerror_text = "<center style='margin-top:10px;font-weight:bold;font-size:14px'>{$microerror_text}</center>"; } if ($HostType != null) { $HostType = "<center style='font-size:14px;margin-top:10px;'>\n\t<a href=\"javascript:blur();\" OnClick=\"javascript:{$HostTypejs}\" style='text-decoration:{$HostTypejs_underline}'>\n\t\t{$HostType}</a></center>"; } $html[] = "\n\t<table style='width:100%'>\n\t<tr>\n\t<td valign='top' style='width:128px' {$curs} OnClick=\"javascript:{$GoToSystem}\">\n\t\t<img src='img/{$icon}'>{$HostType}{$microerror_text}\n\t</td>\n\t<td>\n\t<table style='width:100%'>\n\t<tr>\n\t\t<td style='font-size:30px' {$curs} OnClick=\"javascript:{$GoToSystem}\">{system}</td>\n\t</tr>\t\n\t<tr>\n\t<td style='font-size:30px;color:{$LOAD_COLOR};text-decoration:{$GotoStatsSystem_underline}' {$curs} OnClick=\"javascript:{$GotoStatsSystem};\">{$ORG_LOAD} {load2}</td>\n\t</tr>\n\t{$EnableIntelCeleron_explain}\n\t<tr>\n\t\t<td style='font-size:20px;'>\n\t\t<span style='color:{$MEM_USED_COLOR}'><a href=\"javascript:blur();\"\n\t\tOnClick=\"javascript:{$GotoSystemMemory};\" style='text-decoration:{$GotoStatsSystem_underline}'>\t\t\n\t\t{$MEM_USED_POURC}% {memory}</a></span> | \n\t\t<span style='color:{$SWAP_COLOR}'>{$SWAP_POURC}% SWAP</span></td>\n\t</tr>\n\t"; if ($users->AsSystemAdministrator) { if ($PHP5_CURRENT_MEMORY != null) { $html[] = "<tr>\n\t\t\t<td style='font-size:18px;'>\n\t\t\t<span style='color:{$PHP5_CURRENT_MEMORY_COLOR}'><a href=\"javascript:blur();\"\n\t\t\tOnClick=\"javascript:{$GotoSystemMemory};\" style='text-decoration:{$GotoStatsSystem_underline}'>\n\t\t\t{session_memory}: {$PHP5_CURRENT_MEMORY}%/{$PHP5_CURRENT_MEMORY_SIZE}</a></span></td>\n\t\t\t</tr>"; } } if ($users->AsSystemAdministrator) { if (is_file("/usr/share/artica-postfix/ressources/logs/web/monit.status.all")) { $dataMonit = unserialize(@file_get_contents("/usr/share/artica-postfix/ressources/logs/web/monit.status.all")); $dataMonitCount = count($dataMonit); $html[] = "<tr>\n\t\t\t<td style='font-size:18px;'>\n\t\t\t<span style='color:black'><a href=\"javascript:blur();\"\n\t\t\tOnClick=\"javascript:Loadjs('monit.php');\" style='text-decoration:underline'>\n\t\t\t{monitored_processes}: {$dataMonitCount}</a></span></td>\n\t\t\t</tr>"; } } if (!$users->AsSystemAdministrator) { $INFOS = array(); $errT = array(); $err = array(); $warn = array(); } $html[] = $DashBoardDNSPerfsStats_text; if ($speedtests != null) { $html[] = $speedtests; } if (count($INFOS) > 0) { $html[] = @implode("", $INFOS); $html[] = "<tr><td colspan=2> </td></tr>"; } if (count($DISKY) > 0) { $html[] = @implode("", $DISKY); } $page = CurrentPageName(); $seqfw = "LoadAjaxRound('sequence-firewall','{$page}?sequence-firewall=yes');"; if (isset($_GET["nofw"])) { $seqfw = null; } $html[] = "" . @implode("", $errT) . "\n\t" . @implode("", $err) . @implode("", $warn) . "\n\t\t\t\n\t</table>\n\t</td>\n\t</tr>\n\t</table>\n\t<script>\n\t\n\tfunction LoadseQuenceProxy(){\n\t\tLoadAjaxSilent('sequence-proxy','{$page}?sequence-proxy=yes&nofw=yes&sequence=yes');\n\t\n\t}\n\t\n\n\tfunction LoadSequenceServer(){\n\t\t\tif( !document.getElementById('sequence-server')){return;}\n\t\t\t\n\t\t\tvar DASHBOARD_SEQUENCE_SERVER=parseInt(document.getElementById('DASHBOARD_SEQUENCE_SERVER').value);\n\t\t\tif(DASHBOARD_SEQUENCE_SERVER<10){\n\t\t\t\tDASHBOARD_SEQUENCE_SERVER=DASHBOARD_SEQUENCE_SERVER+1;\n\t\t\t\tdocument.getElementById('DASHBOARD_SEQUENCE_SERVER').value=DASHBOARD_SEQUENCE_SERVER;\n\t\t\t\tsetTimeout('LoadSequenceServer()',1000);\n\t\t\t\treturn;\n\t\t\t}\n\t\t\t\n\t\t\tdocument.getElementById('DASHBOARD_SEQUENCE_SERVER').value=0;\n\t\t\tLoadAjaxSilent('sequence-server','{$page}?sequence-server=yes&nofw=yes&sequence=yes');\n\t\t\tsetTimeout('LoadseQuenceProxy()',20000);\n\t\t}\n\tsetTimeout('LoadSequenceServer()',5000);\n\t</script>\t\t\n\t"; $html = $tpl->_ENGINE_parse_body(@implode("", $html)); @file_put_contents($cachefile, $html); return $html; }
function status_computer() { if (!$GLOBALS["AS_ROOT"]) { if (!$GLOBALS["VERBOSE"]) { if (is_file("/usr/share/artica-postfix/ressources/logs/web/admin.index.memory.html")) { $data = @file_get_contents("/usr/share/artica-postfix/ressources/logs/web/admin.index.memory.html"); if (strlen($data) > 45) { $tpl = new templates(); echo $tpl->_ENGINE_parse_body($data); return; } } } } $page = CurrentPageName(); $sock = new sockets(); $newfrontend = false; if (isset($_GET["newfrontend"])) { $newfrontend = true; } if (!$GLOBALS["VERBOSE"]) { if (!$GLOBALS["AS_ROOT"]) { if (GET_CACHED(__FILE__, __FUNCTION__, "time", false, 3)) { return; } if (internal_load() > 1.2) { if (GET_CACHED(__FILE__, __FUNCTION__)) { return; } } } } if ($newfrontend) { $ajaxadd = "&newfrontend=yes"; } include_once dirname(__FILE__) . "/ressources/class.os.system.tools.inc"; $html = "<div id='admin-index-status-mysql'></div>\n\t<script>LoadAjaxTiny('admin-index-status-mysql','{$page}?admin-index-status-mysql=yes');</script>"; $os = new os_system(); if ($GLOBALS["VERBOSE"]) { echo "os->html_Memory_usage()<br>\n"; } $html = $html . RoundedLightGrey($os->html_Memory_usage()) . "<br>\n\t<script>\n\tif(document.getElementById('left_status')){\n\t\tvar content=document.getElementById('left_status').innerHTML;\n\t\tif(content.length<5){\n\t\t\tLoadAjax('left_status','{$page}?status=left{$ajaxadd}',true);\n\t\t}\n\t}\n\t</script>\n\t\n\t\n\t"; if ($GLOBALS["AS_ROOT"]) { include_once dirname(__FILE__) . '/framework/class.unix.inc'; include_once dirname(__FILE__) . '/framework/frame.class.inc'; @file_put_contents("/usr/share/artica-postfix/ressources/logs/web/admin.index.memory.html", $html); return; } SET_CACHED(__FILE__, __FUNCTION__, $html); SET_CACHED(__FILE__, __FUNCTION__, "time", $html); echo $html; }
function status_computer() { include_once "ressources/class.os.system.tools.inc"; status_mysql(); $os = new os_system(); $html = RoundedLightGrey($os->html_Memory_usage()) . "<br>"; echo $html; }
} if (!$_GET["FORCE"]) { $sock = new sockets(); $PoolCoverPageSchedule = intval($sock->GET_INFO('PoolCoverPageSchedule')); if ($PoolCoverPageSchedule < 1) { $PoolCoverPageSchedule = 10; } $timef = file_get_time_min("/etc/artica-postfix/croned.2/" . md5(__FILE__)); if ($timef < $PoolCoverPageSchedule) { die; } } @unlink("/etc/artica-postfix/croned.2/" . md5(__FILE__)); @file_put_contents("/etc/artica-postfix/croned.2/" . md5(__FILE__), date('Y-m-d H:i:s')); $os = new os_system(); $_GET["CURRENT_MEMORY"] = RoundedLightGrey($os->html_Memory_usage()) . "<br>"; @file_put_contents('/usr/share/artica-postfix/ressources/logs/status.memory.html', $_GET["CURRENT_MEMORY"]); @chmod('/usr/share/artica-postfix/ressources/logs/status.memory.html', 0755); BuildingExecStatus("Build deamons status...", 10); daemons_status(); events("daemons_status(); OK"); BuildingExecStatus("Current time...", 20); get_current_time(); events(__LINE__ . ") get_current_time(); OK"); events("status_right -> START;"); BuildingExecStatus("Right pan...", 30); status_right(); events("status_right(); OK"); BuildingExecStatus("Right Postfix pan...", 40); $status = new status(); BuildingExecStatus("Postfix status...", 50);
function status_computer() { if (GET_CACHED(__FILE__, __FUNCTION__, __FUNCTION__, false, 1)) { return null; } $os = new os_system(); $html = RoundedLightGrey($os->html_Memory_usage()) . "<br>"; SET_CACHED(__FILE__, __FUNCTION__, __FUNCTION__, $html); echo $html; }
function home_c() { $t = $_GET["t"]; $os = new os_system(); $mem = $os->html_Memory_usage(); $page = CurrentPageName(); $tpl = new templates(); $html = "\n\t<table style='width:98%' class=form id='system-task-manager'>\n\t<tr>\n\t\t<td>{$mem}</td>\n\t</tr>\n\t</table>\n\t<div style='width:100%;text-align:right'>" . imgtootltip("refresh-32.png", "{refresh}", "RefreshTab('main_taskmanager_tabs')") . "</div>\n\t<script>\n\t\n\t\tfunction Startc{$t}(){\n\t\t\tsetTimeout('xStart{$t}()',11000);\n\t\t}\n\t\t\n\t\tfunction xStartc{$t}(){\n\t\t\tLoadAjax('{$t}-c','{$page}?home-c=yes&t={$t}');\n\t\t\n\t\t}\n\t</script>\n\t"; echo $tpl->_ENGINE_parse_body($html); }