Skip to content
Snippets Groups Projects
Commit 180173d0 authored by Axel Hahn's avatar Axel Hahn
Browse files

add cli help videos

parent 4c7b5746
No related branches found
No related tags found
1 merge request!1add cli help videos
## Installation
<!-- START-ADD-TTY-PLAYER -->
<html>
<script src=ttyrec/webcomponents-lite.min.js></script>
<link rel=stylesheet href=ttyrec/tty-player.css>
<script src=ttyrec/term.min.js></script>
<script src=ttyrec/tty-player.min.js></script>
</html>
<!-- END-ADD-TTY-PLAYER -->
### Linux
Download the binary as root or with sudo
......@@ -20,5 +29,11 @@ Test amcli:
```txt
/usr/local/bin/amcli -V
0.4
0.10
```
#### Video
The installation steps above shown in a video:
<tty-player controls rows=20 cols=90 src=files/install_binary.ttyrec poster=npt:33.00></tty-player>
<!-- START-ADD-TTY-PLAYER -->
<html>
<script src=ttyrec/webcomponents-lite.min.js></script>
<link rel=stylesheet href=ttyrec/tty-player.css>
<script src=ttyrec/term.min.js></script>
<script src=ttyrec/tty-player.min.js></script>
</html>
<!-- END-ADD-TTY-PLAYER -->
## Show help
```text
......@@ -60,6 +69,8 @@ You find example snippets in the source code of this project in tests/config/.
```
<tty-player controls rows=20 cols=90 src=files/usage_show_infos.ttyrec poster=npt:18.00></tty-player>
## Execute checks
Checks can be defined by writing an INI file that contains meta information and sections for each check.
......@@ -72,6 +83,8 @@ Recommendations:
* The output is JSON in a single line. You can use `jq` to beautify it, eg `[<PATH>]amcli --ini=<FILENAME> | jq`
* If the bahaviuor seems to be unwanted use `-v` to enable verbose mode. You get more debug output during the execution, showing parsed ini file and more. `[<PATH>]amcli --ini=<FILENAME> -v`
<tty-player controls rows=20 cols=90 src=files/usage_execute.ttyrec poster=npt:18.00></tty-player>
## Exitcodes
The binary could stop and exit with non zero exitcode.
......
<!-- START-ADD-TTY-PLAYER -->
<html>
<script src=ttyrec/webcomponents-lite.min.js></script>
<link rel=stylesheet href=ttyrec/tty-player.css>
<script src=ttyrec/term.min.js></script>
<script src=ttyrec/tty-player.min.js></script>
</html>
<!-- END-ADD-TTY-PLAYER -->
## Requirements
### Linux
......@@ -98,6 +107,19 @@ The newly created files and dirs are:
:
```
### Video of the installer
The installer automates several things.
Espacially the download and compiler steps take a while. This video shows the process on my machine.
<tty-player controls rows=20 cols=90 src=files/installer.ttyrec poster=npt:26.00></tty-player>
But a 2nd run is faster. It needs to git pull the appmonitor sources.
<tty-player controls rows=20 cols=90 src=files/installer2.ttyrec poster=npt:7.60></tty-player>
## Build
To build the amcli binary start `./build.php`. This script has command line parameter support.
......
File added
File added
File added
File added
File added
/home/axel/sources/docker/docpages/public_html/docs/addons/ttyrec
\ No newline at end of file
# ----------------------------------------------------------------------
#
# CLI demo file
# used in docs/20_Installation.md
#
# ----------------------------------------------------------------------
# set fake prompt:
cdm.setpath "~"
rem ""
rem "Welcome to this ascii demo!"
rem "Let's install the appmonitor client binary using curl"
rem ""
sudo curl -o /usr/local/bin/amcli https://static.iml.unibe.ch/downloads/appmonitor_client/amcli_linux_x86_64
rem ""
rem "Make it executable for everyone"
rem ""
sudo chmod 0755 /usr/local/bin/amcli
rem ""
rem "We can test to execute it now"
rem ""
/usr/local/bin/amcli -V
rem ""
rem "Great, it seems to work!"
rem ""
# ----------------------------------------------------------------------
# ----------------------------------------------------------------------
#
# CLI demo file
# used in docs/80_Build.md
#
# ----------------------------------------------------------------------
rem ""
rem "Welcome to this ascii demo!"
rem "Let's install the development environment."
rem ""
cdm.shell "sleep 2"
cdm.shell "mkdir -p ~/tmp/clidemos"
cdm.shell "cd ~/tmp/clidemos"
cdm.shell "rm -rf ~/tmp/clidemos/appmonitor-cli-client"
# set fake prompt:
cdm.setpath "~/projects/"
rem ""
rem "Let's get the sources."
rem ""
git clone https://git-repo.iml.unibe.ch/iml-open-source/appmonitor-cli-client.git
cd appmonitor-cli-client
cdm.setpath "~/projects/appmonitor-cli-client"
ls
rem ""
rem "The 'installer.php' has a help page."
rem ""
./installer.php -h
rem ""
rem "The 'installer.php' script prepares the environment to start"
rem "development and build of appmonitor cli:"
rem ""
rem "- get appmonitor source code"
rem "- download 'spc' (static-php-cli)"
rem "- The 'spc doctor' command installs needed sources."
rem "- Spc builds a Php micro sfx with needed php modules."
rem "- Create a merged include file of appmonitor client"
rem ""
./installer.php
rem ""
rem "Great, it seemed to work!"
rem ""
# ----------------------------------------------------------------------
# ----------------------------------------------------------------------
#
# CLI demo file
# used in docs/80_Build.md
#
# ----------------------------------------------------------------------
# set fake prompt:
cdm.setpath "~/projects/appmonitor-cli-client"
cdm.shell "cd ~/tmp/clidemos/appmonitor-cli-client"
rem ""
rem "Welcome to this ascii demo!"
rem "A 2nd run of the 'installer.php' is much faster"
rem ""
time ./installer.php
rem ""
rem "Yep, much faster :-)"
rem ""
# ----------------------------------------------------------------------
#!/usr/bin/bash
# ----------------------------------------------------------------------
# detect ttyplayer in markdown files
# ----------------------------------------------------------------------
# ----------------------------------------------------------------------
# CONFIG
# ----------------------------------------------------------------------
cd "$(dirname "$0")/../docs" || exit 1
ttysource=/home/axel/sources/docker/docpages/public_html/docs/addons/ttyrec
ttyblock="<!-- START-ADD-TTY-PLAYER -->
<html>
<script src=ttyrec/webcomponents-lite.min.js></script>
<link rel=stylesheet href=ttyrec/tty-player.css>
<script src=ttyrec/term.min.js></script>
<script src=ttyrec/tty-player.min.js></script>
</html>
<!-- END-ADD-TTY-PLAYER -->"
# ----------------------------------------------------------------------
# MAIN
# ----------------------------------------------------------------------
echo
echo "Detect ttyplayer in markdown files..."
echo
for myfile in $( grep -rl "<tty-player" *md )
do
echo "--- $myfile"
if grep -q "$ttyblock" "$myfile"; then
echo "SKIP: html header found."
else
echo "Adding html header..."
( echo "$ttyblock" ; echo; cat "$myfile" ) >> "$myfile.tmp"
mv "$myfile.tmp" "$myfile"
fi
# if the 1st player was found: add ttyrec as softlink below docs folder
ls -ld ttyrec 2>/dev/null | grep -q "^l" || ln -s "$ttysource"
done
echo "Done"
# ----------------------------------------------------------------------
File added
# ----------------------------------------------------------------------
#
# CLI demo file
# used in docs/30_Usage.md
#
# ----------------------------------------------------------------------
# set fake prompt:
cdm.setpath "~"
rem ""
rem "Welcome to this ascii demo!"
rem "Let's execute a check that is declared in an ini file"
rem ""
/usr/local/bin/amcli --ini=tests/configs/metadata.ini
rem ""
rem "If you have tool like jq you can create a more readable output"
rem ""
/usr/local/bin/amcli --ini=tests/configs/metadata.ini | jq
rem ""
rem "Have fun!"
rem ""
# ----------------------------------------------------------------------
# ----------------------------------------------------------------------
#
# CLI demo file
# used in docs/30_Usage.md
#
# ----------------------------------------------------------------------
# set fake prompt:
cdm.setpath "~"
rem ""
rem "Welcome to this ascii demo!"
rem "Let's play around with some parameters"
rem ""
cdm.shell "sleep 2"
rem ""
rem "Show version"
rem ""
/usr/local/bin/amcli -V
rem ""
rem "That is just the version of the cli wrapper."
rem "We can let show the versions of related tools too:"
rem "- version of compiled appmonitor"
rem "- used PHP version"
rem "- included PHP modules"
rem ""
/usr/local/bin/amcli -b
rem ""
rem "We can list which PHP client checks are included."
rem ""
/usr/local/bin/amcli -l
rem ""
rem "There is an explain mode."
rem "It shows an example ini section for a single check"
rem "Let's try the 'ping' check:"
rem ""
/usr/local/bin/amcli -e=ping
rem ""
rem "The help shows all options"
rem ""
/usr/local/bin/amcli -h
rem ""
rem "Have fun!"
rem ""
# ----------------------------------------------------------------------
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment