From 7162553354e297f7c152144eed24aaecd28e7b43 Mon Sep 17 00:00:00 2001
From: vogelor <vogelor@ispconfig3>
Date: Mon, 24 Nov 2008 16:27:37 -0500
Subject: [PATCH] The monitor now monitors the mailq and (on debian/ubuntu) the update-status

---
 interface/web/monitor/tools.inc.php |   45 ++++++++++++++++++++++++++++++++++++++++-----
 1 files changed, 40 insertions(+), 5 deletions(-)

diff --git a/interface/web/monitor/tools.inc.php b/interface/web/monitor/tools.inc.php
index a238671..6f56f56 100644
--- a/interface/web/monitor/tools.inc.php
+++ b/interface/web/monitor/tools.inc.php
@@ -11,7 +11,7 @@
         /*
         Format the data
         */
-        $html .=
+        $html =
         '<table id="system_load">
             <tr>
             <td>' . $app->lng("Server online since").':</td>
@@ -53,7 +53,7 @@
         /*
         Format the data
         */
-        $html .= '<table id="system_disk">';
+        $html = '<table id="system_disk">';
         foreach($data as $line) {
             $html .= '<tr>';
             foreach ($line as $item) {
@@ -84,7 +84,7 @@
         /*
         Format the data
         */
-        $html .= '<table id="system_memusage">';
+        $html = '<table id="system_memusage">';
 
         foreach($data as $key => $value){
             if ($key != '') {
@@ -115,7 +115,7 @@
         /*
         Format the data
         */
-        $html .= '<table id="system_cpu">';
+        $html = '<table id="system_cpu">';
         foreach($data as $key => $value){
             if ($key != '') {
                 $html .= '<tr>
@@ -145,7 +145,7 @@
         /*
         Format the data
         */
-        $html .= '<table id="system_services">';
+        $html = '<table id="system_services">';
 
         if($data['webserver'] != -1) {
             if($data['webserver'] == 1) {
@@ -241,4 +241,39 @@
 
     return $html;
 }
+
+function showSystemUpdate()
+{
+    global $app;
+
+    /* fetch the Data from the DB */
+    $record = $app->db->queryOneRecord("SELECT data, state FROM monitor_data WHERE type = 'system_update' and server_id = " . $_SESSION['monitor']['server_id'] . " order by created desc");
+
+    if(isset($record['data'])) {
+        $data = unserialize($record['data']);
+        $html = nl2br($data['output']);
+    } else {
+        $html = '<p>' . "No Update-Data available" . '</p>';
+    }
+
+    return $html;
+}
+
+
+function showMailq()
+{
+    global $app;
+
+    /* fetch the Data from the DB */
+    $record = $app->db->queryOneRecord("SELECT data, state FROM monitor_data WHERE type = 'mailq' and server_id = " . $_SESSION['monitor']['server_id'] . " order by created desc");
+
+    if(isset($record['data'])) {
+        $data = unserialize($record['data']);
+        $html = nl2br($data['output']);
+    } else {
+        $html = '<p>' . "No Mailq-Data available" . '</p>';
+    }
+
+    return $html;
+}
 ?>

--
Gitblit v1.9.1