Commit 7e35246c authored by Antennipasi's avatar Antennipasi
Browse files

Added more translations to monitor-module.

parent 14716cae
......@@ -12,6 +12,10 @@ $wb['no_data_memusage_txt'] = 'No data about the memory usage available at the m
$wb['no_data_diskusage_txt'] = 'No data about the disk usage available at the moment. Please check again later.';
$wb['no_data_cpuinfo_txt'] = 'No data about the CPU available at the moment. Please check again later.';
$wb['no_data_services_txt'] = 'No data about the services available at the moment. Please check again later.';
$wb['no_data_updates_txt'] = 'No data about updates available at the moment. Please check again later.';
$wb['no_data_raid_txt'] = 'No data about RAID available at the moment. Please check again later.';
$wb['no_data_rkhunter_txt'] = 'No data about RKHunter available at the moment. Please check again later.';
$wb['no_data_mailq_txt'] = 'No data Mailqueue available at the moment. Please check again later.';
$wb['no_logdata_txt'] = 'No log data available at the moment. Please check again later.';
$wb['Monitoring'] = 'Monitoring';
$wb['Server to Monitor'] = 'Server to Monitor';
......@@ -41,4 +45,30 @@ $wb['Show Clamav-Log'] = 'Show Clamav-Log';
$wb['Show ISPConfig-Log'] = 'Show ISPConfig-Log';
$wb['Show RKHunter-Log'] = 'Show RKHunter-Log';
$wb['Show Jobqueue'] = 'Show Jobqueue';
?>
\ No newline at end of file
$wb['monitor_diskusage_filesystem_txt'] = 'Filesystem';
$wb['monitor_diskusage_type_txt'] = 'Type';
$wb['monitor_diskusage_size_txt'] = 'Size';
$wb['monitor_diskusage_used_txt'] = 'Used';
$wb['monitor_diskusage_available_txt'] = 'Available';
$wb['monitor_diskusage_usage_txt'] = 'Use%';
$wb['monitor_diskusage_mounted_txt'] = 'Mounted on';
$wb['monitor_nomdadm_txt'] = 'mdadm is not installed or your Server has no supported RAID';
$wb['monitor_norkhunter_txt'] = 'RKHunter is not installed, so there is no log data';
$wb['monitor_services_online_txt'] = 'Online';
$wb['monitor_services_offline_txt'] = 'Offline';
$wb['monitor_services_web_txt'] = 'Web-Server:';
$wb['monitor_services_ftp_txt'] = 'FTP-Server:';
$wb['monitor_services_smtp_txt'] = 'SMTP-Server:';
$wb['monitor_services_pop_txt'] = 'POP3-Server:';
$wb['monitor_services_imap_txt'] = 'IMAP-Server:';
$wb['monitor_services_mydns_txt'] = 'myDNS-Server:';
$wb['monitor_services_mysql_txt'] = 'mySQL-Server:';
$wb['monitor_settings_datafromdate_txt'] = 'Data from: ';
$wb['monitor_settings_datetimeformat_txt'] = 'Y-m-d H:i';
$wb['monitor_settings_server_txt'] = 'Server: ';
$wb['monitor_title_updatestate_txt'] = 'Update State';
$wb['monitor_title_mailq_txt'] = 'Mailqueue';
$wb['monitor_title_raidstate_txt'] = 'RAID-State';
$wb['monitor_title_rkhunterlog_txt'] = 'RKHunter-Log';
$wb['monitor_updates_nosupport_txt'] = 'Your distribution is not supported for this monitoring';
?>
......@@ -12,7 +12,11 @@ $wb['no_data_memusage_txt'] = 'Tietoja muistin käytöstä ei ole tällä hetkel
$wb['no_data_diskusage_txt'] = 'Tietoja levytilan käytöstä ei ole tällä hetkellä saatavana. Yritä myöhemmin uudelleen.';
$wb['no_data_cpuinfo_txt'] = 'Tietoja prosessorin kuormasta ei ole tällä hetkellä saatavana. Yritä myöhemmin uudelleen.';
$wb['no_data_services_txt'] = 'Tietoja palveluiden tilasta ei ole tällä hetkellä saatavana. Yritä myöhemmin uudelleen.';
$wb['no_logdata_txt'] = 'Lokiietoja ei ole tällä hetkellä saatavana. Yritä myöhemmin uudelleen.';
$wb['no_data_updates_txt'] = 'Tietoja päivitysten tilasta ei ole tällä hetkellä saatavana. Yritä myöhemmin uudelleen.';
$wb['no_data_raid_txt'] = 'Tietoja RAID-laitteiden tilasta ei ole tällä hetkellä saatavana. Yritä myöhemmin uudelleen.';
$wb['no_data_rkhunter_txt'] = 'Tietoja RKHunter-tuloksista ei ole tällä hetkellä saatavana. Yritä myöhemmin uudelleen.';
$wb['no_data_mailq_txt'] = 'Tietoja postipalvelimen jonosta ei ole tällä hetkellä saatavana. Yritä myöhemmin uudelleen.';
$wb['no_logdata_txt'] = 'Lokitietoja ei ole tällä hetkellä saatavana. Yritä myöhemmin uudelleen.';
$wb['Monitoring'] = 'Valvonta';
$wb['Server to Monitor'] = 'Mitä palvelinta valvotaan';
$wb['Logfiles'] = 'Lokitiedostot';
......@@ -41,5 +45,30 @@ $wb['Show ISPConfig-Log'] = 'Näytä ISPConfig-Loki';
$wb['Show ISPC Cron-Log'] = 'Näytä ISPC Cron-Loki';
$wb['Show RKHunter-Log'] = 'Näytä RKHunter-Loki';
$wb['Show Jobqueue'] = 'Näytä työjono';
$wb['monitor_diskusage_filesystem_txt'] = 'Levyosio';
$wb['monitor_diskusage_type_txt'] = 'Tyyppi';
$wb['monitor_diskusage_size_txt'] = 'Koko';
$wb['monitor_diskusage_used_txt'] = 'Käytetty';
$wb['monitor_diskusage_available_txt'] = 'Vapaana';
$wb['monitor_diskusage_usage_txt'] = 'Käyttöaste';
$wb['monitor_diskusage_mounted_txt'] = 'Liitospiste';
$wb['monitor_nomdadm_txt'] = 'mdadm ei ole asennettuna tai palelimessasi ei ole tuettuja RAID-laitteita.';
$wb['monitor_norkhunter_txt'] = 'RKHunter ei ole asennettuna, joten siitä ei ole tulostietoja.';
$wb['monitor_services_online_txt'] = 'Käynnissä';
$wb['monitor_services_offline_txt'] = 'Sammuksissa';
$wb['monitor_services_web_txt'] = 'WWW-palvelin:';
$wb['monitor_services_ftp_txt'] = 'FTP-palvelin:';
$wb['monitor_services_smtp_txt'] = 'SMTP-palvelin:';
$wb['monitor_services_pop_txt'] = 'POP3-palvelin:';
$wb['monitor_services_imap_txt'] = 'IMAP-palvelin:';
$wb['monitor_services_mydns_txt'] = 'myDNS-palvelin:';
$wb['monitor_services_mysql_txt'] = 'mySQL-palvelin:';
$wb['monitor_settings_datetimeformat_txt'] = 'd.m.Y H:i';
$wb['monitor_settings_datafromdate_txt'] = 'Tietojen päiväys: ';
$wb['monitor_settings_server_txt'] = 'Palvelin: ';
$wb['monitor_title_updatestate_txt'] = 'Päivitysten tila';
$wb['monitor_title_mailq_txt'] = 'Sähköpostijono';
$wb['monitor_title_raidstate_txt'] = 'RAID-laitteiden tila';
$wb['monitor_title_rkhunterlog_txt'] = 'RKHunter-tulokset';
$wb['monitor_updates_nosupport_txt'] = 'Käyttämäsi Linux-jakelu ei tue päivitysten valvontaa.';
?>
......@@ -39,6 +39,11 @@ $app->auth->check_module_permissions('monitor');
/* Get the dataType to show */
$dataType = $_GET["type"];
/* Get some translations */
$monTransDate = $app->lng("monitor_settings_datafromdate_txt");
$monTransSrv = $app->lng("monitor_settings_server_txt");
$output = '';
switch($dataType) {
......@@ -46,63 +51,63 @@ switch($dataType) {
$template = 'templates/show_data.htm';
$output .= showServerLoad();
$time = getDataTime('server_load');
$title = $app->lng("Server Load").' (Server: ' . $_SESSION['monitor']['server_name'] . ')';
$title = $app->lng("Server Load").' ('. $monTransSrv .' : ' . $_SESSION['monitor']['server_name'] . ')';
$description = '';
break;
case 'disk_usage':
$template = 'templates/show_data.htm';
$output .= showDiskUsage();
$time = getDataTime('disk_usage');
$title = $app->lng("Disk usage").' (Server: ' . $_SESSION['monitor']['server_name'] . ')';
$title = $app->lng("Disk usage").' ('. $monTransSrv .' : ' . $_SESSION['monitor']['server_name'] . ')';
$description = '';
break;
case 'mem_usage':
$template = 'templates/show_data.htm';
$output .= showMemUsage();
$time = getDataTime('mem_usage');
$title = $app->lng("Memory usage").' (Server: ' . $_SESSION['monitor']['server_name'] . ')';
$title = $app->lng("Memory usage").' ('. $monTransSrv .' : ' . $_SESSION['monitor']['server_name'] . ')';
$description = '';
break;
case 'cpu_info':
$template = 'templates/show_data.htm';
$output .= showCpuInfo();
$time = getDataTime('cpu_info');
$title = $app->lng("CPU info").' (Server: ' . $_SESSION['monitor']['server_name'] . ')';
$title = $app->lng("CPU info").' ('. $monTransSrv .' : ' . $_SESSION['monitor']['server_name'] . ')';
$description = '';
break;
case 'services':
$template = 'templates/show_data.htm';
$output .= showServices();
$time = getDataTime('services');
$title = $app->lng("Status of services").' (Server: ' . $_SESSION['monitor']['server_name'] . ')';
$title = $app->lng("Status of services").' ('. $monTransSrv .' : ' . $_SESSION['monitor']['server_name'] . ')';
$description = '';
break;
case 'system_update':
$template = 'templates/show_data.htm';
$output .= showSystemUpdate();
$time = getDataTime('system_update');
$title = "Update State" . ' (Server: ' . $_SESSION['monitor']['server_name'] . ')';
$title = $app->lng("monitor_title_updatestate_txt"). ' ('. $monTransSrv .' : ' . $_SESSION['monitor']['server_name'] . ')';
$description = '';
break;
case 'mailq':
$template = 'templates/show_data.htm';
$output .= showMailq();
$time = getDataTime('mailq');
$title = "Mailq" . ' (Server: ' . $_SESSION['monitor']['server_name'] . ')';
$title = $app->lng("monitor_title_mailq_txt"). ' ('. $monTransSrv .' : ' . $_SESSION['monitor']['server_name'] . ')';
$description = '';
break;
case 'raid_state':
$template = 'templates/show_data.htm';
$output .= showRaidState();
$time = getDataTime('raid_state');
$title = "RAID-State" . ' (Server: ' . $_SESSION['monitor']['server_name'] . ')';
$title = $app->lng("monitor_title_raidstate_txt"). ' ('. $monTransSrv .' : ' . $_SESSION['monitor']['server_name'] . ')';
$description = '';
break;
case 'rkhunter':
$template = 'templates/show_data.htm';
$output .= showRKHunter();
$time = getDataTime('rkhunter');
$title = "RKHunter-Log" . ' (Server: ' . $_SESSION['monitor']['server_name'] . ')';
$title = $app->lng("monitor_title_rkhunterlog_txt"). ' ('. $monTransSrv .' : ' . $_SESSION['monitor']['server_name'] . ')';
$description = '';
break;
default:
......@@ -120,7 +125,8 @@ $app->tpl->setVar("output", $output);
$app->tpl->setVar("title", $title);
$app->tpl->setVar("description", $description);
$app->tpl->setVar("time", $time);
$app->tpl->setVar("monTransDate", $monTransDate);
$app->tpl_defaults();
$app->tpl->pparse();
?>
\ No newline at end of file
?>
......@@ -71,7 +71,7 @@ $app->tpl->setVar("description",$description);
/*
Creating the array with the refresh intervals
Attention: the core-moule ist triggered every 5 minutes,
Attention: the core-module ist triggered every 5 minutes,
so reload every 2 minutes is impossible!
*/
$refresh = (isset($_GET["refresh"]))?intval($_GET["refresh"]):0;
......@@ -505,4 +505,4 @@ function _setState($oldState, $newState)
}
}
?>
\ No newline at end of file
?>
......@@ -3,7 +3,7 @@
<div class="panel panel_system">
<div class="pnl_formarea">
<fieldset><legend>Data from: <tmpl_var name="time"></legend>
<fieldset><legend><tmpl_var name="monTransDate"><tmpl_var name="time"></legend>
<div class="systemmonitor"><tmpl_var name="output"></div>
</fieldset>
</div>
......
......@@ -89,12 +89,13 @@ function showDiskUsage () {
<div class="systemmonitor-content icons32 ico-'.$record['state'].'">
<table>
<tr>
<td>Filesystem</td>
<td>1K-blocks</td>
<td>Used</td>
<td>Available</td>
<td>Use%</td>
<td>Mounted on</td>
<td>'.$app->lng("monitor_diskusage_filesystem_txt").'</td>
<td>'.$app->lng("monitor_diskusage_type_txt").'</td>
<td>'.$app->lng("monitor_diskusage_size_txt").'</td>
<td>'.$app->lng("monitor_diskusage_used_txt").'</td>
<td>'.$app->lng("monitor_diskusage_available_txt").'</td>
<td>'.$app->lng("monitor_diskusage_usage_txt").'</td>
<td>'.$app->lng("monitor_diskusage_mounted_txt").'</td>
</tr>';
foreach($data as $line) {
$html .= '<tr>';
......@@ -204,12 +205,12 @@ function showServices ()
if($data['webserver'] != -1) {
if($data['webserver'] == 1) {
$status = '<span class="online">Online</span>';
$status = '<span class="online">'.$app->lng("monitor_services_online_txt").'</span>';
} else {
$status = '<span class="offline">Offline</span>';
$status = '<span class="offline">'.$app->lng("monitor_services_offline_txt").'</span>';
}
$html .= '<tr>
<td>Web-Server:</td>
<td>'.$app->lng("monitor_services_web_txt").'</td>
<td>'.$status.'</td>
</tr>';
}
......@@ -217,72 +218,72 @@ function showServices ()
if($data['ftpserver'] != -1) {
if($data['ftpserver'] == 1) {
$status = '<span class="online">Online</span>';
$status = '<span class="online">'.$app->lng("monitor_services_online_txt").'</span>';
} else {
$status = '<span class="offline">Offline</span>';
$status = '<span class="offline">'.$app->lng("monitor_services_offline_txt").'</span>';
}
$html .= '<tr>
<td>FTP-Server:</td>
<td>'.$app->lng("monitor_services_ftp_txt").'</td>
<td>'.$status.'</td>
</tr>';
}
if($data['smtpserver'] != -1) {
if($data['smtpserver'] == 1) {
$status = '<span class="online">Online</span>';
$status = '<span class="online">'.$app->lng("monitor_services_online_txt").'</span>';
} else {
$status = '<span class="offline">Offline</span>';
$status = '<span class="offline">'.$app->lng("monitor_services_offline_txt").'</span>';
}
$html .= '<tr>
<td>SMTP-Server:</td>
<td>'.$app->lng("monitor_services_smtp_txt").'</td>
<td>'.$status.'</td>
</tr>';
}
if($data['pop3server'] != -1) {
if($data['pop3server'] == 1) {
$status = '<span class="online">Online</span>';
$status = '<span class="online">'.$app->lng("monitor_services_online_txt").'</span>';
} else {
$status = '<span class="offline">Offline</span>';
$status = '<span class="offline">'.$app->lng("monitor_services_offline_txt").'</span>';
}
$html .= '<tr>
<td>POP3-Server:</td>
<td>'.$app->lng("monitor_services_pop_txt").'</td>
<td>'.$status.'</td>
</tr>';
}
if($data['imapserver'] != -1) {
if($data['imapserver'] == 1) {
$status = '<span class="online">Online</span>';
$status = '<span class="online">'.$app->lng("monitor_services_online_txt").'</span>';
} else {
$status = '<span class="offline">Offline</span>';
$status = '<span class="offline">'.$app->lng("monitor_services_offline_txt").'</span>';
}
$html .= '<tr>
<td>IMAP-Server:</td>
<td>'.$app->lng("monitor_services_imap_txt").'</td>
<td>'.$status.'</td>
</tr>';
}
if($data['bindserver'] != -1) {
if($data['bindserver'] == 1) {
$status = '<span class="online">Online</span>';
$status = '<span class="online">'.$app->lng("monitor_services_online_txt").'</span>';
} else {
$status = '<span class="offline">Offline</span>';
$status = '<span class="offline">'.$app->lng("monitor_services_offline_txt").'</span>';
}
$html .= '<tr>
<td>DNS-Server:</td>
<td>'.$app->lng("monitor_services_mydns_txt").'</td>
<td>'.$status.'</td>
</tr>';
}
if($data['mysqlserver'] != -1) {
if($data['mysqlserver'] == 1) {
$status = '<span class="online">Online</span>';
$status = '<span class="online">'.$app->lng("monitor_services_online_txt").'</span>';
} else {
$status = '<span class="offline">Offline</span>';
$status = '<span class="offline">'.$app->lng("monitor_services_offline_txt").'</span>';
}
$html .= '<tr>
<td>mySQL-Server:</td>
<td>'.$app->lng("monitor_services_mysql_txt").'</td>
<td>'.$status.'</td>
</tr>';
}
......@@ -313,7 +314,7 @@ function showSystemUpdate()
* If not (because the destribution is not supported) show this.
*/
if ($record['state'] == 'no_state'){
$html .= "Your distribution is not supported for this monitoring";
$html .= '<p>'.$app->lng("monitor_updates_nosupport_txt").'</p>';
}
else {
$data = unserialize($record['data']);
......@@ -321,7 +322,7 @@ function showSystemUpdate()
}
$html .= '</div></div>';
} else {
$html = '<p>' . "No Update-Data available" . '</p>';
$html = '<p>'.$app->lng("no_data_updates_txt").'</p>';
}
return $html;
......@@ -344,7 +345,7 @@ function showRaidState()
* If not (because the destribution is not supported) show this.
*/
if ($record['state'] == 'no_state'){
$html .= '<p>' . "mdadm ist not installed or your Server has no supported RAID" . '</p>';
$html .= '<p>'.$app->lng("monitor_nomdadm_txt").'</p>';
}
else {
$data = unserialize($record['data']);
......@@ -353,7 +354,7 @@ function showRaidState()
$html .= '</div></div>';
} else {
$html = '<p>' . "No RAID-Data available" . '</p>';
$html = '<p>'.$app->lng("no_data_raid_txt").'</p>';
}
return $html;
......@@ -377,7 +378,7 @@ function showRKHunter()
*/
$data = unserialize($record['data']);
if ($data['output'] == ''){
$html .= '<p>' . "rkhunter ist not installed, so there is no log data" . '</p>';
$html .= '<p>'.$app->lng("monitor_norkhunter_txt").'</p>';
}
else {
$html .= nl2br($data['output']);
......@@ -385,7 +386,7 @@ function showRKHunter()
$html .= '</div></div>';
} else {
$html = '<p>' . "No RKHunter-Data available" . '</p>';
$html = '<p>'.$app->lng("no_data_rkhunter_txt").'</p>';
}
return $html;
......@@ -402,7 +403,7 @@ function showMailq()
$data = unserialize($record['data']);
$html = nl2br($data['output']);
} else {
$html = '<p>' . "No Mailq-Data available" . '</p>';
$html = '<p>'.$app->lng("no_data_mailq_txt").'</p>';
}
return $html;
......@@ -414,8 +415,12 @@ function getDataTime($type) {
/* 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('Y-m-d H:i', $record['created']);
$res = date($dateTimeFormat, $record['created']);
} else {
$res = '????-??-?? ??:??';
}
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment