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 */ $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'] . '
'; } else { $html = '

'.$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 = '
'; foreach($data as $line) { $html .= ''; foreach ($line as $item) { $html .= ''; } $html .= ''; } $html .= '
Filesystem 1K-blocks Used Available Use% Mounted on
' . $item . '
'; $html .= '
'; } else { $html = '

'.$app->lng("no_data_diskusage_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 = '
'; foreach($data as $key => $value){ if ($key != '') { $html .= ''; } } $html .= '
' . $key . ': ' . $value . '
'; $html .= '
'; } else { $html = '

'.$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 = '
'; foreach($data as $key => $value){ if ($key != '') { $html .= ''; } } $html .= '
' . $key . ': ' . $value . '
'; $html .= '
'; } else { $html = '

'.$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 = '
'; if($data['webserver'] != -1) { if($data['webserver'] == 1) { $status = 'Online'; } else { $status = 'Offline'; } $html .= ''; } if($data['ftpserver'] != -1) { if($data['ftpserver'] == 1) { $status = 'Online'; } else { $status = 'Offline'; } $html .= ''; } if($data['smtpserver'] != -1) { if($data['smtpserver'] == 1) { $status = 'Online'; } else { $status = 'Offline'; } $html .= ''; } if($data['pop3server'] != -1) { if($data['pop3server'] == 1) { $status = 'Online'; } else { $status = 'Offline'; } $html .= ''; } if($data['imapserver'] != -1) { if($data['imapserver'] == 1) { $status = 'Online'; } else { $status = 'Offline'; } $html .= ''; } if($data['bindserver'] != -1) { if($data['bindserver'] == 1) { $status = 'Online'; } else { $status = 'Offline'; } $html .= ''; } if($data['mysqlserver'] != -1) { if($data['mysqlserver'] == 1) { $status = 'Online'; } else { $status = 'Offline'; } $html .= ''; } $html .= '
Web-Server: '.$status.'
FTP-Server: '.$status.'
SMTP-Server: '.$status.'
POP3-Server: '.$status.'
IMAP-Server: '.$status.'
DNS-Server: '.$status.'
mySQL-Server: '.$status.'
'; } else { $html = '

'.$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 = '
'; /* * First, we have to detect, if there is any monitoring-data. * If not (because the destribution is not supported) show this. */ if ($record['state'] == 'no_state'){ $html .= "Your distribution is not supported for this monitoring"; } else { $data = unserialize($record['data']); $html .= nl2br($data['output']); } $html .= '
'; } else { $html = '

' . "No Update-Data available" . '

'; } 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 = '
'; /* * First, we have to detect, if there is any monitoring-data. * If not (because the destribution is not supported) show this. */ if ($record['state'] == 'no_state'){ $html .= '

' . "mdadm ist not installed or your Server has no supported RAID" . '

'; } else { $data = unserialize($record['data']); $html .= nl2br($data['output']); } $html .= '
'; } else { $html = '

' . "No RAID-Data available" . '

'; } 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 = '

' . "No Mailq-Data available" . '

'; } return $html; } ?>