-
Simple service status page created using BASH and asciidoctor
-
It is really dumb, because testing operations are done sequentially, not in parallel processes.. But from my point of view "it's good enough" for like max 30 clients.
-
New services are configurable pretty simple:
- Duplicate some check in update-data.sh (They start after "### CHECKS ###")
- Modify it to fit your needs and don't forget that results must be saved in SHELL variables.
- In gen.bash, copy line commented "Make an error if any check fail" and modify variable to your. For example TFTP_CHECK variable
- Unset this variable (TFTP_CHECK) below
- Get's configuration from config/host_groups/
- Test host(s) PING, HTTP, HTTPS ... and create page with report.
- Create main index.html that shows those pretty not pretty clickable bars with links to reports generated.
- Directory config/host_groups contains directories that represent some kind of a service group. Like the private_servers or services that are already in place.
- In config/host_groups/"dir"/NAME is specified name of the host group that will be seen on the main page (it can contain spaces and similar stuff).
- Under config/host_groups/"dir"/hosts/, there are "ASCII text" containing configuration of host that should be tested.
- Configuration file should be SHELL compatible, its syntax is simple:
# Set host address or hostname (if IPv6 is used, don't forget these: [] !) HOST=contoso.net # CONFIGURATION PING=y HTTP=y HTTP_PORT=80 HTTPS=y HTTPS_PORT=443
- Under config/host_groups/"dir"/hosts/, there are "ASCII text" containing configuration of host that should be tested.
- In config/host_groups/"dir"/NAME is specified name of the host group that will be seen on the main page (it can contain spaces and similar stuff).
Variables *PORT don't need to be specified, if default port is used (HTTP=>80,HTTPS-=>443, etc..)
- First of all you need some packages:
apt install -yq grep tr sed asciidoctor curl iputils-ping bash
- Then just run gen.bash in project directory:
./gen.bash
- Push your files to your web server. For example:
scp -r public/* [email protected]:/srv/http/
By default, everything will be created in directory: public