Bash scripts and tools
To use this toolkit in your own bash
scripts just start your script with the following lines :
# Load framework
readonly BIN="$(dirname "$0")"
source ${BIN}/../main.sh
Replace the path to the main.sh
according to your installation.
Then you can load the modules you want with the module
command :
module colors
module logs
module docker
In Monit's configuration file for docker
You can use this Toolkit to monitor docker's container with Monit.
Here is a sample config you can use for monitoring a container named portainer
:
check program docker_portainer with path <path_to_toolkit>/scripts/docker_monit.sh -s portainer
if status != 0 then alert
start program "<path_to_toolkit>/scripts/docker_monit.sh -s portainer start"
stop program "<path_to_toolkit>/scripts/docker_monit.sh -s portainer stop"
Don't forget to replace <path_to_toolkit> with the install directory of this toolkit.
This module is used by other modules, it define some ANSI constants to use colors in your script.
This module provide a list of usefull methods to display fancy log during the execution of your scripts.
This module provide a list of function to manipulates docker container, with secure dependencies, and with fancy log messages.