Skip to content
Snippets Groups Projects
Commit 1d20cae1 authored by Hahn Axel (hahn)'s avatar Hahn Axel (hahn)
Browse files

update docs

parent 18100f7c
Branches
No related tags found
No related merge requests found
...@@ -47,23 +47,6 @@ The infomation for the checks is structured in sections. ...@@ -47,23 +47,6 @@ The infomation for the checks is structured in sections.
First an example: First an example:
```ini ```ini
; =======================================================================
;
; APPMONITOR CLI CLIENT
;
; to understand the entries of metadata see JSON in
; <https://os-docs.iml.unibe.ch/appmonitor/Client/Description_of_response.html>
;
; for the checks see its parameters
; <https://os-docs.iml.unibe.ch/appmonitor/PHP_client/Plugins/Checks/index.html>
;
; =======================================================================
; -----------------------------------------------------------------------
; METADATA
; -----------------------------------------------------------------------
[meta] [meta]
host = "www.example.com" host = "www.example.com"
website = "Company website" website = "Company website"
...@@ -76,24 +59,14 @@ email[]="webmaster@example.com" ...@@ -76,24 +59,14 @@ email[]="webmaster@example.com"
slack["#support-channel"]="https://hooks.slack.com/services/XXXXXX/YYYYYY/ZZZZZ" slack["#support-channel"]="https://hooks.slack.com/services/XXXXXX/YYYYYY/ZZZZZ"
; ----------------------------------------------------------------------- ; -----------------------------------------------------------------------
; CHECKS ; CHECKS
; ----------------------------------------------------------------------- ; -----------------------------------------------------------------------
["hello plugin"] ["hello plugin"]
description="I sust wann say hello" description="I sust wanna say hello"
function="hello" function="hello"
; JSON example ... variables cannot be expanded
; params='{
; "message": "Here I am"
; }'
;
; ... but in double quotes the expansion works
params[message]="Here is ${USER}" params[message]="Here is ${USER}"
; -----------------------------------------------------------------------
``` ```
#### Types of values #### Types of values
......
...@@ -26,7 +26,24 @@ exec($sCommand, $aOut, $iRc); ...@@ -26,7 +26,24 @@ exec($sCommand, $aOut, $iRc);
if ($iRc == 0) { if ($iRc == 0) {
header('Content-type: application/json'); header('Content-type: application/json');
} else { } else {
echo "Error: occured...\n"; header("HTTP/1.1 503 Service unavailable");
echo "<h1>503 Service unavailable</h1>\n";
} }
echo implode("\n", $aOut); echo implode("\n", $aOut);
``` ```
To test it:
(1)
Start PHP webserver
```txt
$ cd examples
$ php -S localhost:9000
[Fri Mar 7 09:01:52 2025] PHP 8.4.4 Development Server (http://localhost:9000) started
```
(2)
In a webbrowser open <http://localhost:9000/embed_example.php>
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment