From 8793b32c8e8745e04571a30735b210f68b23ef92 Mon Sep 17 00:00:00 2001
From: vogelor <vogelor@ispconfig3>
Date: Mon, 24 Nov 2008 17:51:48 +0000
Subject: [PATCH] Monitor Module now only shows the state of the "active"
 services Monitor Module now has system state

---
 install/sql/ispconfig3.sql                    |    7 +-
 interface/web/monitor/lib/module.conf.php     |  142 +-
 interface/web/monitor/show_data.php           |  305 +---
 interface/web/monitor/show_log.php            |    1 -
 interface/web/monitor/show_sys_state.php      |  365 ++++
 .../web/monitor/templates/show_sys_state.htm  |   19 +
 interface/web/monitor/tools.inc.php           |  244 +++
 .../default/css/screen/content_ispc.css       |   73 +-
 .../default/icons/x32/state_critical.png      |  Bin 0 -> 2409 bytes
 .../themes/default/icons/x32/state_error.png  |  Bin 0 -> 2212 bytes
 .../themes/default/icons/x32/state_info.png   |  Bin 0 -> 2184 bytes
 .../web/themes/default/icons/x32/state_ok.png |  Bin 0 -> 1518 bytes
 .../default/icons/x32/state_unknown.png       |  Bin 0 -> 2832 bytes
 .../default/icons/x32/state_warning.png       |  Bin 0 -> 1931 bytes
 .../web/themes/default/icons/x64/network.png  |  Bin 0 -> 7481 bytes
 .../web/themes/default/icons/x64/server.png   |  Bin 0 -> 6880 bytes
 .../monitor_core_module.inc.php               | 1552 +++++++++--------
 17 files changed, 1659 insertions(+), 1049 deletions(-)
 create mode 100644 interface/web/monitor/show_sys_state.php
 create mode 100644 interface/web/monitor/templates/show_sys_state.htm
 create mode 100644 interface/web/monitor/tools.inc.php
 create mode 100644 interface/web/themes/default/icons/x32/state_critical.png
 create mode 100644 interface/web/themes/default/icons/x32/state_error.png
 create mode 100644 interface/web/themes/default/icons/x32/state_info.png
 create mode 100644 interface/web/themes/default/icons/x32/state_ok.png
 create mode 100644 interface/web/themes/default/icons/x32/state_unknown.png
 create mode 100644 interface/web/themes/default/icons/x32/state_warning.png
 create mode 100644 interface/web/themes/default/icons/x64/network.png
 create mode 100644 interface/web/themes/default/icons/x64/server.png

diff --git a/install/sql/ispconfig3.sql b/install/sql/ispconfig3.sql
index 774b4a0b77..e7ccf33a09 100644
--- a/install/sql/ispconfig3.sql
+++ b/install/sql/ispconfig3.sql
@@ -1102,15 +1102,11 @@ CREATE TABLE `monitor_data` (
   `type` varchar(255) NOT NULL,
   `created` int(11) NOT NULL,
   `data` mediumtext NOT NULL,
-  `state` enum('unknown','ok','warning','critical', 'error') NOT NULL default 'unknown',
+  `state` enum('no_state', 'unknown', 'ok', 'info', 'warning', 'critical', 'error') NOT NULL default 'unknown',
   PRIMARY KEY  (`server_id`,`type`,`created`)
 ) ENGINE=MyISAM DEFAULT CHARSET=latin1;
 
 
-SET FOREIGN_KEY_CHECKS = 1;
-
-
-
 
 # iso_country_list.sql
 #
@@ -1373,6 +1369,7 @@ INSERT INTO country VALUES ('ZM','ZAMBIA','Zambia','ZMB','894');
 INSERT INTO country VALUES ('ZW','ZIMBABWE','Zimbabwe','ZWE','716');
 
 
+SET FOREIGN_KEY_CHECKS = 1;
 
 
 
diff --git a/interface/web/monitor/lib/module.conf.php b/interface/web/monitor/lib/module.conf.php
index d9a78a710d..2a443e3a1c 100644
--- a/interface/web/monitor/lib/module.conf.php
+++ b/interface/web/monitor/lib/module.conf.php
@@ -7,7 +7,17 @@ $module["name"] 		= "monitor";
 $module["title"] 		= "Monitor";
 $module["template"] 	= "module.tpl.htm";
 $module["tab_width"]    = '';
-$module["startpage"] 	= "monitor/show_data.php?type=overview";
+$module["startpage"] 	= "monitor/show_sys_state.php?state=system";
+
+unset($items);
+$items[] = array( 'title' 	=> "Show System State",
+                  'target' 	=> 'content',
+                  'link'	=> 'monitor/show_sys_state.php?state=system');
+
+$module["nav"][] = array(	'title'	=> 'System State',
+                            'open' 	=> 1,
+                            'items'	=> $items);
+
 
 /*
  We need all the available servers on the left navigation.
@@ -15,24 +25,25 @@ $module["startpage"] 	= "monitor/show_data.php?type=overview";
 */
 $servers = $app->db->queryAllRecords("SELECT server_id, server_name FROM server order by server_name");
 
-$dropDown = "<select id='server_id' onchange=\"loadContent('monitor/show_data.php?type=overview&server=' + document.getElementById('server_id').value);\">";
+$dropDown = "<select id='server_id' onchange=\"loadContent('monitor/show_sys_state.php?state=server&server=' + document.getElementById('server_id').value);\">";
 foreach ($servers as $server)
 {
-  $dropDown .= "<option value='" . $server['server_id'] . "|" . $server['server_name'] . "'>" . $server['server_name'] . "</option>";
+    $dropDown .= "<option value='" . $server['server_id'] . "|" . $server['server_name'] . "'>" . $server['server_name'] . "</option>";
 }
 $dropDown .= "</select>";
 
 /*
  Now add them as dropdown to the navigation
  */
+unset($items);
 $items[] = array( 'title' 	=> $dropDown,
-		'target' 	=> '', // no action!
-		'link'	=> '');   // no action!
+        'target' 	=> '', // no action!
+        'link'	=> '');   // no action!
 
 $module["nav"][] = array(	'title'	=> 'Server to Monitor',
-		'open' 	=> 1,
-		'items'	=> $items);
-		
+        'open' 	=> 1,
+        'items'	=> $items);
+
 /*
   The first Server at the list is the server first selected
  */
@@ -40,83 +51,90 @@ $_SESSION['monitor']['server_id']   = $servers[0]['server_id'];
 $_SESSION['monitor']['server_name'] = $servers[0]['server_name'];
 
 /*
-	Logmonitoring module
-*/
-// aufräumen
+ * Logmonitoring module
+ */
+
+/*
+ * Clear and set the Navigation-Items
+ */
 unset($items);
-$items[] = array( 'title' 	=> "Server Load",
-				  'target' 	=> 'content',
-				  'link'	=> 'monitor/show_data.php?type=server_load');
+$items[] = array( 'title' 	=> "Show Server State",
+                  'target' 	=> 'content',
+                  'link'	=> 'monitor/show_sys_state.php?state=server');
+
+$items[] = array( 'title' 	=> "Show Server Load",
+                  'target' 	=> 'content',
+                  'link'	=> 'monitor/show_data.php?type=server_load');
 
-$items[] = array( 'title' 	=> "Disk usage",
-				  'target' 	=> 'content',
-				  'link'	=> 'monitor/show_data.php?type=disk_usage');
+$items[] = array( 'title' 	=> "Show Disk usage",
+                  'target' 	=> 'content',
+                  'link'	=> 'monitor/show_data.php?type=disk_usage');
 
-$items[] = array( 'title' 	=> "Memory usage",
-				  'target' 	=> 'content',
-				  'link'	=> 'monitor/show_data.php?type=mem_usage');
+$items[] = array( 'title' 	=> "Show Memory usage",
+                  'target' 	=> 'content',
+                  'link'	=> 'monitor/show_data.php?type=mem_usage');
 
-$items[] = array( 'title' 	=> "Services",
-				  'target' 	=> 'content',
-				  'link'	=> 'monitor/show_data.php?type=services');
+$items[] = array( 'title' 	=> "Show Services",
+                  'target' 	=> 'content',
+                  'link'	=> 'monitor/show_data.php?type=services');
 
 
 $module["nav"][] = array(	'title'	=> 'Monitoring',
-							'open' 	=> 1,
-							'items'	=> $items);
+                            'open' 	=> 1,
+                            'items'	=> $items);
 
-// aufräumen
+/*
+ * Clear and set the Navigation-Items
+ */
 unset($items);
 
-$items[] = array( 'title' 	=> "CPU",
-		'target' 	=> 'content',
-		'link'	=> 'monitor/show_data.php?type=cpu_info');
+$items[] = array( 'title' 	=> "Show CPU info",
+        'target' 	=> 'content',
+        'link'	=> 'monitor/show_data.php?type=cpu_info');
 
 $module["nav"][] = array(	'title'	=> 'System-Information',
-		'open' 	=> 1,
-		'items'	=> $items);
-
-// aufräumen
-unset($items);
+        'open' 	=> 1,
+        'items'	=> $items);
 
+/*
+ *   Logmonitoring module
+ */
 
 /*
-	Logmonitoring module
-*/
+ * Clear and set the Navigation-Items
+ */
+unset($items);
 
-$items[] = array( 'title' 	=> "Mail log",
-				  'target' 	=> 'content',
-				  'link'	=> 'monitor/show_log.php?log=log_mail');
+$items[] = array( 'title' 	=> "Show Mail-Log",
+                  'target' 	=> 'content',
+                  'link'	=> 'monitor/show_log.php?log=log_mail');
 
-$items[] = array( 'title' 	=> "Mail warn",
-				  'target' 	=> 'content',
-				  'link'	=> 'monitor/show_log.php?log=log_mail_warn');
+$items[] = array( 'title' 	=> "Show Mail warn-Log",
+                  'target' 	=> 'content',
+                  'link'	=> 'monitor/show_log.php?log=log_mail_warn');
 
-$items[] = array( 'title' 	=> "Mail err",
-				  'target' 	=> 'content',
-				  'link'	=> 'monitor/show_log.php?log=log_mail_err');
+$items[] = array( 'title' 	=> "Show Mail err-Log",
+                  'target' 	=> 'content',
+                  'link'	=> 'monitor/show_log.php?log=log_mail_err');
 
-$items[] = array( 'title' 	=> "Messages",
-				  'target' 	=> 'content',
-				  'link'	=> 'monitor/show_log.php?log=log_messages');
+$items[] = array( 'title' 	=> "Show Messages-Log",
+                  'target' 	=> 'content',
+                  'link'	=> 'monitor/show_log.php?log=log_messages');
 
-$items[] = array( 'title' 	=> "Freshclam",
-				  'target' 	=> 'content',
-				  'link'	=> 'monitor/show_log.php?log=log_freshclam');
+$items[] = array( 'title' 	=> "Show Freshclam-Log",
+                  'target' 	=> 'content',
+                  'link'	=> 'monitor/show_log.php?log=log_freshclam');
 
-$items[] = array( 'title' 	=> "Clamav",
-				  'target' 	=> 'content',
-				  'link'	=> 'monitor/show_log.php?log=log_clamav');
+$items[] = array( 'title' 	=> "Show Clamav-Log",
+                  'target' 	=> 'content',
+                  'link'	=> 'monitor/show_log.php?log=log_clamav');
 
-$items[] = array( 'title' 	=> "ISPConfig",
-				  'target' 	=> 'content',
-				  'link'	=> 'monitor/show_log.php?log=log_ispconfig');
+$items[] = array( 'title' 	=> "Show ISPConfig-Log",
+                  'target' 	=> 'content',
+                  'link'	=> 'monitor/show_log.php?log=log_ispconfig');
 
 
 $module["nav"][] = array(	'title'	=> 'Logfiles',
-							'open' 	=> 1,
-							'items'	=> $items);
-
-// aufräumen
-unset($items);
+                            'open' 	=> 1,
+                            'items'	=> $items);
 ?>
\ No newline at end of file
diff --git a/interface/web/monitor/show_data.php b/interface/web/monitor/show_data.php
index bee721be4a..37c77dc6c8 100644
--- a/interface/web/monitor/show_data.php
+++ b/interface/web/monitor/show_data.php
@@ -30,6 +30,7 @@ EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
 
 require_once('../../lib/config.inc.php');
 require_once('../../lib/app.inc.php');
+require_once('tools.inc.php');
 
 //* Check permissions for module
 $app->auth->check_module_permissions('monitor');
@@ -38,58 +39,42 @@ $app->auth->check_module_permissions('monitor');
 /* Get the dataType to show */
 $dataType = $_GET["type"];
 
-/* Change the Server if needed */
-if (isset($_GET['server'])){
-	$server = explode('|', $_GET['server'], 2);
-	$_SESSION['monitor']['server_id'] = $server[0];
-	$_SESSION['monitor']['server_name'] = $server[1];
-}
-	
-
 $output = '';
 
 switch($dataType) {
-	case 'server_load':
-		$template = 'templates/show_data.htm';
-		$output .= showServerLoad();
-		$title = $app->lng("Server Load").' (Server: ' . $_SESSION['monitor']['server_name'] . ')';
-		$description = '';
-		break;
-	case 'disk_usage':
-		$template = 'templates/show_data.htm';
-		$output .= showDiskUsage();
-		$title = $app->lng("Disk usage").' (Server: ' . $_SESSION['monitor']['server_name'] . ')';
-		$description = '';
-		break;
-	case 'mem_usage':
-		$template = 'templates/show_data.htm';
-		$output .= showMemUsage();
-		$title = $app->lng("Memory usage").' (Server: ' . $_SESSION['monitor']['server_name'] . ')';
-		$description = '';
-		break;
-	case 'cpu_info':
-		$template = 'templates/show_data.htm';
-		$output .= showCpuInfo();
-		$title = $app->lng("CPU info").' (Server: ' . $_SESSION['monitor']['server_name'] . ')';
-		$description = '';
-		break;
-	case 'services':
-		$template = 'templates/show_data.htm';
-		$output .= showServices();
-		$title = $app->lng("Status of services").' (Server: ' . $_SESSION['monitor']['server_name'] . ')';
-		$description = '';
-		break;
-	case 'overview':
-		$template = 'templates/show_data.htm';
-		$output .= showServerLoad();
-		$output .= '&nbsp;'. showDiskUsage();
-		$output .= '&nbsp;'.showServices();
-		$title = $app->lng("System Monitor").' (Server: ' . $_SESSION['monitor']['server_name'] . ')';
-		$description = '';
-		break;
-	default:
-		$template = '';
-		break;
+    case 'server_load':
+        $template = 'templates/show_data.htm';
+        $output .= showServerLoad();
+        $title = $app->lng("Server Load").' (Server: ' . $_SESSION['monitor']['server_name'] . ')';
+        $description = '';
+        break;
+    case 'disk_usage':
+        $template = 'templates/show_data.htm';
+        $output .= showDiskUsage();
+        $title = $app->lng("Disk usage").' (Server: ' . $_SESSION['monitor']['server_name'] . ')';
+        $description = '';
+        break;
+    case 'mem_usage':
+        $template = 'templates/show_data.htm';
+        $output .= showMemUsage();
+        $title = $app->lng("Memory usage").' (Server: ' . $_SESSION['monitor']['server_name'] . ')';
+        $description = '';
+        break;
+    case 'cpu_info':
+        $template = 'templates/show_data.htm';
+        $output .= showCpuInfo();
+        $title = $app->lng("CPU info").' (Server: ' . $_SESSION['monitor']['server_name'] . ')';
+        $description = '';
+        break;
+    case 'services':
+        $template = 'templates/show_data.htm';
+        $output .= showServices();
+        $title = $app->lng("Status of services").' (Server: ' . $_SESSION['monitor']['server_name'] . ')';
+        $description = '';
+        break;
+    default:
+        $template = '';
+        break;
 }
 
 
@@ -105,226 +90,4 @@ $app->tpl->setVar("description",$description);
 
 $app->tpl_defaults();
 $app->tpl->pparse();
-
-
-
-
-function showServerLoad(){
-	global $app;
-	
-	/* fetch the Data from the DB */
-	$record = $app->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 .= 
-		'<table id="system_load">
-			<tr>
-			<td>' . $app->lng("Server online since").':</td>
-			<td>' . $data['up_days'] . ' days, ' . $data['up_hours'] . ':' . $data['up_minutes'] . ' hours</center></td>
-			</tr>
-			<tr>
-			<td>' . $app->lng("Users online").':</td>
-			<td>' . $data['user_online'] . '</td>
-			</tr>' .
-			'<tr>
-			<td>' . $app->lng("System load 1 minute") . ':</td>
-			<td>' . $data['load_1'] . '</td>
-			</tr>
-			<tr>
-			<td>' . $app->lng("System load 5 minutes") . ':</td>
-			<td>' . $data['load_5'] . '</td>
-			</tr>
-			<tr>
-			<td>'.$app->lng("System load 15 minutes").':</td>
-			<td>' . $data['load_15'] . '</td>
-			</tr>
-			</table>';
-	} else {
-		$html = '<p>'.$app->lng("no_data_serverload_txt").'</p>';
-	}
-	
-	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 .= '<table id="system_disk">';
-		foreach($data as $line) {
-			$html .= '<tr>';
-			foreach ($line as $item) {
-				$html .= '<td>' . $item . '</td>';
-			}
-			$html .= '</tr>';
-		}
-		$html .= '</table>';
-	} else {
-		$html = '<p>'.$app->lng("no_data_diskusage_txt").'</p>';
-	}
-	
-
-	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 .= '<table id="system_memusage">';
-	
-		foreach($data as $key => $value){
-			if ($key != '') {
-				$html .= '<tr>
-					<td>' . $key . ':</td>
-					<td>' . $value . '</td>
-					</tr>';
-			}
-		}
-		$html .= '</table>';
-	} else {
-		$html = '<p>'.$app->lng("no_data_memusage_txt").'</p>';
-	}
-	
-	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 .= '<table id="system_cpu">';
-		foreach($data as $key => $value){
-			if ($key != '') {
-				$html .= '<tr>
-					<td>' . $key . ':</td>
-					<td>' . $value . '</td>
-					</tr>';
-			}
-		}
-		$html .= '</table>';
-	} else {
-		$html = '<p>'.$app->lng("no_data_cpuinfo_txt").'</p>';
-	}
-	
-	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 .= '<table id="system_services">';
-	
-		if($data['webserver'] == true) {
-			$status = '<span class="online">Online</span>';
-		} else {
-			$status = '<span class="offline">Offline</span>';
-		}
-		$html .= '<tr>
-			<td>Web-Server:</td>
-			<td>'.$status.'</td>
-			</tr>';
-	
-	
-		if($data['ftpserver'] == true) {
-			$status = '<span class="online">Online</span>';
-		} else {
-			$status = '<span class="offline">Offline</span>';
-		}
-		$html .= '<tr>
-			<td>FTP-Server:</td>
-			<td>'.$status.'</td>
-			</tr>';
-	
-		if($data['smtpserver'] == true) {
-			$status = '<span class="online">Online</span>';
-		} else {
-			$status = '<span class="offline">Offline</span>';
-		}
-		$html .= '<tr>
-			<td>SMTP-Server:</td>
-			<td>'.$status.'</td>
-			</tr>';
-	
-		if($data['pop3server'] == true) {
-			$status = '<span class="online">Online</span>';
-		} else {
-			$status = '<span class="offline">Offline</span>';
-		}
-		$html .= '<tr>
-			<td>POP3-Server:</td>
-			<td>'.$status.'</td>
-			</tr>';
-	
-		if($data['bindserver'] == true) {
-			$status = '<span class="online">Online</span>';
-		} else {
-			$status = '<span class="offline">Offline</span>';
-		}
-		$html .= '<tr>
-			<td>DNS-Server:</td>
-			<td>'.$status.'</td>
-			</tr>';
-	
-		if($data['mysqlserver'] == true) {
-			$status = '<span class="online">Online</span>';
-		} else {
-			$status = '<span class="offline">Offline</span>';
-		}
-		$html .= '<tr>
-			<td>mySQL-Server:</td>
-			<td>'.$status.'</td>
-			</tr>';
-	
-	
-		$html .= '</table></div>';
-	} else {
-		$html = '<p>'.$app->lng("no_data_services_txt").'</p>';
-	}
-	
-	
-	return $html;
-}
 ?>
\ No newline at end of file
diff --git a/interface/web/monitor/show_log.php b/interface/web/monitor/show_log.php
index 706134b4fa..3f2cabd072 100644
--- a/interface/web/monitor/show_log.php
+++ b/interface/web/monitor/show_log.php
@@ -43,7 +43,6 @@ $app->tpl->setInclude('content_tpl','templates/show_log.htm');
 $refresh = (isset($_GET["refresh"]))?intval($_GET["refresh"]):0;
 $logParam = $_GET["log"];
 
-
 /*
  Setting the db-type and the caption
  */
diff --git a/interface/web/monitor/show_sys_state.php b/interface/web/monitor/show_sys_state.php
new file mode 100644
index 0000000000..20db251e7e
--- /dev/null
+++ b/interface/web/monitor/show_sys_state.php
@@ -0,0 +1,365 @@
+<?php
+/*
+Copyright (c) 2007-2008, Till Brehm, projektfarm Gmbh and Oliver Vogel www.muv.com
+All rights reserved.
+
+Redistribution and use in source and binary forms, with or without modification,
+are permitted provided that the following conditions are met:
+
+    * Redistributions of source code must retain the above copyright notice,
+      this list of conditions and the following disclaimer.
+    * Redistributions in binary form must reproduce the above copyright notice,
+      this list of conditions and the following disclaimer in the documentation
+      and/or other materials provided with the distribution.
+    * Neither the name of ISPConfig nor the names of its contributors
+      may be used to endorse or promote products derived from this software without
+      specific prior written permission.
+
+THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
+ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
+WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
+IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT,
+INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING,
+BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY
+OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
+NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE,
+EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+*/
+
+require_once('../../lib/config.inc.php');
+require_once('../../lib/app.inc.php');
+require_once('tools.inc.php');
+
+/* Check permissions for module */
+$app->auth->check_module_permissions('monitor');
+
+/* Change the Server if needed */
+if (isset($_GET['server'])){
+    $server = explode('|', $_GET['server'], 2);
+    $_SESSION['monitor']['server_id'] = $server[0];
+    $_SESSION['monitor']['server_name'] = $server[1];
+}
+
+/*
+ *  Loading the template
+ */
+$app->uses('tpl');
+$app->tpl->newTemplate("form.tpl.htm");
+$app->tpl->setInclude('content_tpl','templates/show_sys_state.htm');
+
+/*
+ * setting the content
+ */
+if ($_GET['state'] == 'server')
+{
+    $output = _getServerState($_SESSION['monitor']['server_id'], $_SESSION['monitor']['server_name'], true);
+    $title = "Server State";
+}
+else
+{
+    $output = _getSysState();
+    $title = "System State";
+}
+
+$app->tpl->setVar("state_data",$output);
+$app->tpl->setVar("title",$title);
+$app->tpl->setVar("description",$description);
+
+/*
+ * doing the output
+ */
+$app->tpl_defaults();
+$app->tpl->pparse();
+
+
+function _getSysState(){
+    global $app;
+
+    /*
+     * Get all Servers and calculate the state of them
+     */
+    $html = '';
+
+    $servers = $app->db->queryAllRecords("SELECT server_id, server_name FROM server order by server_name");
+    foreach ($servers as $server)
+    {
+        $html .= _getServerState($server['server_id'], $server['server_name'], false);
+    }
+
+    return $html;
+}
+
+/*
+ * Calculates the State of ONE Server
+ */
+function _getServerState($serverId, $serverName, $showAll)
+{
+    global $app;
+
+    /*  The State of the server */
+    $serverState = 'unknown';
+
+    /** The Number of several infos, warnings, errors, ... */
+    $count = array('unknown' => 0, 'info' => 0, 'warning' => 0, 'critical' => 0, 'error' => 0);
+
+    /** The messages */
+    $messages = array();
+
+    /** The Result of the function */
+    $res = '';
+
+    /*
+     * get all monitoring-data from the server als process then
+     * (count them and set the server-state)
+     */
+    $records = $app->db->queryAllRecords("SELECT DISTINCT type FROM monitor_data WHERE server_id = " . $serverId);
+    foreach($records as $record){
+        _processDbState($record['type'], $serverId, &$serverState, &$messages);
+    }
+
+    $res .= '<div class="systemmonitor-state systemmonitor-state-' . $serverState . '">';
+    $res .= '<div class="systemmonitor-serverstate">';
+    $res .= '<div class="systemmonitor-state-' . $serverState . '-icon">';
+    $res .= 'Server: ' . $serverName . '<br />';
+    $res .= 'State: ' . $serverState . '<br />';
+    //        $res .= sizeof($messages['ok']) . ' ok | ';
+    $res .= sizeof($messages['unknown']) . ' unknown | ';
+    $res .= sizeof($messages['info']) . ' info | ';
+    $res .= sizeof($messages['warning']) . ' warning | ';
+    $res .= sizeof($messages['critical']) . ' critical | ';
+    $res .= sizeof($messages['error']) . ' error <br />';
+    $res .= '<br />';
+    if ($showAll){
+        /*
+         * if we have to show all, then we do it...
+         */
+
+        /*
+        * Show all messages
+        */
+        foreach($messages as $key => $state){
+            /*
+             * There is no need, to show the "ok" - messages
+             */
+            if ($key != 'ok')
+            {
+                $res .= $key . ':<br />';
+                foreach ($state as $msg)
+                {
+                    $res .= $msg . '<br />';
+                }
+                $res .= '<br />';
+            }
+        }
+    }
+    else
+    {
+        /*
+         * if not, we only show a link to the server...
+         */
+        $res .= "<a href='#' onclick='loadContent(\"monitor/show_sys_state.php?state=server&server=" . $serverId . '|' . $serverName . "\");'> More information...</a>";
+    }
+    $res .= '</div>';
+    $res .= '</div>';
+    $res .= '</div>';
+
+    if ($showAll){
+        /*
+         * Show some state-info
+         */
+        $res .= showServerLoad();
+        $res .= '&nbsp;'. showDiskUsage();
+        $res .= '&nbsp;'.showServices();
+    }
+
+
+    return $res;
+}
+
+/*
+ * gets the state from the db and process it
+ */
+function _processDbState($type, $serverId, &$serverState, &$messages)
+{
+    global $app;
+
+   /*
+    * Always the NEWEST record of each monitoring is responsible for the
+    * state
+    */
+    // get the State from the DB
+    $record = $app->db->queryOneRecord("SELECT state FROM monitor_data WHERE type = '" . $type . "' and server_id = " . $serverId . " order by created desc");
+    // change the new state to the highest state
+    $serverState = _setState($serverState, $record['state']);
+    // count the states
+    $count[$record['state']]+= 1;
+
+    /*
+     * The message depands on the type and the state
+     */
+    if ($type == 'cpu_info'){
+        /* this type has no state */
+    }
+    if ($type == 'disk_usage'){
+        switch ($record['state']) {
+            case 'ok':
+                $messages['ok'][] = 'The state of your Hard-Disk space is ok ' .
+                                    "<a href='#' onclick='loadContent(\"monitor/show_data.php?type=disk_usage\");'>[more...]</a>";
+                break;
+            case 'info':
+                $messages['info'][] = 'Your Hard-Disk space is going full ' .
+                                    "<a href='#' onclick='loadContent(\"monitor/show_data.php?type=disk_usage\");'>[more...]</a>";
+                break;
+            case 'warning':
+                $messages['warning'][] = 'Your Hard-Disk is nearly full ' .
+                                    "<a href='#' onclick='loadContent(\"monitor/show_data.php?type=disk_usage\");'>[more...]</a>";
+                break;
+            case 'critical':
+                $messages['critical'][] = 'Your Hard-Disk is very full '.
+                                    "<a href='#' onclick='loadContent(\"monitor/show_data.php?type=disk_usage\");'>[more...]</a>";
+                break;
+            case 'error':
+                $messages['error'][] = 'Your Hard-Disk has no more space left ' .
+                                    "<a href='#' onclick='loadContent(\"monitor/show_data.php?type=disk_usage\");'>[more...]</a>";
+                break;
+
+            default:
+                $messages['unknown'][] = 'Hard-Disk: ??? ' .
+                                    "<a href='#' onclick='loadContent(\"monitor/show_data.php?type=disk_usage\");'>[more...]</a>";
+                break;
+        }
+    }
+    if ($type == 'mem_usage'){
+        /* this type has no state */
+    }
+    if ($type == 'server_load'){
+        switch ($record['state']) {
+            case 'ok':
+                $messages['ok'][] = 'Your Server load is ok ' .
+                                    "<a href='#' onclick='loadContent(\"monitor/show_data.php?type=server_load\");'>[more...]</a>";
+                break;
+            case 'info':
+                $messages['info'][] = 'Your Server in under heavy load ' .
+                                    "<a href='#' onclick='loadContent(\"monitor/show_data.php?type=server_load\");'>[more...]</a>";
+                break;
+            case 'warning':
+                $messages['warning'][] = 'Your Server in under high load ' .
+                                    "<a href='#' onclick='loadContent(\"monitor/show_data.php?type=server_load\");'>[more...]</a>";
+                break;
+            case 'critical':
+                $messages['critical'][] = 'Your Server in under higher load ' .
+                                    "<a href='#' onclick='loadContent(\"monitor/show_data.php?type=server_load\");'>[more...]</a>";
+                break;
+            case 'error':
+                $messages['error'][] = 'Your Server in under highest load ' .
+                                    "<a href='#' onclick='loadContent(\"monitor/show_data.php?type=server_load\");'>[more...]</a>";
+                break;
+            default:
+                $messages['unknown'][] = 'Server Load: ??? ' .
+                                    "<a href='#' onclick='loadContent(\"monitor/show_data.php?type=server_load\");'>[more...]</a>";
+                break;
+        }
+    }
+    if ($type == 'services'){
+        switch ($record['state']) {
+            case 'ok':
+                $messages['error'][] = 'All needed Services are online ' .
+                                    "<a href='#' onclick='loadContent(\"monitor/show_data.php?type=services\");'>[more...]</a>";
+
+                break;
+            case 'error':
+                $messages['error'][] = 'One or more needed Services are offline ' .
+                                    "<a href='#' onclick='loadContent(\"monitor/show_data.php?type=services\");'>[more...]</a>";
+                break;
+            default:
+                $messages['unknown'][] = 'services:??? ' .
+                                    "<a href='#' onclick='loadContent(\"monitor/show_data.php?type=services\");'>[more...]</a>";
+                break;
+        }
+    }
+    if ($type == 'log_clamav'){
+        /* this type has no state */
+    }
+    if ($type == 'log_freshclam'){
+        /* this type has no state */
+    }
+    if ($type == 'log_ispconfig'){
+        /* this type has no state */
+    }
+    if ($type == 'log_mail'){
+        /* this type has no state */
+    }
+    if ($type == 'log_mail_err'){
+        /* this type has no state */
+    }
+    if ($type == 'log_mail_warn'){
+        /* this type has no state */
+    }
+    if ($type == 'log_messages'){
+        /* this type has no state */
+    }
+}
+
+ /*
+  * Set the state to the given level (or higher, but not lesser).
+  * * If the actual state is critical and you call the method with ok,
+  *   then the state is critical.
+  *
+  * * If the actual state is critical and you call the method with error,
+  *   then the state is error.
+  */
+function _setState($oldState, $newState)
+{
+        /*
+         * Calculate the weight of the old state
+         */
+    switch ($oldState) {
+        case 'no_state': $oldInt = 0;
+            break;
+        case 'unknown': $oldInt = 1;
+            break;
+        case 'ok': $oldInt = 2;
+            break;
+        case 'info': $oldInt = 3;
+            break;
+        case 'warning': $oldInt = 4;
+            break;
+        case 'critical': $oldInt = 5;
+            break;
+        case 'error': $oldInt = 6;
+            break;
+    }
+        /*
+         * Calculate the weight of the new state
+         */
+    switch ($newState) {
+        case 'no_state': $newInt = 0 ;
+            break;
+        case 'ok': $newInt = 1 ;
+            break;
+        case 'unknown': $newInt = 2 ;
+            break;
+        case 'info': $newInt = 3 ;
+            break;
+        case 'warning': $newInt = 4 ;
+            break;
+        case 'critical': $newInt = 5 ;
+            break;
+        case 'error': $newInt = 6 ;
+            break;
+    }
+
+        /*
+         * Set to the higher level
+         */
+    if ($newInt > $oldInt){
+        return $newState;
+    }
+    else
+    {
+        return $oldState;
+    }
+}
+
+?>
\ No newline at end of file
diff --git a/interface/web/monitor/templates/show_sys_state.htm b/interface/web/monitor/templates/show_sys_state.htm
new file mode 100644
index 0000000000..8281f0ba8d
--- /dev/null
+++ b/interface/web/monitor/templates/show_sys_state.htm
@@ -0,0 +1,19 @@
+<h2><tmpl_var name="title"></h2>
+
+<div class="panel">
+
+  <!--div class="pnl_toolsarea">
+    <fieldset><legend>Tools</legend>
+      <div class="buttons">
+        <select name="refreshinterval" id="refreshinterval" onChange="loadContentRefresh('monitor/show_log.php?log={tmpl_var name="log_id"}')">{tmpl_var name="refresh"}</select>
+      </div>
+    </fieldset>
+  </div-->
+
+  <div class="pnl_formarea">
+    <fieldset><!-- legend>Sys-State</legend -->
+      <div class="stateview"><tmpl_var name="state_data"></div>
+    </fieldset>
+  </div>
+
+</div>
diff --git a/interface/web/monitor/tools.inc.php b/interface/web/monitor/tools.inc.php
new file mode 100644
index 0000000000..a23867195e
--- /dev/null
+++ b/interface/web/monitor/tools.inc.php
@@ -0,0 +1,244 @@
+<?php
+function showServerLoad(){
+    global $app;
+
+    /* fetch the Data from the DB */
+    $record = $app->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 .=
+        '<table id="system_load">
+            <tr>
+            <td>' . $app->lng("Server online since").':</td>
+            <td>' . $data['up_days'] . ' days, ' . $data['up_hours'] . ':' . $data['up_minutes'] . ' hours</center></td>
+            </tr>
+            <tr>
+            <td>' . $app->lng("Users online").':</td>
+            <td>' . $data['user_online'] . '</td>
+            </tr>' .
+            '<tr>
+            <td>' . $app->lng("System load 1 minute") . ':</td>
+            <td>' . $data['load_1'] . '</td>
+            </tr>
+            <tr>
+            <td>' . $app->lng("System load 5 minutes") . ':</td>
+            <td>' . $data['load_5'] . '</td>
+            </tr>
+            <tr>
+            <td>'.$app->lng("System load 15 minutes").':</td>
+            <td>' . $data['load_15'] . '</td>
+            </tr>
+            </table>';
+    } else {
+        $html = '<p>'.$app->lng("no_data_serverload_txt").'</p>';
+    }
+
+    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 .= '<table id="system_disk">';
+        foreach($data as $line) {
+            $html .= '<tr>';
+            foreach ($line as $item) {
+                $html .= '<td>' . $item . '</td>';
+            }
+            $html .= '</tr>';
+        }
+        $html .= '</table>';
+    } else {
+        $html = '<p>'.$app->lng("no_data_diskusage_txt").'</p>';
+    }
+
+
+    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 .= '<table id="system_memusage">';
+
+        foreach($data as $key => $value){
+            if ($key != '') {
+                $html .= '<tr>
+                    <td>' . $key . ':</td>
+                    <td>' . $value . '</td>
+                    </tr>';
+            }
+        }
+        $html .= '</table>';
+    } else {
+        $html = '<p>'.$app->lng("no_data_memusage_txt").'</p>';
+    }
+
+    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 .= '<table id="system_cpu">';
+        foreach($data as $key => $value){
+            if ($key != '') {
+                $html .= '<tr>
+                    <td>' . $key . ':</td>
+                    <td>' . $value . '</td>
+                    </tr>';
+            }
+        }
+        $html .= '</table>';
+    } else {
+        $html = '<p>'.$app->lng("no_data_cpuinfo_txt").'</p>';
+    }
+
+    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 .= '<table id="system_services">';
+
+        if($data['webserver'] != -1) {
+            if($data['webserver'] == 1) {
+                $status = '<span class="online">Online</span>';
+            } else {
+                $status = '<span class="offline">Offline</span>';
+            }
+            $html .= '<tr>
+            <td>Web-Server:</td>
+            <td>'.$status.'</td>
+            </tr>';
+        }
+
+
+        if($data['ftpserver'] != -1) {
+            if($data['ftpserver'] == 1) {
+                $status = '<span class="online">Online</span>';
+            } else {
+                $status = '<span class="offline">Offline</span>';
+            }
+            $html .= '<tr>
+            <td>FTP-Server:</td>
+            <td>'.$status.'</td>
+            </tr>';
+        }
+
+        if($data['smtpserver'] != -1) {
+            if($data['smtpserver'] == 1) {
+                $status = '<span class="online">Online</span>';
+            } else {
+                $status = '<span class="offline">Offline</span>';
+            }
+            $html .= '<tr>
+            <td>SMTP-Server:</td>
+            <td>'.$status.'</td>
+            </tr>';
+        }
+
+        if($data['pop3server'] != -1) {
+            if($data['pop3server'] == 1) {
+                $status = '<span class="online">Online</span>';
+            } else {
+                $status = '<span class="offline">Offline</span>';
+            }
+            $html .= '<tr>
+            <td>POP3-Server:</td>
+            <td>'.$status.'</td>
+            </tr>';
+        }
+
+        if($data['imapserver'] != -1) {
+            if($data['imapserver'] == 1) {
+                $status = '<span class="online">Online</span>';
+            } else {
+                $status = '<span class="offline">Offline</span>';
+            }
+            $html .= '<tr>
+            <td>IMAP-Server:</td>
+            <td>'.$status.'</td>
+            </tr>';
+        }
+
+        if($data['bindserver'] != -1) {
+            if($data['bindserver'] == 1) {
+                $status = '<span class="online">Online</span>';
+            } else {
+                $status = '<span class="offline">Offline</span>';
+            }
+            $html .= '<tr>
+            <td>DNS-Server:</td>
+            <td>'.$status.'</td>
+            </tr>';
+        }
+
+        if($data['mysqlserver'] != -1) {
+            if($data['mysqlserver'] == 1) {
+                $status = '<span class="online">Online</span>';
+            } else {
+                $status = '<span class="offline">Offline</span>';
+            }
+            $html .= '<tr>
+            <td>mySQL-Server:</td>
+            <td>'.$status.'</td>
+            </tr>';
+        }
+
+
+        $html .= '</table></div>';
+    } else {
+        $html = '<p>'.$app->lng("no_data_services_txt").'</p>';
+    }
+
+
+    return $html;
+}
+?>
diff --git a/interface/web/themes/default/css/screen/content_ispc.css b/interface/web/themes/default/css/screen/content_ispc.css
index 28fd643d5c..c97a364007 100644
--- a/interface/web/themes/default/css/screen/content_ispc.css
+++ b/interface/web/themes/default/css/screen/content_ispc.css
@@ -3,7 +3,7 @@
  * "Yet Another Multicolumn Layout" - (X)HTML/CSS Framework
  *
  * (en) Uniform design of ISPConfig elements - ISPConfig 3: default theme
- * (de) Einheitliche Standardformatierungen für ISPConfig-Elemente - ISPConfig 3: default theme
+ * (de) Einheitliche Standardformatierungen f�r ISPConfig-Elemente - ISPConfig 3: default theme
  *
  * @copyright       Copyright 2005-2008, Dirk Jesse
  * @license         CC-A 2.0 (http://creativecommons.org/licenses/by/2.0/),
@@ -94,8 +94,75 @@
 	table.list .tbl_row_uneven { background: #f0f8ff; }
 	table.list tr:hover { background: #fffacd; }
 	
-	
-	.systemmonitor table {
+    .systemmonitor-state {
+		margin:20px 0;
+		font-family: Consolas, "Lucida Console", "Courier New", monospace;
+		font-size: 0.9em;
+    }
+    .systemmonitor-state-unknown {
+		border: 1px solid #30302e;
+		background-color: #cecfc5;
+    }
+    .systemmonitor-state-ok {
+		border: 1px solid #23fb00;
+		background-color: #adffa2;
+    }
+    .systemmonitor-state-info {
+		border: 1px solid #fdff00;
+		background-color: #fdffa2;
+    }
+    .systemmonitor-state-warning {
+		border: 1px solid #ffa800;
+		background-color: #ffda93;
+    }
+    .systemmonitor-state-critical {
+		border: 1px solid #ff0000;
+		background-color: #ffb9b9;
+    }
+    .systemmonitor-state-error {
+		border: 1px solid #ff0000;
+		background-color: #ff7f7f;
+    }
+    .systemmonitor-systemstate {
+        background-image:url("../../icons/x64/network.png");
+        background-repeat: no-repeat;
+        }
+    .systemmonitor-serverstate {
+        background-image:url("../../icons/x64/server.png");
+        background-repeat: no-repeat;
+        }
+    .systemmonitor-state-unknown-icon {
+		padding:2px 10px 2px 80px;
+        background-image:url("../../icons/x32/state_unknown.png");
+        background-repeat: no-repeat;
+    }
+    .systemmonitor-state-ok-icon {
+		padding:2px 10px 2px 80px;
+        background-image:url("../../icons/x32/state_ok.png");
+        background-repeat: no-repeat;
+    }
+    .systemmonitor-state-info-icon {
+		padding:2px 10px 2px 80px;
+        background-image:url("../../icons/x32/state_info.png");
+        background-repeat: no-repeat;
+    }
+    .systemmonitor-state-warning-icon {
+		padding:2px 10px 2px 80px;
+        background-image:url("../../icons/x32/state_warning.png");
+        background-repeat: no-repeat;
+    }
+    .systemmonitor-state-critical-icon {
+		padding:2px 10px 2px 80px;
+        background-image:url("../../icons/x32/state_critical.png");
+        background-repeat: no-repeat;
+    }
+    .systemmonitor-state-error-icon {
+		padding:2px 10px 2px 80px;
+        background-image:url("../../icons/x32/state_error.png");
+        background-repeat: no-repeat;
+    }
+
+    .systemmonitor table {
 		border: 1px solid #d3d3d3;
 		width: 80%;
 		margin-top: 10px;
diff --git a/interface/web/themes/default/icons/x32/state_critical.png b/interface/web/themes/default/icons/x32/state_critical.png
new file mode 100644
index 0000000000000000000000000000000000000000..501424b341f4009e1a3f4b5bb5c0dcf8a5d34229
GIT binary patch
literal 2409
zcmV-v36}PWP)<h;3K|Lk000e1NJLTq001BW001Be1^@s6b9#F8000RvNkl<ZScR>Z
zdyo{x9mhXCGrP01yLWrH_mG1G6w%{&C=ZnwMIkB%6B3M?luBu#u_{(#Vl-uZBq|~x
zzBQ%91eH=SA*N!9K@IT%27{VVq6P#{@I2rMcgM2to%b()>~b8&L`<cpx_Wk}`}h4!
z&+qr^ZY3go-tw3->Y_v&bv;st2!805JiN?h;^#lFEp@m6%k^aY(4&u@IdtO0Y4u+m
z+7Yv2ExH-CK$Kr9S4zEoeVH9y+y1%jgSC72^gMs5*zf;e09Hg(6FMeO{PD=CC(lkz
zIIdoe9RuYGeAESw14>n^rh$Y6`8<8^Z!2`JUBBwXEnDuJEB40!3E&|WjgCHY<n<G0
z&iG0C*im%|pc~NKR2A;+1<wZspsKA>)jnnv@jP~IdZ)bcg*Er>&h+2@eR1u>23VqE
zttU;MymZ_dr_VCuaVVC-^QsRck!l<G)YK0x5?23@Mj&oc*q7mr)i12swqyI;ABfxY
znE(%|Sj#DsCOy+J^-HIiUI6(bgu%h722k1{?LiO<&~*sHDxju8B2HNXUi<Saf7`l!
z`|PVf0dWYxy~;FCJo=cYCrzC)D^YR?^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A?0R|9K6k+kBhQz0*u?F}Jn_A+sL56R%4wk^Lz
znGHg?^yIqadFNVj8j2;#<q8HNrV%A-#n9pwM9u0Z)%OtF#;@3T6&n}9h??ZB7|(kS
z>&y0YA?k`J#M%2vt^as1nWIcSB)oQbBy#;(sZ`@+BSHg!X;v4bM521HRQ1eIsX(a&
z6`OJpu+jDSQ?Zc$$aC*fXm>6b$Ne;&&peuaM@2iL$d5)w&GU~>rJ6>k(;U&*NV07x
zhOQxwjqiC>3Pt*|`{~SNd3*o<eVumYSsU(ODeim!&HiB@PS01-BMs#2dem2%G-FI_
zqP{h*Yl$EXDEodX>$$!Cp0_1O@T!km^R&1-4#)0c0}L+bs;C8F1CXqpR0^Q7&xl+3
byte)YGv3SnbZ5BL00000NkvXXu0mjf<&ua5

literal 0
HcmV?d00001

diff --git a/interface/web/themes/default/icons/x32/state_error.png b/interface/web/themes/default/icons/x32/state_error.png
new file mode 100644
index 0000000000000000000000000000000000000000..b9a291171e35cfac828da05a7ba72458bdb00e52
GIT binary patch
literal 2212
zcmV;V2wV4wP)<h;3K|Lk000e1NJLTq001BW001Be1^@s6b9#F8000PUNkl<ZScS!w
zX>4586~}+~y*F<*d%SPs@fK{ySqzEogft0pq69+H0;R2JMS-?TsH*ZI&{h>ih^k+J
z50&`Pib@rbR$Zcswk#s8DjE=^B?;LKaRRmzdlGwWk7x0$o_$_FygSY$gymbWbTx18
zyXXA>=YP*R_X)!=_<s(e3YCIUpb{7a+&~-94AcTHpaQT8Fn|=0Fdzyv2`B;rZ~_{T
zHq74&r_R}A)-?mM%YY9!11thgO$WoEh=FoFBLm0)JHGb=W6QpWmvWdOd=a4xb6XK`
zZrprq+mla6b5Ln~hWRxF3?OGl9KPl8C+K?c+ja#e3SSVv<YOLQcMT40>e;&&AeMu=
z&m|zim1!_q`c~J_+lI1vnATOj-BIv;o(e)nzX)$Ou33AR=YjpGwKWXfekYR<%t7~!
z%!PuWh=B#PD##sJH^`HZ{S3lkK)_9%9DnM^_(nd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kIB^6SEm)W@h6Sh24ta1UI@<O-4aoWk)_7
z`)KCMB=*&-X{&D}sTc8GnMQ|4RQN;b7F{M#?n8xttFSQ^j4kDVa)9E`pCb9OH>kj{
zDme0~;8GGH@LCi$rTyWvp&BQ}{of}xJ%<Gz(%^XnpKx*gmlVKB2izL{{lRlui-#QC
z4vbL#9ram55Yu6}P%NHHF2y@ExKD+b^PjR^6W1CeOpsB-JGCn_F|HXfB0ekf8*(6C
m7#rJ@4g?2s@N#MKM&o~L8e&1_#mZ3t0000<MNUMnLSTYtco`G`

literal 0
HcmV?d00001

diff --git a/interface/web/themes/default/icons/x32/state_info.png b/interface/web/themes/default/icons/x32/state_info.png
new file mode 100644
index 0000000000000000000000000000000000000000..f59130d14cdb347518b4fc9c83bc258bacc2fff9
GIT binary patch
literal 2184
zcmV;32zU31P)<h;3K|Lk000e1NJLTq001BW001Be1^@s6b9#F8000P2Nkl<ZScRpR
zYiwM_6@b5)d+*-ey}RDES=;d|aj=~<JW_%QAqfg?K&1!)Y1O6}`s6pIDyaQY^+8ot
zh(b$+T8hLE3P=RhszkI^+Jc}BZ$cq7lq9$gapG5OukBs$^FC(!<L>$q2MFy*M|bbu
zIp=)moYBk~p|$4YjHtNLQOHg(TfuAuEg+Z!e_WzQEBcAT$FV2Q1|TK|qKe3;lU*IV
zI?g+H>zcmKHLKbh8xn~q0Q2)@CdOvxkH0r^eDv_KSBs-#dnN93Wxc2Je*?tKZ|v^4
zbkprSuG_xl^2>VZ=}3`^f+<1NRJ8zKL9V139GPSP%Y(e|r<Y$F|L5EHRf30~{GR|~
zVxTM8(|7OHx9r+|{bx4P)o7wT@O%gqaGIJBU`VhmkOmx|cG<h{Ab)%0=_gCWL*Fgy
zJtxi@ASQ0!+<oO0k9_%?U)->{rxCvbRTmH-YR&-as`dBq&v0JE0wV&i9G>FQ`+s+2
z?4=jKTGo#r_(*`5xcTDs*I)C;uid)4y(<}^SOCSMV?p@h`Cu9#1-L#~X829lA!@^k
z!?A3Mhw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7^nmdlLKO%_hRe{|oep`rWS
zzkKJF53_$(ms0@ahF@HmY|dQM)Y^7MCX-p$*wB!1Vs=~r#Y(l9oy%vZvr|X26BGN3
z+3dbx@3#+~joq^bSf+I2uhLj%6NXG9geC}bc>avubL-s4we??&Y!Qn^HQ8qX0000<
KMNUMnLSTX)CrQl!

literal 0
HcmV?d00001

diff --git a/interface/web/themes/default/icons/x32/state_ok.png b/interface/web/themes/default/icons/x32/state_ok.png
new file mode 100644
index 0000000000000000000000000000000000000000..ab86df2f5872b0126a27b09d5e711db515d4e301
GIT binary patch
literal 1518
zcmV<K1rhp*P)<h;3K|Lk000e1NJLTq001BW001Be1^@s6b9#F8000HGNkl<ZScT=+
zeQXnT9LMp`@9uiP>$Tmw2iCFe=4e6OSa}o((1hRv0i6W?5DkW?(Fkfx{6~!vgNc6;
zC5G@INVhRiL?9THASxn4Kv>z6o23QT0UKjX+O6B#Zg<!F`3C_(7#qlg3E$-R-~I0W
z%01+AgfWKuIoy4%KQI8>XGFYjfD|uLdQae(Yen|Zdk(Ob5=A&IRc?BFll!3yBb!Gr
zcTKow09zSRgeK}MU9=%P<Zr}d)28!$SUMuVNv=WM6@aab<ntlwD_vCXsHv>QUurwf
zb+kaV@d6(ef2RxnLELeG%}W%%kye&2DtA;Lt3{U)MZ$<<U*lfXU8u(pm)(>m*$>mF
z$+$ZXu&pBsAEG|*;xb2dO*Oh%6bZzz|J*M)qc?-g0FcFy%_*W0<GSfALT(7i-D=}<
zx2E*_>fA8?IZ?PKlh6A`nWNfYg>E5=1dZcB=RTYfnjz)@mK+I|h73HM>nfJ4d{f^Z
z#)N;LD0_?99IrAq8^p-Vf&5(S{CH@fcxo9@$QhH*`&OBws<9G1v<H2x7l+z^LyOP?
zIg5u`kdgdJfJlVmgMkCV?p<mU0Lazfg0ynZ9BW`({7Zv#B+iVH%kurw!+c42q2APA
ze8^@|(M}NG`o*P=>a)iXOU9tGJ{%1n#<@f@BuZfxWJI<n5O3`%CL#&;e6Q=5_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ZUY@bLR9J000xCSXWk#;;BXMqC(fHC0N#bJ8=L2
zV{E`RrLxeI_MSB~Z%+x^+~;MFmX2Ys9e=5K2m6W+X8+CBpbwncFxiv+Vdm*ctH-lv
z0#6igV5|OfoG~`=Ex0_hf>VfDmZx$==qSihLd!Yt?O*n*X3&7UH4nzG+5Z~wHz#We
UggAPbj{pDw07*qoM6N<$f})Gi!vFvP

literal 0
HcmV?d00001

diff --git a/interface/web/themes/default/icons/x32/state_unknown.png b/interface/web/themes/default/icons/x32/state_unknown.png
new file mode 100644
index 0000000000000000000000000000000000000000..47694461fc97bcfb8f5d0b8fa900369a7b120d3c
GIT binary patch
literal 2832
zcmV+r3-9!aP)<h;3K|Lk000e1NJLTq001BW001Be1^@s6b9#F800001b5ch_0Itp)
z=>Px#24YJ`L;(K){{a7>y{D4^000SaNLh0L01FcU01FcV0GgZ_00007bV*G`2iOZ3
z5g;yva+;|C01A*vL_t(o!;P0qjAhqVhQGDXKIhzbJ#JNZRhR8*ciZhp{7O4GL`*yY
zA|aUwn1Dba27tr_GXM#Y5@$jrm@#3%3@Ks&0z?Q+$V0e!II-h)C+$afS3g|us#~|J
z?!D)p_kJ+AMWRGPVo6J9kM{rn>tAOrZF&2<HxS_}!VRSqO4LP!eea#EYjeIx)AQru
z-fvF^n-s$bzvCv`wEYPkRiFbwbQ2RUQs_R3%rmMQU)(wz;e+^%pZ?j;^3>B$bN%|8
z{Qm2&GffhHJan2)vDV(GjajM;!@8~yBpr03dYI35)i2F=-ES;5c2@1uCN|#3FPsqh
zjL;jbf!c)RW=Kho#l|@<^p?J`+HPP~^o99)mvpmWe7JX6&0Tsx@^J{``bP+yo}5tE
z^-`YaCd~?}Y+MB6jc0rH=3n*J!mIO-2F%A>G`gFpW`Z|0;=vloGe}cN#!wnXL$49f
zt>ezEQ%j2~{gClNRrta2>z{nQ`)7OePZS&PzdM{k|0(dF=>6SY93glccB+S0*WBj2
z3m1jCg=Ly9#im1!hDVs<1n<G0F?SBC3i1N7Db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eJ-nXp{UtYz-rYYK
zR<89$v-FA24~G?gaz`Eu94qmx8I{a@R4q;X*mJaA_#9q$Icp7sipo8N^4pM{5IE2g
z1PvgD+`(W3ySt>v18$yf^JX#O-j_%WfSyi9TS~Rwkon91IL%MLlO-onG97X-vGgNY
zXhJK5hO22#ZW0c@f?9bAuT~HY)EfkD1E-FWR*3}QTaX7ZJb<Gi9B)&N_PCpm_?Il<
z+U`d@{K2~*(!ujlWA2{r&EL#y@@Q6!Zw-uUOs7YU8WW%;aClr+!`2N<t3*$Bki{p#
zkMYyn_`&z_$!G=+R3#)eZf6hncSw?L?ic&KWefiOPu}GNfX}}Qa}Cg+dimv17&qsX
zQvGWB*roLF%A3i@H(Tk}`~B(g!TP=Qcr`3*;>yvg_h{~A#Qkl;-aINO5jVn?2bj`h
z1&oKPhN`5@Grm_OeAi5QuSmI-pK#}YmCr@65QBK{fA`GJgjv7M9X))ndHcWr;oQb|
zu03<Iedj4xW%Js*xG6qp21p#Eq6X*~Q6b)h_&UJX;EkcI5^^(TQx$w8O!=0YaPv2B
za0>9Zzdjpozx?Gh3xI>OnUyh{LEDRKS7hbMPerH42k#i?7pw8%GDUKZIzLyss&8w$
zg{7ejl+suqkokbIQw$vJ+JfCGXPYS>+e3Em-eJW55#pSCMnnXty>m{KGG`OJ1}Z>q
zeEAQT9^Ux+T5`PqXqivfoT(RZwynGm6x7Q3L^*#Hz-B{u(5U(Nb6@*W&^Lb#b|&zv
z|MX+8V-eZ;!E?_U0u}i)E6(;K{>4{+F+bdR=Oi5uA39NO>m|mbofiqbcivKC$(3QM
iDkeYwUnKlL<9`6zn)0})<$!+x0000<MNUMnLSTZ<=Tc4p

literal 0
HcmV?d00001

diff --git a/interface/web/themes/default/icons/x32/state_warning.png b/interface/web/themes/default/icons/x32/state_warning.png
new file mode 100644
index 0000000000000000000000000000000000000000..704cf4ba5ea90bbfcd9bd07528478840d2a475f4
GIT binary patch
literal 1931
zcmV;62Xy#}P)<h;3K|Lk000e1NJLTq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7EBIY7EA____#<R3I_ZNXdh=LLHI~BiM0-lKtviB
z`ygt-CYZ=!V~Lq6VvWHjf}mcoWZB}mt&K+;_2ILwf9h9<p439GD^4V_5KiF?h`e+z
zpH|NyWZKbAfJPEKhp-kUz*vh*Knn@R;DkX&U=f(MM(WxdsBso+9l|+WP#cSP`+xKH
z@xjW7c<tAg<kU|Qt`?(LV+#Kv${!;x3}WLvLTHrlp;Q*(X>cG^9o9xzQHD6i7>P^D
zSg8@R1V(}K2r~*_<ap+L`!Usj*pl=)@#ME(rsq=+UG{JkAcGd9--I{&c5prpFIBmm
z9-AVankF@7MRkVi24FlbnTo3-f+T+iRr2`Jn-8OcI-CKeL3$oX-*_E>{{j;@CV45b
RP-6f9002ovPDHLkV1jFGhMxcc

literal 0
HcmV?d00001

diff --git a/interface/web/themes/default/icons/x64/network.png b/interface/web/themes/default/icons/x64/network.png
new file mode 100644
index 0000000000000000000000000000000000000000..f4c20744e5962e6fcf8b5d408aeb37394fdd828f
GIT binary patch
literal 7481
zcmV-99me8`P)<h;3K|Lk000e1NJLTq002M$002M;1^@s6s%dfF0012TNkl<Zc$~$X
zd5~w<Ro_47-ut%S(!cIs&vf@_W;7a&G}dUr&S;BmFp4)!;xYsb*hK<WP)QL&pehbw
zNkT}<p-kbFiIWsd3JRhMwy^<YWJku95SFopEX%UBjWiz3qFH*T_x>&K_m+Ea{<yDO
zBN#~|TPCmS_V4v?edl}6J>Ty+=RWb?^UWUd+de{7*Wd+2!29qh0yyvvoXi3H5cVT#
zK}7oDb?_dGcNf5&#q$ivDTDzYP~j`k&G&j~o^#-Ztleh(iSPM_uibpp*1zE4!TD>!
z-=U-Ej#gs+UbkiTcGIZSN)53Qln5Sh9*W8`%xi{uy*e0I&x{NE*SP8)oZJsAgM3S_
z@>>9aZ{z*<h|)hYGnIVj!c3Mf^b>YWCrr0v+L<PeG?7uL#wP1LW$nld%P_C|Ys0F)
zv_84z-0I|Co?o9V4#$&E;oScQ`O8=OYF`lmyaT*%0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kWRj03wYAozSzI~i%Br@d5-CMdDv?4&3WNzxM!*1A#mg$NiT4E}FUbFw=K%o*
zho@-%acl({C`9NYQi({WL~0SKl&DHXMWR$?B5jf+isCq`j8TPmZctXWh!*i4QA%*m
z`>L#bF)4jnRNi~<BBO1RMAp`}sw!J4kxG<Q!FVY}q!45Rk`vs16Icf}8XzV(XZ`69
zzGSBNk^uN)@AGot=N(~<IYOi@1Q~(!M3@qxjYvyGQV|kS5-TN<QWA-XQA%m8wbn-K
zC^9OJBZ=ckln$G!MDW%*SJ&1VQ#++qElR8?sYM0jMWjSYDM+D2a)hx6gU0wlGsey2
zSbyw&FB<$V8-Ohk04oQ6-UF6EGh>7y$R;8k5!xcsMkEtR1W6EyB>-VWL@T9~(n@Qs
z#Y8#)pag53*GhS%lvPSO3EpHyq!OVDGfp8eLBgyH41uAD3_U(?46hsGFZ*uLmvzsO
zKlVP?fUva`Ccsc216n{!giJ&-gtP%7CNNthO0*IQI0QH#RFb?XWkqlZHUJQGhad&P
z@QDbygjvoJ#)Q|l3=cQ&y$s`DHUJF>9<ci0FFK$Wp#*Y41_&__1BpNak|4w)#E2LH
zLv#NV$VL4Yv0>+(*ia=5f~NWIEp87(C=sbZwuFzrTz7v(0N6V0)4$>YKYh!4pIa7?
zgJ=R>8U)k)h9T55HK4plfmhy(@_wtsfMbhco*PwTq!p+M&9SZbZEaHfrjBp=#>w@E
z{=MJzhWBq>$kyyhGt}QYZ?<)Lzdi8b9ta<bW6v|rUGxaAkkJ<(--?^3FTP02^KV;`
zi{2%F<1>HrJ1+J7D}H<n?;hVi{3Xr>c|oK9PLKZwU8(eQ=U2?l00000NkvXXu0mjf
D685nK

literal 0
HcmV?d00001

diff --git a/interface/web/themes/default/icons/x64/server.png b/interface/web/themes/default/icons/x64/server.png
new file mode 100644
index 0000000000000000000000000000000000000000..22a95e989a4e50224bcde7bf4421947bffabe327
GIT binary patch
literal 6880
zcmV<68Xx6}P)<h;3K|Lk000e1NJLTq002M$002M;1^@s6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96IB_XP<haA*np&Ump<P4Rf5gl@5Kkr|v3Y-o{-
zIGo^nk`9dX4@nv8sMjiT>f~$x6SjQbr}(G%#l%L=dy5g*YPFId4-F3=jI`#npZPR^
z+O}=m?AX}Y@X*juwO*?=YxR0#czCEeG&EdqBypo!t2UD)sYOxLjH0L#X<gG%R98wx
zI#P*3#Y*WYEG{(8orqvW#2I7r++<n5m*sh$nY5qvjCDPeXRRzvJ6WE0JDqMj%hD^x
znDbE-wbwUW|9(bXJ{uH8#BoezedAE-_4<O=df{td`x@<bn>^1Wajq^<7m=EX)SYuR
zLZd`PYWT)U74L!x6kEcDft15r$pV>DD$|+_bYDTLweF!*suUeieW0(D$^dG$8e?N)
zOioVz{V8C89fe<Ot!ucb<NN)7(T=jcUau`8?ZJy|Rb>2pWAJBn1MezDy<RW>x7Jdv
zR)4{JZ5;8>ny~rtldT$yzxY^xUTE_eY-1T?-cru~qT_7`)U6r{|F_0Z+u!>|#y|Ss
a4*ws@D28v~zziS&0000<MNUMnLSTZ7CpvKe

literal 0
HcmV?d00001

diff --git a/server/mods-available/monitor_core_module.inc.php b/server/mods-available/monitor_core_module.inc.php
index dd5443b566..452d0c5e39 100644
--- a/server/mods-available/monitor_core_module.inc.php
+++ b/server/mods-available/monitor_core_module.inc.php
@@ -27,714 +27,852 @@ OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
 NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE,
 EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
 */
-
 class monitor_core_module {
-	
-	/* TODO: this should be a config - var instead of a "constant" */
-	var $interval = 5; // do the monitoring every 5 minutes
-	
-	var $module_name = 'monitor_core_module';
-	var $class_name = 'monitor_core_module';
-	/* No actions at this time. maybe later... */
-	var $actions_available = array();
-	
-	/*
-	 	This function is called when the module is loaded
-	*/
-	
-	function onLoad() {
-		global $app;
-		
-		/*
-		Annonce the actions that where provided by this module, so plugins 
-		can register on them.
-		*/
-		/* none at them moment */
-		//$app->plugins->announceEvents($this->module_name,$this->actions_available);
-		
-		/*
-		As we want to get notified of any changes on several database tables,
-		we register for them.
-				
-		The following function registers the function "functionname"
-			to be executed when a record for the table "dbtable" is 
-			processed in the sys_datalog. "classname" is the name of the
-			class that contains the function functionname.
-		*/
-		/* none at them moment */
-		//$app->modules->registerTableHook('mail_access','mail_module','process');
-		
-		/*
-		Do the monitor every n minutes and write the result in the db
-		*/
-		$min = date('i');
-		if (($min % $this->interval) == 0)
-		{
-			$this->doMonitor();
-		}
-	}
-	
-	/*
-	 This function is called when a change in one of the registered tables is detected.
-	 The function then raises the events for the plugins.
-	*/
-	function process($tablename, $action, $data) {
-		//		global $app;
-		//		
-		//		switch ($tablename) {
-		//			case 'mail_access':
-		//				if($action == 'i') $app->plugins->raiseEvent('mail_access_insert',$data);
-		//				if($action == 'u') $app->plugins->raiseEvent('mail_access_update',$data);
-		//				if($action == 'd') $app->plugins->raiseEvent('mail_access_delete',$data);
-		//				break;
-		//		} // end switch
-	} // end function
-	
-	/*
-	This method is called every n minutes, when the module ist loaded.
-	The method then does a system-monitoring
-	*/
-	// TODO: what monitoring is done should be a config-var
-	function doMonitor()
-	{
-		/* Calls the single Monitoring steps */
-		$this->monitorServer();
-		$this->monitorDiskUsage();
-		$this->monitorMemUsage();
-		$this->monitorCpu();
-		$this->monitorServices();
-		$this->monitorMailLog();
-		$this->monitorMailWarnLog();
-		$this->monitorMailErrLog();
-		$this->monitorMessagesLog();
-		$this->monitorFreshClamLog();
-		$this->monitorClamAvLog();
-		$this->monitorIspConfigLog();
-	}
-	
-	function monitorServer(){
-		global $app;
-		global $conf;
-		
-		/* the id of the server as int */
-		$server_id = intval($conf["server_id"]);
-		
-		/** The type of the data */
-		$type = 'server_load';	
-		
-		/* Delete Data older than 1 day */
-		$this->_delOldRecords($type, 0, 0, 1);
-		
-		/*
-		Fetch the data into a array
-		*/
-		$procUptime = shell_exec("cat /proc/uptime | cut -f1 -d' '");
-		$data['up_days'] = floor($procUptime/86400);
-		$data['up_hours'] = floor(($procUptime-$data['up_days']*86400)/3600);
-		$data['up_minutes'] = floor(($procUptime-$data['up_days']*86400-$data['up_hours']*3600)/60);
-
-		$data['uptime'] = shell_exec("uptime");
-		
-		$tmp = explode(",", $data['uptime'], 3);
-		$tmpUser = explode(" ", trim($tmp[1]));
-		$data['user_online'] = intval($tmpUser[0]);
-		
-		$loadTmp = explode(":" , trim($tmp[2]));
-		$load = explode(",",  $loadTmp[1]);
-		$data['load_1'] = floatval(trim($load[0]));
-		$data['load_5'] = floatval(trim($load[1]));
-		$data['load_15'] = floatval(trim($load[2]));
-		
-		// Todo: the state should be calculated. For example if the load is to heavy, the state is warning...
-		$state = 'ok';
-		
-		/*
-		Insert the data into the database
-		*/
-		$sql = "INSERT INTO monitor_data (server_id, type, created, data, state) " .
-			"VALUES (".
-			$server_id . ", " .
-			"'" . $app->db->quote($type) . "', " .
-			time() . ", " .
-			"'" . $app->db->quote(serialize($data)) . "', " .
-			"'" . $state . "'" . 
-			")";
-		$app->db->query($sql);
-	}
-	
-	function monitorDiskUsage() {
-		global $app;
-		global $conf;
-		
-		/* the id of the server as int */
-		$server_id = intval($conf["server_id"]);
-		
-		/** The type of the data */
-		$type = 'disk_usage';	
-		
-		/* Delete Data older than 10 minutes */
-		$this->_delOldRecords($type, 10);
-		
-		/*
-		Fetch the data into a array
-		*/
-		$dfData = shell_exec("df");
-		
-		// split into array
-		$df = explode("\n", $dfData);
-		// ignore the first line make a array of the rest
-		for($i=1; $i <= sizeof($df); $i++){
-			if ($df[$i] != '')
-			{
-				$s = preg_split ("/[\s]+/", $df[$i]);
-				$data[$i]['fs'] = $s[0];
-				$data[$i]['size'] = $s[1];
-				$data[$i]['used'] = $s[2];
-				$data[$i]['available'] = $s[3];
-				$data[$i]['percent'] = $s[4];
-				$data[$i]['mounted'] = $s[5];
-			}
-		}
-		
-		// Todo: the state should be calculated. For example if the load is to heavy, the state is warning...
-		$state = 'ok';
-		
-		/*
-		Insert the data into the database
-		*/
-		$sql = "INSERT INTO monitor_data (server_id, type, created, data, state) " .
-			"VALUES (".
-			$server_id . ", " .
-			"'" . $app->db->quote($type) . "', " .
-			time() . ", " .
-			"'" . $app->db->quote(serialize($data)) . "', " .
-			"'" . $state . "'" . 
-			")";
-		$app->db->query($sql);
-	}
-		
-		
-	function monitorMemUsage()
-	{
-		global $app;
-		global $conf;
-		
-		/* the id of the server as int */
-		$server_id = intval($conf["server_id"]);
-		
-		/** The type of the data */
-		$type = 'mem_usage';	
-		
-		/* Delete Data older than 10 minutes */
-		$this->_delOldRecords($type, 10);
-		
-		/*
-		Fetch the data into a array
-		*/
-		$miData = shell_exec("cat /proc/meminfo");
-		
-		$memInfo = explode("\n", $miData);
-		
-		foreach($memInfo as $line){
-			$part = split(":", $line);
-			$key = trim($part[0]);
-			$tmp = explode(" ", trim($part[1]));
-			$value = 0;
-			if ($tmp[1] == 'kB') $value = $tmp[0] * 1024;
-			$data[$key] = $value;
-		}
-		
-		// Todo: the state should be calculated. For example if the load is to heavy, the state is warning...
-		$state = 'ok';
-		
-		/*
-		Insert the data into the database
-		*/
-		$sql = "INSERT INTO monitor_data (server_id, type, created, data, state) " .
-			"VALUES (".
-			$server_id . ", " .
-			"'" . $app->db->quote($type) . "', " .
-			time() . ", " .
-			"'" . $app->db->quote(serialize($data)) . "', " .
-			"'" . $state . "'" . 
-			")";
-		$app->db->query($sql);
-	}
-
-		
-	function monitorCpu()
-	{
-		global $app;
-		global $conf;
-		
-		/* the id of the server as int */
-		$server_id = intval($conf["server_id"]);
-		
-		/** The type of the data */
-		$type = 'cpu_info';	
-		
-		/* There is only ONE CPU-Data, so delete the old one */
-		$this->_delOldRecords($type, 0);
-		
-		/*
-		Fetch the data into a array
-		*/
-		$cpuData = shell_exec("cat /proc/cpuinfo");
-		$cpuInfo = explode("\n", $cpuData);
-		
-		foreach($cpuInfo as $line){
-			$part = split(":", $line);
-			$key = trim($part[0]);
-			$value = trim($part[1]);
-			$data[$key] = $value;
-		}
-		
-		// Todo: the state should be calculated. For example if the load is to heavy, the state is warning...
-		$state = 'ok';
-		
-		/*
-		Insert the data into the database
-		*/
-		$sql = "INSERT INTO monitor_data (server_id, type, created, data, state) " .
-			"VALUES (".
-			$server_id . ", " .
-			"'" . $app->db->quote($type) . "', " .
-			time() . ", " .
-			"'" . $app->db->quote(serialize($data)) . "', " .
-			"'" . $state . "'" . 
-			")";
-		$app->db->query($sql);
-	}
-
-		
-	function monitorServices()
-	{
-		global $app;
-		global $conf;
-		
-		/* the id of the server as int */
-		$server_id = intval($conf["server_id"]);
-		
-		/** The type of the data */
-		$type = 'services';	
-		
-		/* There is only ONE Service-Data, so delete the old one */
-		$this->_delOldRecords($type, 0);
-		
-		/* Monitor Webserver */
-		if($this->_checkTcp('localhost',80)) {
-			$data['webserver'] = true;
-		} else {
-			$data['webserver'] = false;
-		}
-		
-		/* Monitor FTP-Server */
-		if($this->_checkFtp('localhost',21)) {
-			$data['ftpserver'] = true;
-		} else {
-			$data['ftpserver'] = false;
-		}
-		
-		/* Monitor SMTP-Server */
-		if($this->_checkTcp('localhost',25)) {
-			$data['smtpserver'] = true;
-		} else {
-			$data['smtpserver'] = false;
-		}
-		
-		/* Monitor POP3-Server */
-		if($this->_checkTcp('localhost',110)) {
-			$data['pop3server'] = true;
-		} else {
-			$data['pop3server'] = false;
-		}
-		
-		/* Monitor BIND-Server */
-		if($this->_checkTcp('localhost',53)) {
-			$data['bindserver'] = true;
-		} else {
-			$data['bindserver'] = false;
-		}
-		
-		/* Monitor MYSQL-Server */
-		if($this->_checkTcp('localhost',3306)) {
-			$data['mysqlserver'] = true;
-		} else {
-			$data['mysqlserver'] = false;
-		}
-		
-		// Todo: the state should be calculated. For example if the load is to heavy, the state is warning...
-		$state = 'ok';
-		
-		/*
-		Insert the data into the database
-		*/
-		$sql = "INSERT INTO monitor_data (server_id, type, created, data, state) " .
-			"VALUES (".
-			$server_id . ", " .
-			"'" . $app->db->quote($type) . "', " .
-			time() . ", " .
-			"'" . $app->db->quote(serialize($data)) . "', " .
-			"'" . $state . "'" . 
-			")";
-		$app->db->query($sql);
-		
-	}
-	
-	function monitorMailLog()
-	{
-		global $app;
-		global $conf;
-		
-		/* the id of the server as int */
-		$server_id = intval($conf["server_id"]);
-		
-		/** The type of the data */
-		$type = 'log_mail';	
-		
-		/* There is only ONE Log-Data, so delete the old one */
-		$this->_delOldRecords($type, 0);
-		
-
-		/* Get the data of the log */
-		$data = $this->_getLogData($type);
-
-		// Todo: the state should be calculated. For example if the load is to heavy, the state is warning...
-		$state = 'ok';
-		
-		/*
-		Insert the data into the database
-		*/
-		$sql = "INSERT INTO monitor_data (server_id, type, created, data, state) " .
-			"VALUES (".
-			$server_id . ", " .
-			"'" . $app->db->quote($type) . "', " .
-			time() . ", " .
-			"'" . $app->db->quote(serialize($data)) . "', " .
-			"'" . $state . "'" . 
-			")";
-		$app->db->query($sql);
-	}
-		
-	function monitorMailWarnLog()
-	{
-		global $app;
-		global $conf;
-		
-		/* the id of the server as int */
-		$server_id = intval($conf["server_id"]);
-		
-		/** The type of the data */
-		$type = 'log_mail_warn';	
-		
-		/* There is only ONE Log-Data, so delete the old one */
-		$this->_delOldRecords($type, 0);
-		
-		
-		/* Get the data of the log */
-		$data = $this->_getLogData($type);
-		
-		// Todo: the state should be calculated. For example if the load is to heavy, the state is warning...
-		$state = 'ok';
-		
-		/*
-		Insert the data into the database
-		*/
-		$sql = "INSERT INTO monitor_data (server_id, type, created, data, state) " .
-			"VALUES (".
-			$server_id . ", " .
-			"'" . $app->db->quote($type) . "', " .
-			time() . ", " .
-			"'" . $app->db->quote(serialize($data)) . "', " .
-			"'" . $state . "'" . 
-			")";
-		$app->db->query($sql);
-	}
-	
-	function monitorMailErrLog()
-	{
-		global $app;
-		global $conf;
-		
-		/* the id of the server as int */
-		$server_id = intval($conf["server_id"]);
-		
-		/** The type of the data */
-		$type = 'log_mail_err';	
-		
-		/* There is only ONE Log-Data, so delete the old one */
-		$this->_delOldRecords($type, 0);
-		
-		
-		/* Get the data of the log */
-		$data = $this->_getLogData($type);
-		
-		// Todo: the state should be calculated. For example if the load is to heavy, the state is warning...
-		$state = 'ok';
-		
-		/*
-		Insert the data into the database
-		*/
-		$sql = "INSERT INTO monitor_data (server_id, type, created, data, state) " .
-			"VALUES (".
-			$server_id . ", " .
-			"'" . $app->db->quote($type) . "', " .
-			time() . ", " .
-			"'" . $app->db->quote(serialize($data)) . "', " .
-			"'" . $state . "'" . 
-			")";
-		$app->db->query($sql);
-	}
-	
-	
-	function monitorMessagesLog()
-	{
-		global $app;
-		global $conf;
-		
-		/* the id of the server as int */
-		$server_id = intval($conf["server_id"]);
-		
-		/** The type of the data */
-		$type = 'log_messages';	
-		
-		/* There is only ONE Log-Data, so delete the old one */
-		$this->_delOldRecords($type, 0);
-		
-		
-		/* Get the data of the log */
-		$data = $this->_getLogData($type);
-		
-		// Todo: the state should be calculated. For example if the load is to heavy, the state is warning...
-		$state = 'ok';
-		
-		/*
-		Insert the data into the database
-		*/
-		$sql = "INSERT INTO monitor_data (server_id, type, created, data, state) " .
-			"VALUES (".
-			$server_id . ", " .
-			"'" . $app->db->quote($type) . "', " .
-			time() . ", " .
-			"'" . $app->db->quote(serialize($data)) . "', " .
-			"'" . $state . "'" . 
-			")";
-		$app->db->query($sql);
-	}
-	
-	function monitorFreshClamLog()
-	{
-		global $app;
-		global $conf;
-		
-		/* the id of the server as int */
-		$server_id = intval($conf["server_id"]);
-		
-		/** The type of the data */
-		$type = 'log_freshclam';	
-		
-		/* There is only ONE Log-Data, so delete the old one */
-		$this->_delOldRecords($type, 0);
-		
-		
-		/* Get the data of the log */
-		$data = $this->_getLogData($type);
-		
-		// Todo: the state should be calculated. For example if the load is to heavy, the state is warning...
-		$state = 'ok';
-		
-		/*
-		Insert the data into the database
-		*/
-		$sql = "INSERT INTO monitor_data (server_id, type, created, data, state) " .
-			"VALUES (".
-			$server_id . ", " .
-			"'" . $app->db->quote($type) . "', " .
-			time() . ", " .
-			"'" . $app->db->quote(serialize($data)) . "', " .
-			"'" . $state . "'" . 
-			")";
-		$app->db->query($sql);
-	}
-	
-	function monitorClamAvLog()
-	{
-		global $app;
-		global $conf;
-		
-		/* the id of the server as int */
-		$server_id = intval($conf["server_id"]);
-		
-		/** The type of the data */
-		$type = 'log_clamav';	
-		
-		/* There is only ONE Log-Data, so delete the old one */
-		$this->_delOldRecords($type, 0);
-		
-		
-		/* Get the data of the log */
-		$data = $this->_getLogData($type);
-		
-		// Todo: the state should be calculated. For example if the load is to heavy, the state is warning...
-		$state = 'ok';
-		
-		/*
-		Insert the data into the database
-		*/
-		$sql = "INSERT INTO monitor_data (server_id, type, created, data, state) " .
-			"VALUES (".
-			$server_id . ", " .
-			"'" . $app->db->quote($type) . "', " .
-			time() . ", " .
-			"'" . $app->db->quote(serialize($data)) . "', " .
-			"'" . $state . "'" . 
-			")";
-		$app->db->query($sql);
-	}
-
-	function monitorIspConfigLog()
-	{
-		global $app;
-		global $conf;
-		
-		/* the id of the server as int */
-		$server_id = intval($conf["server_id"]);
-		
-		/** The type of the data */
-		$type = 'log_ispconfig';	
-		
-		/* There is only ONE Log-Data, so delete the old one */
-		$this->_delOldRecords($type, 0);
-		
-		
-		/* Get the data of the log */
-		$data = $this->_getLogData($type);
-		
-		// Todo: the state should be calculated. For example if the load is to heavy, the state is warning...
-		$state = 'ok';
-		
-		/*
-		Insert the data into the database
-		*/
-		$sql = "INSERT INTO monitor_data (server_id, type, created, data, state) " .
-			"VALUES (".
-			$server_id . ", " .
-			"'" . $app->db->quote($type) . "', " .
-			time() . ", " .
-			"'" . $app->db->quote(serialize($data)) . "', " .
-			"'" . $state . "'" . 
-			")";
-		$app->db->query($sql);
-	}
-	
-	
-	function _getLogData($log){
-		switch($log) {
-			case 'log_mail':
-				$logfile = '/var/log/mail.log';
-				break;
-			case 'log_mail_warn':
-				$logfile = '/var/log/mail.warn';
-				break;
-			case 'log_mail_err':
-				$logfile = '/var/log/mail.err';
-				break;
-			case 'log_messages':
-				$logfile = '/var/log/messages';
-				break;
-			case 'log_freshclam':
-				$logfile = '/var/log/clamav/freshclam.log';
-				break;
-			case 'log_clamav':
-				$logfile = '/var/log/clamav/clamav.log';
-				break;
-			case 'log_ispconfig':
-				$logfile = '/var/log/ispconfig/ispconfig.log';
-				break;
-			default:
-				$logfile = '';
-				break;
-		}
-		
-		// Getting the logfile content
-		if($logfile != '') {
-			$logfile = escapeshellcmd($logfile);
-			if(stristr($logfile,';')) die('Logfile path error.');
-			
-			$log = '';
-			if(is_readable($logfile)) {
-				if($fd = popen("tail -n 30 $logfile", 'r')) {
-					while (!feof($fd)) {
-						$log .= fgets($fd, 4096);
-						$n++;
-						if($n > 1000) break;
-					}
-					fclose($fd);
-				}
-			} else {
-				$log = 'Unable to read '.$logfile;
-			}
-		}
-		
-		return $log;
-	}
-		
-	function _checkTcp ($host,$port) {
-			
-			$fp = @fsockopen ($host, $port, &$errno, &$errstr, 2);
-			
-			if ($fp) {
-				return true;
-				fclose($fp);
-			} else {
-				return false;
-				fclose($fp);
-			}
-		}
-		
-		function _checkUdp ($host,$port) {
-			
-			$fp = @fsockopen ('udp://'.$host, $port, &$errno, &$errstr, 2);
-			
-			if ($fp) {
-				return true;
-				fclose($fp);
-			} else {
-				return false;
-				fclose($fp);
-			}
-		}
-		
-		function _checkFtp ($host,$port){
-			
-			$conn_id = @ftp_connect($host, $port);
-			
-			if($conn_id){
-				@ftp_close($conn_id);
-				return true;
-			} else {
-				@ftp_close($conn_id);
-				return false;
-			}
-		}
-	
-	/*
-	 Deletes Records older than n.
-	*/
-	function _delOldRecords($type, $min, $hour=0, $days=0) {
-		global $app;
-		
-		$now = time();
-		$old = $now - ($min * 60) - ($hour * 60 * 60) - ($days * 24 * 60 * 60);
-		$sql = "DELETE FROM monitor_data " .
-			"WHERE " .
-			"type =" . "'" . $app->db->quote($type) . "' " .
-			"AND " .	
-			"created < " . $old;
-		$app->db->query($sql);
-	}
-	
-	
+    /* TODO: this should be a config - var instead of a "constant" */
+    var $interval = 5; // do the monitoring every 5 minutes
+
+    var $module_name = 'monitor_core_module';
+    var $class_name = 'monitor_core_module';
+    /* No actions at this time. maybe later... */
+    var $actions_available = array();
+
+    /*
+        This function is called when the module is loaded
+    */
+    function onLoad() {
+        global $app;
+
+        /*
+        Annonce the actions that where provided by this module, so plugins
+        can register on them.
+        */
+        /* none at them moment */
+        //$app->plugins->announceEvents($this->module_name,$this->actions_available);
+
+        /*
+        As we want to get notified of any changes on several database tables,
+        we register for them.
+
+        The following function registers the function "functionname"
+            to be executed when a record for the table "dbtable" is
+            processed in the sys_datalog. "classname" is the name of the
+            class that contains the function functionname.
+        */
+        /* none at them moment */
+        //$app->modules->registerTableHook('mail_access','mail_module','process');
+
+        /*
+        Do the monitor every n minutes and write the result in the db
+        */
+        $min = date('i');
+        if (($min % $this->interval) == 0)
+        {
+            $this->doMonitor();
+        }
+    }
+
+    /*
+     This function is called when a change in one of the registered tables is detected.
+     The function then raises the events for the plugins.
+    */
+    function process($tablename, $action, $data) {
+        //		global $app;
+        //
+        //		switch ($tablename) {
+        //			case 'mail_access':
+        //				if($action == 'i') $app->plugins->raiseEvent('mail_access_insert',$data);
+        //				if($action == 'u') $app->plugins->raiseEvent('mail_access_update',$data);
+        //				if($action == 'd') $app->plugins->raiseEvent('mail_access_delete',$data);
+        //				break;
+        //		} // end switch
+    } // end function
+
+    /*
+    This method is called every n minutes, when the module ist loaded.
+    The method then does a system-monitoring
+    */
+    // TODO: what monitoring is done should be a config-var
+    function doMonitor()
+    {
+        /* Calls the single Monitoring steps */
+        $this->monitorServer();
+        $this->monitorDiskUsage();
+        $this->monitorMemUsage();
+        $this->monitorCpu();
+        $this->monitorServices();
+        $this->monitorMailLog();
+        $this->monitorMailWarnLog();
+        $this->monitorMailErrLog();
+        $this->monitorMessagesLog();
+        $this->monitorFreshClamLog();
+        $this->monitorClamAvLog();
+        $this->monitorIspConfigLog();
+    }
+
+    function monitorServer(){
+        global $app;
+        global $conf;
+
+        /* the id of the server as int */
+        $server_id = intval($conf["server_id"]);
+
+        /** The type of the data */
+        $type = 'server_load';
+
+        /* Delete Data older than 1 day */
+        $this->_delOldRecords($type, 0, 0, 1);
+
+        /*
+        Fetch the data into a array
+        */
+        $procUptime = shell_exec("cat /proc/uptime | cut -f1 -d' '");
+        $data['up_days'] = floor($procUptime/86400);
+        $data['up_hours'] = floor(($procUptime-$data['up_days']*86400)/3600);
+        $data['up_minutes'] = floor(($procUptime-$data['up_days']*86400-$data['up_hours']*3600)/60);
+
+        $data['uptime'] = shell_exec("uptime");
+
+        $tmp = explode(",", $data['uptime'], 3);
+        $tmpUser = explode(" ", trim($tmp[1]));
+        $data['user_online'] = intval($tmpUser[0]);
+
+        $loadTmp = explode(":" , trim($tmp[2]));
+        $load = explode(",",  $loadTmp[1]);
+        $data['load_1'] = floatval(trim($load[0]));
+        $data['load_5'] = floatval(trim($load[1]));
+        $data['load_15'] = floatval(trim($load[2]));
+
+        /** The state of the server-load. */
+        $state = 'ok';
+        if ($data['load_1'] > 20 ) $state = 'info';
+        if ($data['load_1'] > 50 ) $state = 'warning';
+        if ($data['load_1'] > 100 ) $state = 'critical';
+        if ($data['load_1'] > 150 ) $state = 'error';
+
+        /*
+        Insert the data into the database
+        */
+        $sql = "INSERT INTO monitor_data (server_id, type, created, data, state) " .
+            "VALUES (".
+        $server_id . ", " .
+            "'" . $app->db->quote($type) . "', " .
+        time() . ", " .
+            "'" . $app->db->quote(serialize($data)) . "', " .
+            "'" . $state . "'" .
+            ")";
+        $app->db->query($sql);
+    }
+
+    function monitorDiskUsage() {
+        global $app;
+        global $conf;
+
+        /* the id of the server as int */
+        $server_id = intval($conf["server_id"]);
+
+        /** The type of the data */
+        $type = 'disk_usage';
+
+        /* Delete Data older than 10 minutes */
+        $this->_delOldRecords($type, 10);
+
+        /** The state of the disk-usage */
+        $state = 'ok';
+
+        /** Fetch the data into a array */
+        $dfData = shell_exec("df");
+
+        // split into array
+        $df = explode("\n", $dfData);
+
+        /*
+         * ignore the first line, process the rest
+         */
+        for($i=1; $i <= sizeof($df); $i++){
+            if ($df[$i] != '')
+            {
+                /*
+                 * Make a array of the data
+                 */
+                $s = preg_split ("/[\s]+/", $df[$i]);
+                $data[$i]['fs'] = $s[0];
+                $data[$i]['size'] = $s[1];
+                $data[$i]['used'] = $s[2];
+                $data[$i]['available'] = $s[3];
+                $data[$i]['percent'] = $s[4];
+                $data[$i]['mounted'] = $s[5];
+                /*
+                 * calculate the state
+                 */
+                $usePercent = floatval($data[$i]['percent']);
+                if ($usePercent > 75) $state = $this->_setState($state, 'info');
+                if ($usePercent > 80) $state = $this->_setState($state, 'warning');
+                if ($usePercent > 90) $state = $this->_setState($state, 'critical');
+                if ($usePercent > 95) $state = $this->_setState($state, 'error');
+            }
+        }
+
+
+        /*
+        Insert the data into the database
+        */
+        $sql = "INSERT INTO monitor_data (server_id, type, created, data, state) " .
+            "VALUES (".
+        $server_id . ", " .
+            "'" . $app->db->quote($type) . "', " .
+        time() . ", " .
+            "'" . $app->db->quote(serialize($data)) . "', " .
+            "'" . $state . "'" .
+            ")";
+        $app->db->query($sql);
+    }
+
+
+    function monitorMemUsage()
+    {
+        global $app;
+        global $conf;
+
+        /* the id of the server as int */
+        $server_id = intval($conf["server_id"]);
+
+        /** The type of the data */
+        $type = 'mem_usage';
+
+        /* Delete Data older than 10 minutes */
+        $this->_delOldRecords($type, 10);
+
+        /*
+        Fetch the data into a array
+        */
+        $miData = shell_exec("cat /proc/meminfo");
+
+        $memInfo = explode("\n", $miData);
+
+        foreach($memInfo as $line){
+            $part = split(":", $line);
+            $key = trim($part[0]);
+            $tmp = explode(" ", trim($part[1]));
+            $value = 0;
+            if ($tmp[1] == 'kB') $value = $tmp[0] * 1024;
+            $data[$key] = $value;
+        }
+
+        /*
+         * actually this info has no state.
+         * maybe someone knows better...???...
+         */
+        $state = 'no_state';
+
+        /*
+        Insert the data into the database
+        */
+        $sql = "INSERT INTO monitor_data (server_id, type, created, data, state) " .
+            "VALUES (".
+        $server_id . ", " .
+            "'" . $app->db->quote($type) . "', " .
+        time() . ", " .
+            "'" . $app->db->quote(serialize($data)) . "', " .
+            "'" . $state . "'" .
+            ")";
+        $app->db->query($sql);
+    }
+
+
+    function monitorCpu()
+    {
+        global $app;
+        global $conf;
+
+        /* the id of the server as int */
+        $server_id = intval($conf["server_id"]);
+
+        /** The type of the data */
+        $type = 'cpu_info';
+
+        /* There is only ONE CPU-Data, so delete the old one */
+        $this->_delOldRecords($type, 0);
+
+        /*
+        Fetch the data into a array
+        */
+        $cpuData = shell_exec("cat /proc/cpuinfo");
+        $cpuInfo = explode("\n", $cpuData);
+
+        foreach($cpuInfo as $line){
+            $part = split(":", $line);
+            $key = trim($part[0]);
+            $value = trim($part[1]);
+            $data[$key] = $value;
+        }
+
+        /* the cpu has no state. It is, what it is */
+        $state = 'no_state';
+
+        /*
+        Insert the data into the database
+        */
+        $sql = "INSERT INTO monitor_data (server_id, type, created, data, state) " .
+            "VALUES (".
+        $server_id . ", " .
+            "'" . $app->db->quote($type) . "', " .
+        time() . ", " .
+            "'" . $app->db->quote(serialize($data)) . "', " .
+            "'" . $state . "'" .
+            ")";
+        $app->db->query($sql);
+    }
+
+
+    function monitorServices()
+    {
+        global $app;
+        global $conf;
+
+        /** the id of the server as int */
+        $server_id = intval($conf["server_id"]);
+
+        /** get the "active" Services of the server from the DB */
+        $services = $app->db->queryOneRecord("SELECT * FROM server WHERE server_id = " . $server_id);
+
+        /* The type of the Monitor-data */
+        $type = 'services';
+
+        /* There is only ONE Service-Data, so delete the old one */
+        $this->_delOldRecords($type, 0);
+
+        /** the State of the monitoring */
+        /* ok, if ALL aktive services are running,
+         * error, if not
+         * There is no other state!
+         */
+        $state = 'ok';
+
+        /* Monitor Webserver */
+        $data['webserver'] = -1; // unknown - not needed
+        if ($services['web_server'] == 1)
+        {
+            if($this->_checkTcp('localhost', 80)) {
+                $data['webserver'] = 1;
+            } else {
+                $data['webserver'] = 0;
+                $state = 'error'; // because service is down
+            }
+        }
+
+        /* Monitor FTP-Server */
+        $data['ftpserver'] = -1; // unknown - not needed
+        if ($services['file_server'] == 1)
+        {
+            if($this->_checkFtp('localhost', 21)) {
+                $data['ftpserver'] = 1;
+            } else {
+                $data['ftpserver'] = 0;
+                $state = 'error'; // because service is down
+            }
+        }
+
+        /* Monitor SMTP-Server */
+        $data['smtpserver'] = -1; // unknown - not needed
+        if ($services['mail_server'] == 1)
+        {
+            if($this->_checkTcp('localhost', 25)) {
+                $data['smtpserver'] = 1;
+            } else {
+                $data['smtpserver'] = 0;
+                $state = 'error'; // because service is down
+            }
+        }
+
+        /* Monitor POP3-Server */
+        $data['pop3server'] = -1; // unknown - not needed
+        if ($services['mail_server'] == 1)
+        {
+            if($this->_checkTcp('localhost', 110)) {
+                $data['pop3server'] = 1;
+            } else {
+                $data['pop3server'] = 0;
+                $state = 'error'; // because service is down
+            }
+        }
+
+        /* Monitor IMAP-Server */
+        $data['imapserver'] = -1; // unknown - not needed
+        if ($services['mail_server'] == 1)
+        {
+            if($this->_checkTcp('localhost', 143)) {
+                $data['imapserver'] = 1;
+            } else {
+                $data['imapserver'] = 0;
+                $state = 'error'; // because service is down
+            }
+        }
+
+        /* Monitor BIND-Server */
+        $data['bindserver'] = -1; // unknown - not needed
+        if ($services['dns_server'] == 1)
+        {
+            if($this->_checkTcp('localhost', 53)) {
+                $data['bindserver'] = 1;
+            } else {
+                $data['bindserver'] = 0;
+                $state = 'error'; // because service is down
+            }
+        }
+
+        /* Monitor MYSQL-Server */
+        $data['mysqlserver'] = -1; // unknown - not needed
+        if ($services['db_server'] == 1)
+        {
+            if($this->_checkTcp('localhost', 3306)) {
+                $data['mysqlserver'] = 1;
+            } else {
+                $data['mysqlserver'] = 0;
+                $state = 'error'; // because service is down
+            }
+        }
+
+
+        /*
+        Insert the data into the database
+        */
+        $sql = "INSERT INTO monitor_data (server_id, type, created, data, state) " .
+            "VALUES (".
+        $server_id . ", " .
+            "'" . $app->db->quote($type) . "', " .
+        time() . ", " .
+            "'" . $app->db->quote(serialize($data)) . "', " .
+            "'" . $state . "'" .
+            ")";
+        $app->db->query($sql);
+
+    }
+
+    function monitorMailLog()
+    {
+        global $app;
+        global $conf;
+
+        /* the id of the server as int */
+        $server_id = intval($conf["server_id"]);
+
+        /** The type of the data */
+        $type = 'log_mail';
+
+        /* There is only ONE Log-Data, so delete the old one */
+        $this->_delOldRecords($type, 0);
+
+        /* Get the data of the log */
+        $data = $this->_getLogData($type);
+
+        /*
+         * actually this info has no state.
+         * maybe someone knows better...???...
+         */
+        $state = 'no_state';
+
+        /*
+        Insert the data into the database
+        */
+        $sql = "INSERT INTO monitor_data (server_id, type, created, data, state) " .
+            "VALUES (".
+        $server_id . ", " .
+            "'" . $app->db->quote($type) . "', " .
+        time() . ", " .
+            "'" . $app->db->quote(serialize($data)) . "', " .
+            "'" . $state . "'" .
+            ")";
+        $app->db->query($sql);
+    }
+
+    function monitorMailWarnLog()
+    {
+        global $app;
+        global $conf;
+
+        /* the id of the server as int */
+        $server_id = intval($conf["server_id"]);
+
+        /** The type of the data */
+        $type = 'log_mail_warn';
+
+        /* There is only ONE Log-Data, so delete the old one */
+        $this->_delOldRecords($type, 0);
+
+
+        /* Get the data of the log */
+        $data = $this->_getLogData($type);
+
+        /*
+         * actually this info has no state.
+         * maybe someone knows better...???...
+         */
+        $state = 'no_state';
+
+        /*
+        Insert the data into the database
+        */
+        $sql = "INSERT INTO monitor_data (server_id, type, created, data, state) " .
+            "VALUES (".
+        $server_id . ", " .
+            "'" . $app->db->quote($type) . "', " .
+        time() . ", " .
+            "'" . $app->db->quote(serialize($data)) . "', " .
+            "'" . $state . "'" .
+            ")";
+        $app->db->query($sql);
+    }
+
+    function monitorMailErrLog()
+    {
+        global $app;
+        global $conf;
+
+        /* the id of the server as int */
+        $server_id = intval($conf["server_id"]);
+
+        /** The type of the data */
+        $type = 'log_mail_err';
+
+        /* There is only ONE Log-Data, so delete the old one */
+        $this->_delOldRecords($type, 0);
+
+
+        /* Get the data of the log */
+        $data = $this->_getLogData($type);
+
+        /*
+         * actually this info has no state.
+         * maybe someone knows better...???...
+         */
+        $state = 'no_state';
+
+        /*
+        Insert the data into the database
+        */
+        $sql = "INSERT INTO monitor_data (server_id, type, created, data, state) " .
+            "VALUES (".
+        $server_id . ", " .
+            "'" . $app->db->quote($type) . "', " .
+        time() . ", " .
+            "'" . $app->db->quote(serialize($data)) . "', " .
+            "'" . $state . "'" .
+            ")";
+        $app->db->query($sql);
+    }
+
+
+    function monitorMessagesLog()
+    {
+        global $app;
+        global $conf;
+
+        /* the id of the server as int */
+        $server_id = intval($conf["server_id"]);
+
+        /** The type of the data */
+        $type = 'log_messages';
+
+        /* There is only ONE Log-Data, so delete the old one */
+        $this->_delOldRecords($type, 0);
+
+        /* Get the data of the log */
+        $data = $this->_getLogData($type);
+
+        /*
+         * actually this info has no state.
+         * maybe someone knows better...???...
+         */
+        $state = 'no_state';
+
+        /*
+        Insert the data into the database
+        */
+        $sql = "INSERT INTO monitor_data (server_id, type, created, data, state) " .
+            "VALUES (".
+        $server_id . ", " .
+            "'" . $app->db->quote($type) . "', " .
+        time() . ", " .
+            "'" . $app->db->quote(serialize($data)) . "', " .
+            "'" . $state . "'" .
+            ")";
+        $app->db->query($sql);
+    }
+
+    function monitorFreshClamLog()
+    {
+        global $app;
+        global $conf;
+
+        /* the id of the server as int */
+        $server_id = intval($conf["server_id"]);
+
+        /** The type of the data */
+        $type = 'log_freshclam';
+
+        /* There is only ONE Log-Data, so delete the old one */
+        $this->_delOldRecords($type, 0);
+
+
+        /* Get the data of the log */
+        $data = $this->_getLogData($type);
+
+        // Todo: the state should be calculated.
+        $state = 'ok';
+
+        /*
+        Insert the data into the database
+        */
+        $sql = "INSERT INTO monitor_data (server_id, type, created, data, state) " .
+            "VALUES (".
+        $server_id . ", " .
+            "'" . $app->db->quote($type) . "', " .
+        time() . ", " .
+            "'" . $app->db->quote(serialize($data)) . "', " .
+            "'" . $state . "'" .
+            ")";
+        $app->db->query($sql);
+    }
+
+    function monitorClamAvLog()
+    {
+        global $app;
+        global $conf;
+
+        /* the id of the server as int */
+        $server_id = intval($conf["server_id"]);
+
+        /** The type of the data */
+        $type = 'log_clamav';
+
+        /* There is only ONE Log-Data, so delete the old one */
+        $this->_delOldRecords($type, 0);
+
+        /* Get the data of the log */
+        $data = $this->_getLogData($type);
+
+        // Todo: the state should be calculated.
+        $state = 'ok';
+
+        /*
+        Insert the data into the database
+        */
+        $sql = "INSERT INTO monitor_data (server_id, type, created, data, state) " .
+            "VALUES (".
+        $server_id . ", " .
+            "'" . $app->db->quote($type) . "', " .
+        time() . ", " .
+            "'" . $app->db->quote(serialize($data)) . "', " .
+            "'" . $state . "'" .
+            ")";
+        $app->db->query($sql);
+    }
+
+    function monitorIspConfigLog()
+    {
+        global $app;
+        global $conf;
+
+        /* the id of the server as int */
+        $server_id = intval($conf["server_id"]);
+
+        /** The type of the data */
+        $type = 'log_ispconfig';
+
+        /* There is only ONE Log-Data, so delete the old one */
+        $this->_delOldRecords($type, 0);
+
+
+        /* Get the data of the log */
+        $data = $this->_getLogData($type);
+
+        // Todo: the state should be calculated.
+        $state = 'ok';
+
+        /*
+        Insert the data into the database
+        */
+        $sql = "INSERT INTO monitor_data (server_id, type, created, data, state) " .
+            "VALUES (".
+        $server_id . ", " .
+            "'" . $app->db->quote($type) . "', " .
+        time() . ", " .
+            "'" . $app->db->quote(serialize($data)) . "', " .
+            "'" . $state . "'" .
+            ")";
+        $app->db->query($sql);
+    }
+
+
+    function _getLogData($log){
+        switch($log) {
+            case 'log_mail':
+                $logfile = '/var/log/mail.log';
+                break;
+            case 'log_mail_warn':
+                $logfile = '/var/log/mail.warn';
+                break;
+            case 'log_mail_err':
+                $logfile = '/var/log/mail.err';
+                break;
+            case 'log_messages':
+                $logfile = '/var/log/messages';
+                break;
+            case 'log_freshclam':
+                $logfile = '/var/log/clamav/freshclam.log';
+                break;
+            case 'log_clamav':
+                $logfile = '/var/log/clamav/clamav.log';
+                break;
+            case 'log_ispconfig':
+                $logfile = '/var/log/ispconfig/ispconfig.log';
+                break;
+            default:
+                $logfile = '';
+                break;
+        }
+
+        // Getting the logfile content
+        if($logfile != '') {
+            $logfile = escapeshellcmd($logfile);
+            if(stristr($logfile, ';')) {
+                $log = 'Logfile path error.';
+            }
+            else
+            {
+                $log = '';
+                if(is_readable($logfile)) {
+                    if($fd = popen("tail -n 100 $logfile", 'r')) {
+                        while (!feof($fd)) {
+                            $log .= fgets($fd, 4096);
+                            $n++;
+                            if($n > 1000) break;
+                        }
+                        fclose($fd);
+                    }
+                } else {
+                    $log = 'Unable to read '.$logfile;
+                }
+            }
+        }
+
+        return $log;
+    }
+
+    function _checkTcp ($host,$port) {
+
+        $fp = @fsockopen ($host, $port, &$errno, &$errstr, 2);
+
+        if ($fp) {
+            fclose($fp);
+            return true;
+        } else {
+            return false;
+        }
+    }
+
+    function _checkUdp ($host,$port) {
+
+        $fp = @fsockopen ('udp://'.$host, $port, &$errno, &$errstr, 2);
+
+        if ($fp) {
+            fclose($fp);
+            return true;
+        } else {
+            return false;
+        }
+    }
+
+    function _checkFtp ($host,$port){
+
+        $conn_id = @ftp_connect($host, $port);
+
+        if($conn_id){
+            @ftp_close($conn_id);
+            return true;
+        } else {
+            return false;
+        }
+    }
+
+    /*
+     Deletes Records older than n.
+    */
+    function _delOldRecords($type, $min, $hour=0, $days=0) {
+        global $app;
+
+        $now = time();
+        $old = $now - ($min * 60) - ($hour * 60 * 60) - ($days * 24 * 60 * 60);
+        $sql = "DELETE FROM monitor_data " .
+            "WHERE " .
+            "type =" . "'" . $app->db->quote($type) . "' " .
+            "AND " .
+            "created < " . $old;
+        $app->db->query($sql);
+    }
+
+    /*
+     * Set the state to the given level (or higher, but not lesser).
+     * * If the actual state is critical and you call the method with ok,
+     *   then the state is critical.
+     *
+     * * If the actual state is critical and you call the method with error,
+     *   then the state is error.
+     */
+    function _setState($oldState, $newState)
+    {
+        /*
+         * Calculate the weight of the old state
+         */
+        switch ($oldState) {
+            case 'no_state': $oldInt = 0;
+                break;
+            case 'ok': $oldInt = 1;
+                break;
+            case 'unknown': $oldInt = 2;
+                break;
+            case 'info': $oldInt = 3;
+                break;
+            case 'warning': $oldInt = 4;
+                break;
+            case 'critical': $oldInt = 5;
+                break;
+            case 'error': $oldInt = 6;
+                break;
+        }
+        /*
+         * Calculate the weight of the new state
+         */
+        switch ($newState) {
+            case 'no_state': $newInt = 0 ;
+                break;
+            case 'unknown': $newInt = 1 ;
+                break;
+            case 'ok': $newInt = 2 ;
+                break;
+            case 'info': $newInt = 3 ;
+                break;
+            case 'warning': $newInt = 4 ;
+                break;
+            case 'critical': $newInt = 5 ;
+                break;
+            case 'error': $newInt = 6 ;
+                break;
+        }
+
+        /*
+         * Set to the higher level
+         */
+        if ($newInt > $oldInt){
+            return $newState;
+        }
+        else
+        {
+            return $oldState;
+        }
+    }
+
+
 } // end class
 
 ?>
\ No newline at end of file
-- 
GitLab