db->queryOneRecord("SELECT data, state FROM monitor_data WHERE type = 'server_load' and server_id = " . $_SESSION['monitor']['server_id'] . " order by created desc"); if(isset($record['data'])) { $data = unserialize($record['data']); /* Format the data */ if (strlen($data['up_minutes']) == "1") $data['up_minutes'] = "0".$data['up_minutes']; $html = '
' . $app->lng("Server online since").': | ' . $data['up_days'] . ' days, ' . $data['up_hours'] . ':' . $data['up_minutes'] . ' hours |
' . $app->lng("Users online").': | ' . $data['user_online'] . ' |
' . $app->lng("System load 1 minute") . ': | ' . $data['load_1'] . ' |
' . $app->lng("System load 5 minutes") . ': | ' . $data['load_5'] . ' |
'.$app->lng("System load 15 minutes").': | ' . $data['load_15'] . ' |
'.$app->lng("no_data_serverload_txt").'
'; } return $html; } function showDiskUsage () { global $app; /* fetch the Data from the DB */ $record = $app->db->queryOneRecord("SELECT data, state FROM monitor_data WHERE type = 'disk_usage' and server_id = " . $_SESSION['monitor']['server_id'] . " order by created desc"); if(isset($record['data'])) { $data = unserialize($record['data']); /* Format the data */ $html = ''.$app->lng("monitor_diskusage_filesystem_txt").' | '.$app->lng("monitor_diskusage_type_txt").' | '.$app->lng("monitor_diskusage_size_txt").' | '.$app->lng("monitor_diskusage_used_txt").' | '.$app->lng("monitor_diskusage_available_txt").' | '.$app->lng("monitor_diskusage_usage_txt").' | '.$app->lng("monitor_diskusage_mounted_txt").' |
' . $item . ' | '; } $html .= '
'.$app->lng("no_data_diskusage_txt").'
'; } return $html; } function showDatabaseSize () { global $app; /* fetch the Data from the DB */ $record = $app->db->queryOneRecord("SELECT data, state FROM monitor_data WHERE type = 'database_size' and server_id = " . $_SESSION['monitor']['server_id'] . " order by created desc"); if(isset($record['data'])) { $data = unserialize($record['data']); /* Format the data */ $html = ''.$app->lng("monitor_database_name_txt").' | '.$app->lng("monitor_database_size_txt").' | '.$app->lng("monitor_database_client_txt").' |
' . $item . ' | '; } $html .= '
'.$app->lng("no_data_database_size_txt").'
'; } return $html; } function showMemUsage () { global $app; /* fetch the Data from the DB */ $record = $app->db->queryOneRecord("SELECT data, state FROM monitor_data WHERE type = 'mem_usage' and server_id = " . $_SESSION['monitor']['server_id'] . " order by created desc"); if(isset($record['data'])) { $data = unserialize($record['data']); /* Format the data */ $html = '' . $key . ': | ' . $value . ' |
'.$app->lng("no_data_memusage_txt").'
'; } return $html; } function showCpuInfo () { global $app; /* fetch the Data from the DB */ $record = $app->db->queryOneRecord("SELECT data, state FROM monitor_data WHERE type = 'cpu_info' and server_id = " . $_SESSION['monitor']['server_id'] . " order by created desc"); if(isset($record['data'])) { $data = unserialize($record['data']); /* Format the data */ $html = '' . $key . ': | ' . $value . ' |
'.$app->lng("no_data_cpuinfo_txt").'
'; } return $html; } function showServices () { global $app; /* fetch the Data from the DB */ $record = $app->db->queryOneRecord("SELECT data, state FROM monitor_data WHERE type = 'services' and server_id = " . $_SESSION['monitor']['server_id'] . " order by created desc"); if(isset($record['data'])) { $data = unserialize($record['data']); /* Format the data */ $html = ''.$app->lng("monitor_services_web_txt").' | '.$status.' |
'.$app->lng("monitor_services_ftp_txt").' | '.$status.' |
'.$app->lng("monitor_services_smtp_txt").' | '.$status.' |
'.$app->lng("monitor_services_pop_txt").' | '.$status.' |
'.$app->lng("monitor_services_imap_txt").' | '.$status.' |
'.$app->lng("monitor_services_mydns_txt").' | '.$status.' |
'.$app->lng("monitor_services_mysql_txt").' | '.$status.' |
'.$app->lng("no_data_services_txt").'
'; } return $html; } function showSystemUpdate() { global $app; /* fetch the Data from the DB */ $record = $app->db->queryOneRecord("SELECT data, state FROM monitor_data WHERE type = 'system_update' and server_id = " . $_SESSION['monitor']['server_id'] . " order by created desc"); if(isset($record['data'])) { $html = ''.$app->lng("monitor_updates_nosupport_txt").'
'; } else { $data = unserialize($record['data']); $html .= nl2br(html_entity_decode($data['output'])); } $html .= ''.$app->lng("no_data_updates_txt").'
'; } return $html; } function showOpenVzBeancounter() { global $app; /* fetch the Data from the DB */ $record = $app->db->queryOneRecord("SELECT data, state FROM monitor_data WHERE type = 'openvz_beancounter' and server_id = " . $_SESSION['monitor']['server_id'] . " order by created desc"); if(isset($record['data'])) { $html = ''.$app->lng("monitor_beancounter_nosupport_txt").'
'; } else { $html .= '' . nl2br($data) . ''; } $html .= '
'.$app->lng("no_data_updates_txt").'
'; } return $html; } function showRaidState() { global $app; /* fetch the Data from the DB */ $record = $app->db->queryOneRecord("SELECT data, state FROM monitor_data WHERE type = 'raid_state' and server_id = " . $_SESSION['monitor']['server_id'] . " order by created desc"); if(isset($record['data'])) { $html = ''.$app->lng("monitor_nosupportedraid1_txt").'
'; } else { $data = unserialize($record['data']); // improve view @Author'.$app->lng("no_data_raid_txt").'
'; } return $html; } function showRKHunter() { global $app; /* fetch the Data from the DB */ $record = $app->db->queryOneRecord("SELECT data, state FROM monitor_data WHERE type = 'rkhunter' and server_id = " . $_SESSION['monitor']['server_id'] . " order by created desc"); if(isset($record['data'])) { $html = ''.$app->lng("monitor_norkhunter_txt").'
'; } else { $html .= nl2br($data['output']); } $html .= ''.$app->lng("no_data_rkhunter_txt").'
'; } return $html; } function showFail2ban() { global $app; /* fetch the Data from the DB */ $record = $app->db->queryOneRecord("SELECT data, state FROM monitor_data WHERE type = 'log_fail2ban' and server_id = " . $_SESSION['monitor']['server_id'] . " order by created desc"); if(isset($record['data'])) { $html = ''.
'fail2ban is not installed at this server.
' .
'See more (for debian) here...'.
'
There is no data available at the moment.
'; } return $html; } function showMongoDB() { global $app; /* fetch the Data from the DB */ $record = $app->db->queryOneRecord("SELECT data, state FROM monitor_data WHERE type = 'log_mongodb' and server_id = " . $_SESSION['monitor']['server_id'] . " order by created desc"); if(isset($record['data'])) { $html = ''.
'MongoDB is not installed at this server.
' .
'See more (for debian) here...'.
'
There is no data available at the moment.
'; } return $html; } function showIPTables() { global $app; $record = $app->db->queryOneRecord("SELECT data, state FROM monitor_data WHERE type = 'iptables_rules' and server_id = " . $_SESSION['monitor']['server_id'] . " order by created desc"); if(isset($record['data'])) { $html = 'Problem, there are no rules listed for the server
'; } else { $html .= nl2br($data['output']); } $html .= 'There is no data available at the moment.
'; } return $html; } function showMailq() { global $app; /* fetch the Data from the DB */ $record = $app->db->queryOneRecord("SELECT data, state FROM monitor_data WHERE type = 'mailq' and server_id = " . $_SESSION['monitor']['server_id'] . " order by created desc"); if(isset($record['data'])) { $data = unserialize($record['data']); $html = nl2br($data['output']); } else { $html = ''.$app->lng("no_data_mailq_txt").'
'; } return $html; } function getDataTime($type) { global $app; /* fetch the Data from the DB */ $record = $app->db->queryOneRecord("SELECT created FROM monitor_data WHERE type = '" . $type . "' and server_id = " . $_SESSION['monitor']['server_id'] . " order by created desc"); /* TODO: datetimeformat should be set somewhat other way */ $dateTimeFormat = $app->lng("monitor_settings_datetimeformat_txt"); if(isset($record['created'])) { // $res = date('Y-m-d H:i', $record['created']); $res = date($dateTimeFormat, $record['created']); } else { $res = '????-??-?? ??:??'; } return $res; } } ?>