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

update docs

parent 18100f7c
No related branches found
No related tags found
No related merge requests found
......@@ -47,23 +47,6 @@ The infomation for the checks is structured in sections.
First an example:
```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]
host = "www.example.com"
website = "Company website"
......@@ -76,24 +59,14 @@ email[]="webmaster@example.com"
slack["#support-channel"]="https://hooks.slack.com/services/XXXXXX/YYYYYY/ZZZZZ"
; -----------------------------------------------------------------------
; CHECKS
; -----------------------------------------------------------------------
["hello plugin"]
description="I sust wann say hello"
description="I sust wanna say 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}"
; -----------------------------------------------------------------------
```
#### Types of values
......
......@@ -15,18 +15,35 @@ This code snippet is for demonstration purposes only. A PHP web app should use t
```php
<?php
$AMCLI=__DIR__.'/../built_packages/amcli';
$INI=__DIR__.'/../src/simple.ini';
$AMCLI = __DIR__ . '/../built_packages/amcli';
$INI = __DIR__ . '/../src/simple.ini';
$sCommand="$AMCLI --ini='$INI'";
$aOut=[];
$sCommand = "$AMCLI --ini='$INI'";
$aOut = [];
exec($sCommand, $aOut, $iRc);
if($iRc==0){
if ($iRc == 0) {
header('Content-type: application/json');
}else{
echo "Error: occured...\n";
} else {
header("HTTP/1.1 503 Service unavailable");
echo "<h1>503 Service unavailable</h1>\n";
}
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