From 72d35e70f309b4f2a696ca3a2320bf4e2c1d08da Mon Sep 17 00:00:00 2001
From: hahn <axel.hahn@iml.unibe.ch>
Date: Fri, 7 Jun 2019 12:17:49 +0200
Subject: [PATCH] update appmonitor client; add load and apache status

---
 .../appmonitor/classes/appmonitor-checks.class.php     | 10 +++++++++-
 .../appmonitor/classes/appmonitor-client.class.php     |  4 ++--
 2 files changed, 11 insertions(+), 3 deletions(-)

diff --git a/public_html/appmonitor/classes/appmonitor-checks.class.php b/public_html/appmonitor/classes/appmonitor-checks.class.php
index d0f7a764..a4d6914a 100644
--- a/public_html/appmonitor/classes/appmonitor-checks.class.php
+++ b/public_html/appmonitor/classes/appmonitor-checks.class.php
@@ -49,7 +49,7 @@ if(!defined('RESULT_OK')){
  * 2019-05-31  0.87  axel.hahn@iml.unibe.ch  add timeout as param in connective checks (http, tcp, databases)<br>
  * 2019-06-05  0.88  axel.hahn@iml.unibe.ch  add plugins<br>
  * --------------------------------------------------------------------------------<br>
- * @version 0.89
+ * @version 0.91
  * @author Axel Hahn
  * @link TODO
  * @license GPL
@@ -906,10 +906,18 @@ class appmonitorcheck {
             $this->_setReturn(RESULT_ERROR, "ERROR: Sqlite database file " . $aParams["db"] . " does not exist.");
             return false;
         }
+        if(!isset($aParams['user'])){
+            $aParams['user']='';
+        }
+        if(!isset($aParams['password'])){
+            $aParams['password']='';
+        }
         try {
             // $db = new SQLite3($sqliteDB);
             // $db = new PDO("sqlite:".$sqliteDB);
             $o = new PDO("sqlite:" . $aParams["db"],
+                $aParams['user'], 
+                $aParams['password'], 
                 array(
                     PDO::ATTR_TIMEOUT => (isset($aParams["timeout"]) && (int)$aParams["timeout"]) ? (int)$aParams["timeout"] : $this->_iTimeoutTcp,                  
                 )
diff --git a/public_html/appmonitor/classes/appmonitor-client.class.php b/public_html/appmonitor/classes/appmonitor-client.class.php
index a4dbe9d1..67856acb 100644
--- a/public_html/appmonitor/classes/appmonitor-client.class.php
+++ b/public_html/appmonitor/classes/appmonitor-client.class.php
@@ -37,7 +37,7 @@
  * 2018-11-05  0.58  axel.hahn@iml.unibe.ch  additional flag in http check to show content<br>
  * 2019-05-31  0.87  axel.hahn@iml.unibe.ch  add timeout as param in connective checks (http, tcp, databases)<br>
  * --------------------------------------------------------------------------------<br>
- * @version 0.88
+ * @version 0.91
  * @author Axel Hahn
  * @link TODO
  * @license GPL
@@ -51,7 +51,7 @@ class appmonitor {
      * value is in seconds
      * @var int
      */
-    protected $_sVersion = 'php-client-v0.89';
+    protected $_sVersion = 'php-client-v0.91';
 
     /**
      * config: default ttl for server before requesting the client check again
-- 
GitLab