From adf5a6160c6b3ddc7bbe2b7823186cd700ad37e9 Mon Sep 17 00:00:00 2001 From: "Hahn Axel (hahn)" <axel.hahn@unibe.ch> Date: Tue, 4 Mar 2025 16:47:36 +0100 Subject: [PATCH] add docs: usage --- Usage.md | 70 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 70 insertions(+) create mode 100644 Usage.md diff --git a/Usage.md b/Usage.md new file mode 100644 index 0000000..5ba7004 --- /dev/null +++ b/Usage.md @@ -0,0 +1,70 @@ +# Usage of amcli + +## Show help + +```text +./src/amcli -h +IML Appmonitor as CLI client 0.1 + +This client performs appmonitor checks and puts the results as JSON to stdout. +You can use the compiled binary on non PHP systems. +(c) 2025 Institute for Medical education * University of Bern + +SYNTAX: amcli [OPTIONS] --ini=<INI-FILE> + +OPTIONS: + -h, --help Print this help and exit + -i, --ini Set an INI File to parse + -l, --list list available checks and exit + -m, --modules list available Php modules in this binary and exit + -v, --verbose Enable verbose output + -V, --version Show version and exit + +EXAMPLES: + + amcli -i=my.ini + amcli --ini=my.ini + Execute checks from INI file 'my.ini'. + + amcli --list + List available checks. + +``` + +## Execute checks + +`amcli --ini=<FILENAME>` + +## Exitcodes + +### amcli + +| Exitcode | Description +| --- | --- +| 0 | OK. An option was executed (help, list modules or checks) or the check was executed successfully +| 1 | include include_checks.php failed (php file only) +| 2 | include_checks.php failed (php file only) +| 3 | INI file was not given. Or missing `=` char in `--ini=<FILE>` +| 4 | Given Ini file does not exist +| 5 | Given Ini file cannot be parsed +| 6 | Ini value `params=` is no JSON + +### appmonitor-client.class.php + +| Exitcode | Description +| --- | --- +| 10 | incomplete reponse data detected eg. no check, no result code +| 11 | Access denied: Ip restriction was set +| 12 | Access denied: No token or wrong token was given + +### appmonitor-checks.class.php + +| Exitcode | Description +| --- | --- +| 20 | Missing key in a given hash +| 21 | Mising value in a given hash +| 22 | Check not found. Check your `function`value +| 23 | Check didn't response a hash (=error in check) +| 24 | Check responded a too small hash (=error in check) +| 25 | The unit in a space value is unknown + -- GitLab