Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -73,6 +73,7 @@ RUN source /assets/functions/00-container && \
xz \
zip \
zstd \
netcat-openbsd \
&& \
\
case "$(uname -m)" in \
Expand Down
7 changes: 6 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,7 @@ Backs up CouchDB, InfluxDB, MySQL/MariaDB, Microsoft SQL, MongoDB, Postgres, Red
- encryption support (passphrase and public key)
- notify upon job failure to email, matrix, mattermost, rocketchat, custom script
- zabbix metrics support
- prometheus metrics support
- hooks to execute pre and post backup job for customization purposes
- companion script to aid in restores

Expand Down Expand Up @@ -167,7 +168,7 @@ The following directories are used for configuration and can be mapped for persi

#### Base Images used

This image relies on an [Alpine Linux](https://hub.docker.com/r/tiredofit/alpine) base image that relies on an [init system](https://github.com/just-containers/s6-overlay) for added capabilities. Outgoing SMTP capabilities are handled via `msmtp`. Individual container performance monitoring is performed by [zabbix-agent](https://zabbix.org). Additional tools include: `bash`,`curl`,`less`,`logrotate`, `nano`.
This image relies on an [Alpine Linux](https://hub.docker.com/r/tiredofit/alpine) base image that relies on an [init system](https://github.com/just-containers/s6-overlay) for added capabilities. Outgoing SMTP capabilities are handled via `msmtp`. Individual container performance monitoring is performed by [zabbix-agent](https://zabbix.org) or [Prometheus](https://prometheus.io). Additional tools include: `bash`,`curl`,`less`,`logrotate`, `nano`.

Be sure to view the following repositories to understand all the customizable options:

Expand All @@ -187,6 +188,10 @@ Be sure to view the following repositories to understand all the customizable op
| `MANUAL_RUN_FOREVER` | `TRUE` or `FALSE` if you wish to try to make the container exit after the backup | `TRUE` |
| `DEBUG_MODE` | If set to `true`, print copious shell script messages to the container log. Otherwise only basic messages are printed. | `FALSE` |
| `BACKUP_JOB_CONCURRENCY` | How many backup jobs to run concurrently | `1` |
| `CONTAINER_ENABLE_MONITORING` | Enable monitoring with Zabbix or Prometheus | `TRUE` |
| `CONTAINER_MONITORING_BACKEND` | Choose monitoring backend: `zabbix` or `prometheus` | `zabbix` |
| `PROMETHEUS_PORT` | Port for Prometheus metrics endpoint | `9090` |
| `DEBUG_PROMETHEUS` | Enable debug logging for Prometheus metrics | `FALSE` |

#### Job Defaults
If these are set and no other defaults or variables are set explicitly, they will be added to any of the backup jobs.
Expand Down
7 changes: 7 additions & 0 deletions install/assets/defaults/08-prometheus
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
#!/command/with-contenv bash

# Prometheus monitoring configuration
PROMETHEUS_PORT=${PROMETHEUS_PORT:-"9090"}
PROMETHEUS_METRICS_FILE=${PROMETHEUS_METRICS_FILE:-"/tmp/prometheus_metrics"}
PROMETHEUS_METRICS_LOCK=${PROMETHEUS_METRICS_LOCK:-"/tmp/prometheus_metrics.lock"}
DEBUG_PROMETHEUS=${DEBUG_PROMETHEUS:-"FALSE"}
48 changes: 48 additions & 0 deletions install/assets/functions/03-monitoring
Original file line number Diff line number Diff line change
@@ -0,0 +1,48 @@
#!/command/with-contenv bash

ZABBIX_AGENT_LOG_FILE=${ZABBIX_AGENT_LOG_FILE:-"zabbix_agentd.log"}
ZABBIX_AGENT_LOG_PATH=${ZABBIX_AGENT_LOG_PATH:-"/var/log/zabbix/agent/"}
ZABBIX_ALLOW_ROOT=${ZABBIX_ALLOW_ROOT:-"1"}
ZABBIX_BUFFER_SEND=${ZABBIX_BUFFER_SEND:-"5"}
ZABBIX_BUFFER_SIZE=${ZABBIX_BUFFER_SIZE:-"100"}
ZABBIX_CERT_PATH=${ZABBIX_CERT_PATH:-"/etc/zabbix/certs/"}
ZABBIX_CONFIG_FILE=${ZABBIX_CONFIG_FILE:-"zabbix_agentd.conf"}
ZABBIX_CONFIG_PATH=${ZABBIX_CONFIG_PATH:-"/etc/zabbix/"}
ZABBIX_DEBUGLEVEL=${ZABBIX_DEBUGLEVEL:-"1"}
ZABBIX_ENABLE_AUTOREGISTER=${ZABBIX_ENABLE_AUTOREGISTER:-"TRUE"}
ZABBIX_ENABLE_AUTOREGISTER_DNS=${ZABBIX_ENABLE_AUTOREGISTER_DNS:-"TRUE"}
ZABBIX_HOSTNAME=${ZABBIX_HOSTNAME:-"${CONTAINER_NAME}"}
ZABBIX_LISTEN_IP=${ZABBIX_LISTEN_IP:-"0.0.0.0"}
ZABBIX_LISTEN_PORT=${ZABBIX_LISTEN_PORT:-"10050"}
ZABBIX_LOG_FILE_SIZE=${ZABBIX_LOG_FILE_SIZE:-"0"}
ZABBIX_MAXLINES_SECOND=${ZABBIX_MAXLINES_SECOND:-"20"}
ZABBIX_PID=${ZABBIX_PID:-"/var/lib/zabbix/run/zabbix-agent.pid"}
ZABBIX_REFRESH_ACTIVE_CHECKS=${ZABBIX_REFRESH_ACTIVE_CHECKS:-"120"}
ZABBIX_REMOTECOMMANDS_ALLOW=${ZABBIX_REMOTECOMMANDS_ALLOW:-"*"}
ZABBIX_REMOTECOMMANDS_LOG=${ZABBIX_REMOTECOMMANDS_LOG:-"1"}
ZABBIX_SERVER=${ZABBIX_SERVER:-"0.0.0.0/0"}
ZABBIX_SERVER_ACTIVE=${ZABBIX_SERVER_ACTIVE:-"zabbix-proxy"}
ZABBIX_SETUP_TYPE=${ZABBIX_SETUP_TYPE:-"AUTO"}
ZABBIX_SOCKET=${ZABBIX_SOCKET:-"/var/lib/zabbix/run/zabbix-agent.sock"}
ZABBIX_START_AGENTS=${ZABBIX_START_AGENTS:-"1"}
ZABBIX_STATUS_PORT=${ZABBIX_STATUS_PORT:-"8050"}
ZABBIX_USER=${ZABBIX_USER:-"zabbix"}
ZABBIX_USER_DOAS=${ZABBIX_USER_DOAS:-"TRUE"}
ZABBIX_USER_SUDO=${ZABBIX_USER_SUDO:-"TRUE"}
ZABBIX_AGENT_TIMEOUT=${ZABBIX_AGENT_TIMEOUT:-"3"}


os=$(cat /etc/os-release |grep ^ID= | cut -d = -f2)
case ${os} in
"alpine" )
osver=$(cat /etc/os-release | grep VERSION_ID | cut -d = -f 2 | cut -d . -f 2 | cut -d _ -f 1)
if [ "${osver}" -ge 15 ] || [ "$osver" = "edge" ] ; then
ZABBIX_AGENT_TYPE=${ZABBIX_AGENT_TYPE:-"modern"}
else
ZABBIX_AGENT_TYPE=${ZABBIX_AGENT_TYPE:-"classic"}
fi
;;
"debian" | "ubuntu" )
ZABBIX_AGENT_TYPE=${ZABBIX_AGENT_TYPE:-"modern"}
;;
esac
Loading