Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
I
Imldeployment
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Container registry
Model registry
Operate
Environments
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
GitLab community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
IML Open Source
Imldeployment
Merge requests
!18
update appmonitor client to v0.111
Code
Review changes
Check out branch
Download
Patches
Plain diff
Expand sidebar
Merged
update appmonitor client to v0.111
update-appmonitor-client
into
master
Overview
0
Commits
1
Pipelines
0
Changes
8
Merged
Hahn Axel (hahn)
requested to merge
update-appmonitor-client
into
master
3 years ago
Overview
0
Commits
1
Pipelines
0
Changes
8
0
0
Merge request reports
Compare
master
master (base)
and
latest version
latest version
18b1aa8a
1 commit,
3 years ago
8 files
+
370
−
108
Inline
Compare changes
Side-by-side
Inline
Show whitespace changes
Show one file at a time
Files
8
public_html/appmonitor/classes/appmonitor-client.class.php
+
33
−
22
View file @ 18b1aa8a
Edit in single-file editor
Open in Web IDE
Show full file
@@ -32,15 +32,16 @@ if (!class_exists('appmonitorcheck')){
* --------------------------------------------------------------------------------<br>
* <br>
* --- HISTORY:<br>
* 2014-10-24 0.5 axel.hahn@iml.unibe.ch<br>
* 2014-11-21 0.6 axel.hahn@iml.unibe.ch removed meta::ts <br>
* 2018-08-23 0.50 axel.hahn@iml.unibe.ch show version<br>
* 2018-08-24 0.51 axel.hahn@iml.unibe.ch method to show local status page<br>
* 2018-08-27 0.52 axel.hahn@iml.unibe.ch add pdo connect (starting with mysql)<br>
* 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>
* 2014-10-24 0.5 axel.hahn@iml.unibe.ch<br>
* 2014-11-21 0.6 axel.hahn@iml.unibe.ch removed meta::ts <br>
* 2018-08-23 0.50 axel.hahn@iml.unibe.ch show version<br>
* 2018-08-24 0.51 axel.hahn@iml.unibe.ch method to show local status page<br>
* 2018-08-27 0.52 axel.hahn@iml.unibe.ch add pdo connect (starting with mysql)<br>
* 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>
* 2020-05-03 0.110 axel.hahn@iml.unibe.ch update renderHtmloutput<br>
* --------------------------------------------------------------------------------<br>
* @version 0.
99
* @version 0.
111
* @author Axel Hahn
* @link TODO
* @license GPL
@@ -54,7 +55,7 @@ class appmonitor {
* value is in seconds
* @var int
*/
protected
$_sVersion
=
'php-client-v0.1
09
'
;
protected
$_sVersion
=
'php-client-v0.1
11
'
;
/**
* config: default ttl for server before requesting the client check again
@@ -481,34 +482,44 @@ class appmonitor {
.
'</div>'
.
'Host: '
.
(
isset
(
$aData
[
'meta'
][
'host'
])
?
'<span class="string">'
.
$aData
[
'meta'
][
'host'
]
.
'</span>'
:
'?'
)
.
'<br>'
.
'Website: '
.
(
isset
(
$aData
[
'meta'
][
'website'
])
?
'<span class="string">'
.
$aData
[
'meta'
][
'website'
]
.
'</span>'
:
'?'
)
.
'<br>'
// . 'Status: ' . (isset($aData['meta']['result']) ? '<span class="result'.$aData['meta']['result'].'">'. $aMsg[$aData['meta']['result']].'</span>' : '?').'<br>'
.
'Execution time: '
.
(
isset
(
$aData
[
'meta'
][
'time'
])
?
'<span class="float">'
.
$aData
[
'meta'
][
'time'
]
.
'</span>'
:
'?'
)
.
'<br>'
.
'Client: '
.
(
isset
(
$aData
[
'meta'
][
'version'
])
?
'<span class="float">'
.
$aData
[
'meta'
][
'version'
]
.
'</span>'
:
'?'
)
.
'<br>'
.
'<h2>Checks</h2>'
;
if
(
isset
(
$aData
[
'checks'
][
0
])
&&
count
(
$aData
[
'checks'
])){
foreach
(
$aData
[
'checks'
]
as
$aCheck
){
$sOut
.
=
'<span class="result'
.
$aCheck
[
'result'
]
.
'"> <strong>'
.
$aCheck
[
'name'
]
.
'</strong></span> <br>'
.
$aCheck
[
'description'
]
.
'<br>'
// . '<span class="result'.$aCheck['result'].'">'.$aCheck['value'].'</span><br>'
.
$aCheck
[
'value'
]
.
'<br>'
.
'Execution time: '
.
$aCheck
[
'time'
]
.
'<br>'
.
'Status: '
.
$aMsg
[
$aCheck
[
'result'
]]
.
'<br>'
.
'<br>'
$sOut
.
=
''
.
'<span class="result'
.
$aCheck
[
'result'
]
.
'"> <strong>'
.
$aCheck
[
'name'
]
.
'</strong></span> <br>'
.
'<div class="check">'
.
'<div class="description">'
.
$aCheck
[
'description'
]
.
'<br>'
.
$aCheck
[
'value'
]
.
'<br>'
.
'</div>'
.
'Execution time: '
.
(
isset
(
$aCheck
[
'time'
])
?
$aCheck
[
'time'
]
:
' - '
)
.
'<br>'
.
'Group: '
.
(
isset
(
$aCheck
[
'group'
])
?
$aCheck
[
'group'
]
:
'-'
)
.
'<br>'
.
'parent: '
.
(
isset
(
$aCheck
[
'parent'
])
?
$aCheck
[
'parent'
]
:
'-'
)
.
'<br>'
.
'Status: '
.
$aMsg
[
$aCheck
[
'result'
]]
.
'<br>'
.
'</div>'
;
}
}
$sOut
.
=
'<h
r
>List of farbcodes
:
'
;
$sOut
.
=
'<h
2
>List of farbcodes
</h2>
'
;
foreach
(
$aMsg
as
$i
=>
$sText
){
$sOut
.
=
'<span class="result'
.
$i
.
'">'
.
$sText
.
'</span> '
;
}
$sOut
.
=
'<h2>Raw result data</h2><pre>'
.
json_encode
(
$aData
,
JSON_PRETTY_PRINT
)
.
'</pre>'
;
$sOut
=
'<!DOCTYPE html><html><head>'
.
'<style>'
.
'body{background:#fff; color:#444; font-family: verdana,arial; margin: 3em;}'
.
'.result0{background:#aca; border-left: 1em solid #080; padding: 0 0.5em; }'
.
'.result1{background:#ccc; border-left: 1em solid #aaa; padding: 0 0.5em; }'
.
'.result2{background:#fc9; border-left: 1em solid #860; padding: 0 0.5em; }'
.
'.result3{background:#f88; border-left: 1em solid #f00; padding: 0 0.5em; }'
.
'h1{color:#346;}'
.
'h2{color:#569; margin-top: 1.5em;}'
.
'.check{border: 1px solid; padding: 0.4em; margin-bottom: 2em;}'
.
'.description{font-style: italic; padding: 0.4em 1em;}'
.
'.result0{background:#aca; border-left: 1em solid #080; padding: 0.5em; }'
.
'.result1{background:#ccc; border-left: 1em solid #aaa; padding: 0.5em; }'
.
'.result2{background:#fc9; border-left: 1em solid #860; padding: 0.5em; }'
.
'.result3{background:#f88; border-left: 1em solid #f00; padding: 0.5em; }'
.
'</style>'
.
'<title>'
.
__CLASS__
.
'</title>'
.
'</head><body>'
Loading