mirror of
https://github.com/tiredofit/docker-db-backup.git
synced 2025-12-22 05:33:53 +01:00
Compare commits
18 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
b62554ceff | ||
|
|
7729743ccf | ||
|
|
d56efc0ee9 | ||
|
|
7d87e474e0 | ||
|
|
342c252d9a | ||
|
|
25f3cab21f | ||
|
|
e63d56c753 | ||
|
|
86722a8e8a | ||
|
|
4d6419fd18 | ||
|
|
99153ac6d1 | ||
|
|
142967135d | ||
|
|
1df66853fb | ||
|
|
c019efeb74 | ||
|
|
f276af2512 | ||
|
|
4e41e66eff | ||
|
|
4488d113ef | ||
|
|
1cd014b165 | ||
|
|
39bd8537ff |
110
.github/workflows/manual.yml
vendored
Normal file
110
.github/workflows/manual.yml
vendored
Normal file
@@ -0,0 +1,110 @@
|
|||||||
|
# Manual Workflow (Application)
|
||||||
|
|
||||||
|
name: manual
|
||||||
|
|
||||||
|
on:
|
||||||
|
workflow_dispatch:
|
||||||
|
inputs:
|
||||||
|
Manual Build:
|
||||||
|
description: 'Manual Build'
|
||||||
|
required: false
|
||||||
|
jobs:
|
||||||
|
docker:
|
||||||
|
runs-on: ubuntu-latest
|
||||||
|
steps:
|
||||||
|
- name: Checkout
|
||||||
|
uses: actions/checkout@v2
|
||||||
|
|
||||||
|
- name: Prepare
|
||||||
|
id: prep
|
||||||
|
run: |
|
||||||
|
DOCKER_IMAGE=${GITHUB_REPOSITORY/docker-/}
|
||||||
|
set -x
|
||||||
|
if [[ $GITHUB_REF == refs/heads/* ]]; then
|
||||||
|
if [[ $GITHUB_REF == refs/heads/*/* ]] ; then
|
||||||
|
BRANCH="${DOCKER_IMAGE}:$(echo $GITHUB_REF | sed "s|refs/heads/||g" | sed "s|/|-|g")"
|
||||||
|
else
|
||||||
|
BRANCH=${GITHUB_REF#refs/heads/}
|
||||||
|
fi
|
||||||
|
|
||||||
|
case ${BRANCH} in
|
||||||
|
"main" | "master" )
|
||||||
|
BRANCHTAG="${DOCKER_IMAGE}:latest"
|
||||||
|
;;
|
||||||
|
"develop" )
|
||||||
|
BRANCHTAG="${DOCKER_IMAGE}:develop"
|
||||||
|
;;
|
||||||
|
* )
|
||||||
|
if [ -n "${{ secrets.LATEST }}" ] ; then
|
||||||
|
if [ "${BRANCHTAG}" = "${{ secrets.LATEST }}" ]; then
|
||||||
|
BRANCHTAG="${DOCKER_IMAGE}:${BRANCH},${DOCKER_IMAGE}:${BRANCH}-latest,${DOCKER_IMAGE}:latest"
|
||||||
|
else
|
||||||
|
BRANCHTAG="${DOCKER_IMAGE}:${BRANCH},${DOCKER_IMAGE}:${BRANCH}-latest"
|
||||||
|
fi
|
||||||
|
else
|
||||||
|
BRANCHTAG="${DOCKER_IMAGE}:${BRANCH},${DOCKER_IMAGE}:${BRANCH}-latest"
|
||||||
|
fi
|
||||||
|
;;
|
||||||
|
esac
|
||||||
|
fi
|
||||||
|
|
||||||
|
|
||||||
|
if [[ $GITHUB_REF == refs/tags/* ]]; then
|
||||||
|
GITTAG="${DOCKER_IMAGE}:$(echo $GITHUB_REF | sed 's|refs/tags/||g')"
|
||||||
|
fi
|
||||||
|
|
||||||
|
if [ -n "${BRANCHTAG}" ] && [ -n "${GITTAG}" ]; then
|
||||||
|
TAGS=${BRANCHTAG},${GITTAG}
|
||||||
|
else
|
||||||
|
TAGS="${BRANCHTAG}${GITTAG}"
|
||||||
|
fi
|
||||||
|
|
||||||
|
echo ::set-output name=tags::${TAGS}
|
||||||
|
echo ::set-output name=docker_image::${DOCKER_IMAGE}
|
||||||
|
|
||||||
|
- name: Set up QEMU
|
||||||
|
uses: docker/setup-qemu-action@v1
|
||||||
|
with:
|
||||||
|
platforms: all
|
||||||
|
|
||||||
|
- name: Set up Docker Buildx
|
||||||
|
id: buildx
|
||||||
|
uses: docker/setup-buildx-action@v1
|
||||||
|
|
||||||
|
- name: Login to DockerHub
|
||||||
|
if: github.event_name != 'pull_request'
|
||||||
|
uses: docker/login-action@v1
|
||||||
|
with:
|
||||||
|
username: ${{ secrets.DOCKER_USERNAME }}
|
||||||
|
password: ${{ secrets.DOCKER_PASSWORD }}
|
||||||
|
|
||||||
|
- name: Label
|
||||||
|
id: Label
|
||||||
|
run: |
|
||||||
|
if [ -f "Dockerfile" ] ; then
|
||||||
|
sed -i "/FROM .*/a LABEL tiredofit.image.git_repository=\"https://github.com/${GITHUB_REPOSITORY}\"" Dockerfile
|
||||||
|
sed -i "/FROM .*/a LABEL tiredofit.image.git_commit=\"${GITHUB_SHA}\"" Dockerfile
|
||||||
|
sed -i "/FROM .*/a LABEL tiredofit.image.git_committed_by=\"${GITHUB_ACTOR}\"" Dockerfile
|
||||||
|
sed -i "/FROM .*/a LABEL tiredofit.image_build_date=\"$(date +'%Y-%m-%d %H:%M:%S')\"" Dockerfile
|
||||||
|
if [ -f "CHANGELOG.md" ] ; then
|
||||||
|
sed -i "/FROM .*/a LABEL tiredofit.image.git_changelog_version=\"$(head -n1 ./CHANGELOG.md | awk '{print $2}')\"" Dockerfile
|
||||||
|
fi
|
||||||
|
|
||||||
|
if [[ $GITHUB_REF == refs/tags/* ]]; then
|
||||||
|
sed -i "/FROM .*/a LABEL tiredofit.image.git_tag=\"${GITHUB_REF#refs/tags/v}\"" Dockerfile
|
||||||
|
fi
|
||||||
|
|
||||||
|
if [[ $GITHUB_REF == refs/heads/* ]]; then
|
||||||
|
sed -i "/FROM .*/a LABEL tiredofit.image.git_branch=\"${GITHUB_REF#refs/heads/}\"" Dockerfile
|
||||||
|
fi
|
||||||
|
fi
|
||||||
|
|
||||||
|
- name: Build
|
||||||
|
uses: docker/build-push-action@v2
|
||||||
|
with:
|
||||||
|
builder: ${{ steps.buildx.outputs.name }}
|
||||||
|
context: .
|
||||||
|
file: ./Dockerfile
|
||||||
|
platforms: linux/amd64,linux/arm/v6,linux/arm/v7,linux/arm64
|
||||||
|
push: true
|
||||||
|
tags: ${{ steps.prep.outputs.tags }}
|
||||||
42
CHANGELOG.md
42
CHANGELOG.md
@@ -1,3 +1,45 @@
|
|||||||
|
## 2.10.0 2021-12-22 <dave at tiredofit dot ca>
|
||||||
|
|
||||||
|
### Changed
|
||||||
|
- Revert back to Postgresql 14 from packages as its now in the repositories
|
||||||
|
- Fix for Zabbix Monitoring
|
||||||
|
|
||||||
|
|
||||||
|
## 2.9.7 2021-12-15 <dave at tiredofit dot ca>
|
||||||
|
|
||||||
|
### Changed
|
||||||
|
- Fixup for Zabbix Autoagent registration
|
||||||
|
|
||||||
|
|
||||||
|
## 2.9.6 2021-12-03 <alexbarcello@githuba>
|
||||||
|
|
||||||
|
### Changed
|
||||||
|
- Fix for S3 Minio backup targets
|
||||||
|
- Fix for annoying output on certain target time print conditions
|
||||||
|
|
||||||
|
## 2.9.5 2021-12-07 <dave at tiredofit dot ca>
|
||||||
|
|
||||||
|
### Changed
|
||||||
|
- Fix for 2.9.3
|
||||||
|
|
||||||
|
|
||||||
|
## 2.9.4 2021-12-07 <dave at tiredofit dot ca>
|
||||||
|
|
||||||
|
### Added
|
||||||
|
- Add Zabbix auto register support for templates
|
||||||
|
|
||||||
|
|
||||||
|
## 2.9.3 2021-11-24 <dave at tiredofit dot ca>
|
||||||
|
|
||||||
|
### Added
|
||||||
|
- Alpine 3.15 base
|
||||||
|
|
||||||
|
|
||||||
|
## 2.9.2 2021-10-22 <teenigma@github>
|
||||||
|
|
||||||
|
### Fixed
|
||||||
|
- Fix compression failing on Redis backup
|
||||||
|
|
||||||
## 2.9.1 2021-10-15 <sbrunecker@github>
|
## 2.9.1 2021-10-15 <sbrunecker@github>
|
||||||
|
|
||||||
### Fixed
|
### Fixed
|
||||||
|
|||||||
106
Dockerfile
106
Dockerfile
@@ -1,110 +1,12 @@
|
|||||||
FROM docker.io/tiredofit/alpine:3.14
|
FROM docker.io/tiredofit/alpine:3.15
|
||||||
|
|
||||||
### Set Environment Variables
|
### Set Environment Variables
|
||||||
ENV MSSQL_VERSION=17.8.1.1-1 \
|
ENV MSSQL_VERSION=17.8.1.1-1 \
|
||||||
CONTAINER_ENABLE_MESSAGING=FALSE \
|
CONTAINER_ENABLE_MESSAGING=FALSE \
|
||||||
CONTAINER_ENABLE_MONITORING=TRUE
|
CONTAINER_ENABLE_MONITORING=TRUE
|
||||||
|
|
||||||
|
|
||||||
ENV LANG=en_US.utf8 \
|
|
||||||
PG_MAJOR=14 \
|
|
||||||
PG_VERSION=14.0 \
|
|
||||||
PGDATA=/var/lib/postgresql/data
|
|
||||||
|
|
||||||
|
|
||||||
### Create User Accounts
|
|
||||||
RUN set -ex && \
|
|
||||||
addgroup -g 70 postgres && \
|
|
||||||
adduser -S -D -H -h /var/lib/postgresql -s /bin/sh -G postgres -u 70 postgres && \
|
|
||||||
mkdir -p /var/lib/postgresql && \
|
|
||||||
chown -R postgres:postgres /var/lib/postgresql && \
|
|
||||||
\
|
|
||||||
### Install Dependencies
|
|
||||||
apk update && \
|
|
||||||
apk upgrade && \
|
|
||||||
apk add \
|
|
||||||
openssl \
|
|
||||||
&& \
|
|
||||||
\
|
|
||||||
apk add --no-cache --virtual .postgres-build-deps \
|
|
||||||
bison \
|
|
||||||
build-base \
|
|
||||||
coreutils \
|
|
||||||
dpkg-dev \
|
|
||||||
dpkg \
|
|
||||||
flex \
|
|
||||||
gcc \
|
|
||||||
icu-dev \
|
|
||||||
libc-dev \
|
|
||||||
libedit-dev \
|
|
||||||
libxml2-dev \
|
|
||||||
libxslt-dev \
|
|
||||||
linux-headers \
|
|
||||||
make \
|
|
||||||
openssl-dev \
|
|
||||||
perl-utils \
|
|
||||||
perl-ipc-run \
|
|
||||||
util-linux-dev \
|
|
||||||
zlib-dev \
|
|
||||||
&& \
|
|
||||||
\
|
|
||||||
### Build Postgresql
|
|
||||||
mkdir -p /usr/src/postgresql && \
|
|
||||||
curl -sSL "https://ftp.postgresql.org/pub/source/v$PG_VERSION/postgresql-$PG_VERSION.tar.bz2" | tar xvfj - --strip 1 -C /usr/src/postgresql && \
|
|
||||||
cd /usr/src/postgresql && \
|
|
||||||
# update "DEFAULT_PGSOCKET_DIR" to "/var/run/postgresql" (matching Debian)
|
|
||||||
# see https://anonscm.debian.org/git/pkg-postgresql/postgresql.git/tree/debian/patches/51-default-sockets-in-var.patch?id=8b539fcb3e093a521c095e70bdfa76887217b89f
|
|
||||||
awk '$1 == "#define" && $2 == "DEFAULT_PGSOCKET_DIR" && $3 == "\"/tmp\"" { $3 = "\"/var/run/postgresql\""; print; next } { print }' src/include/pg_config_manual.h > src/include/pg_config_manual.h.new && \
|
|
||||||
grep '/var/run/postgresql' src/include/pg_config_manual.h.new && \
|
|
||||||
mv src/include/pg_config_manual.h.new src/include/pg_config_manual.h && \
|
|
||||||
gnuArch="$(dpkg-architecture --query DEB_BUILD_GNU_TYPE)" && \
|
|
||||||
# explicitly update autoconf config.guess and config.sub so they support more arches/libcs
|
|
||||||
wget -O config/config.guess 'https://git.savannah.gnu.org/cgit/config.git/plain/config.guess?id=7d3d27baf8107b630586c962c057e22149653deb' && \
|
|
||||||
wget -O config/config.sub 'https://git.savannah.gnu.org/cgit/config.git/plain/config.sub?id=7d3d27baf8107b630586c962c057e22149653deb' && \
|
|
||||||
./configure \
|
|
||||||
--build="$gnuArch" \
|
|
||||||
--enable-integer-datetimes \
|
|
||||||
--enable-thread-safety \
|
|
||||||
--enable-tap-tests \
|
|
||||||
--disable-rpath \
|
|
||||||
--with-uuid=e2fs \
|
|
||||||
--with-gnu-ld \
|
|
||||||
--with-pgport=5432 \
|
|
||||||
--with-system-tzdata=/usr/share/zoneinfo \
|
|
||||||
--prefix=/usr/local \
|
|
||||||
--with-includes=/usr/local/include \
|
|
||||||
--with-libraries=/usr/local/lib \
|
|
||||||
--with-openssl \
|
|
||||||
--with-libxml \
|
|
||||||
--with-libxslt \
|
|
||||||
--with-icu \
|
|
||||||
&& \
|
|
||||||
\
|
|
||||||
make -j "$(nproc)" world && \
|
|
||||||
make install-world && \
|
|
||||||
make -C contrib install && \
|
|
||||||
runDeps="$( \
|
|
||||||
scanelf --needed --nobanner --format '%n#p' --recursive /usr/local \
|
|
||||||
| tr ',' '\n' \
|
|
||||||
| sort -u \
|
|
||||||
| awk 'system("[ -e /usr/local/lib/" $1 " ]") == 0 { next } { print "so:" $1 }' \
|
|
||||||
)" && \
|
|
||||||
apk add -t .postgres-additional-deps \
|
|
||||||
$runDeps \
|
|
||||||
&& \
|
|
||||||
\
|
|
||||||
### Cleanup
|
|
||||||
apk del .postgres-build-deps && \
|
|
||||||
cd / && \
|
|
||||||
rm -rf \
|
|
||||||
/usr/src/postgresql \
|
|
||||||
/usr/local/share/doc \
|
|
||||||
/usr/local/share/man && \
|
|
||||||
find /usr/local -name '*.a' -delete && \
|
|
||||||
rm -rf /var/cache/apk/* && \
|
|
||||||
\
|
|
||||||
### Dependencies
|
### Dependencies
|
||||||
set -ex && \
|
RUN set -ex && \
|
||||||
apk update && \
|
apk update && \
|
||||||
apk upgrade && \
|
apk upgrade && \
|
||||||
apk add -t .db-backup-build-deps \
|
apk add -t .db-backup-build-deps \
|
||||||
@@ -125,8 +27,8 @@ RUN set -ex && \
|
|||||||
mongodb-tools \
|
mongodb-tools \
|
||||||
libressl \
|
libressl \
|
||||||
pigz \
|
pigz \
|
||||||
#postgresql \ # To reactivate when it appears in official repos with Alpine 3.15
|
postgresql \
|
||||||
#postgresql-client \ # To reactivate when it appears in official repos with Alpine 3.15
|
postgresql-client \
|
||||||
redis \
|
redis \
|
||||||
sqlite \
|
sqlite \
|
||||||
xz \
|
xz \
|
||||||
|
|||||||
@@ -147,7 +147,6 @@ If `BACKUP_LOCATION` = `S3` then the following options are used.
|
|||||||
| `S3_KEY_SECRET` | S3 Key Secret |
|
| `S3_KEY_SECRET` | S3 Key Secret |
|
||||||
| `S3_PATH` | S3 Pathname to save to e.g. '`backup`' |
|
| `S3_PATH` | S3 Pathname to save to e.g. '`backup`' |
|
||||||
| `S3_PROTOCOL` | Use either `http` or `https` to access service - Default `https` |
|
| `S3_PROTOCOL` | Use either `http` or `https` to access service - Default `https` |
|
||||||
| `S3_URI_STYLE` | Choose either `VIRTUALHOST` or `PATH` style - Default `VIRTUALHOST` |
|
|
||||||
|
|
||||||
|
|
||||||
## Maintenance
|
## Maintenance
|
||||||
|
|||||||
17
install/etc/cont-init.d/10-db-backup
Executable file
17
install/etc/cont-init.d/10-db-backup
Executable file
@@ -0,0 +1,17 @@
|
|||||||
|
#!/usr/bin/with-contenv bash
|
||||||
|
|
||||||
|
source /assets/functions/00-container
|
||||||
|
prepare_service single
|
||||||
|
prepare_service 03-monitoring
|
||||||
|
PROCESS_NAME="db-backup"
|
||||||
|
output_off
|
||||||
|
|
||||||
|
if var_true "${CONTAINER_ENABLE_MONITORING}" && [ "${CONTAINER_MONITORING_BACKEND,,}" = "zabbix" ]; then
|
||||||
|
cat <<EOF > "${ZABBIX_CONFIG_PATH}"/"${ZABBIX_CONFIG_FILE}.d"/tiredofit_dbbackup.conf
|
||||||
|
# Zabbix DB Backup Configuration - Automatically Generated
|
||||||
|
# Find Companion Zabbix Server Templates at https://github.com/tiredofit/docker-dbbackup
|
||||||
|
# Autoregister=dbbackup
|
||||||
|
EOF
|
||||||
|
fi
|
||||||
|
|
||||||
|
liftoff
|
||||||
@@ -1,7 +1,6 @@
|
|||||||
#!/usr/bin/with-contenv bash
|
#!/usr/bin/with-contenv bash
|
||||||
|
|
||||||
source /assets/functions/00-container
|
source /assets/functions/00-container
|
||||||
|
|
||||||
PROCESS_NAME="db-backup"
|
PROCESS_NAME="db-backup"
|
||||||
|
|
||||||
date >/dev/null
|
date >/dev/null
|
||||||
@@ -237,13 +236,16 @@ backup_redis() {
|
|||||||
ok=$(echo 'info Persistence' | redis-cli -h ${dbhost} -p ${dbport} ${REDIS_PASS_STR} | awk '/rdb_last_bgsave_status:ok/{print "ok"}')
|
ok=$(echo 'info Persistence' | redis-cli -h ${dbhost} -p ${dbport} ${REDIS_PASS_STR} | awk '/rdb_last_bgsave_status:ok/{print "ok"}')
|
||||||
if [[ "$saved" = "saved" ]] && [[ "$ok" = "ok" ]]; then
|
if [[ "$saved" = "saved" ]] && [[ "$ok" = "ok" ]]; then
|
||||||
print_info "Redis Backup Complete"
|
print_info "Redis Backup Complete"
|
||||||
|
break
|
||||||
fi
|
fi
|
||||||
try=$((try - 1))
|
try=$((try - 1))
|
||||||
print_info "Redis Busy - Waiting and retrying in 5 seconds"
|
print_info "Redis Busy - Waiting and retrying in 5 seconds"
|
||||||
sleep 5
|
sleep 5
|
||||||
done
|
done
|
||||||
generate_md5
|
target_original=${target}
|
||||||
compression
|
compression
|
||||||
|
$dumpoutput "${tmpdir}/${target_original}"
|
||||||
|
generate_md5
|
||||||
move_backup
|
move_backup
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -418,7 +420,10 @@ move_backup() {
|
|||||||
export AWS_ACCESS_KEY_ID=${S3_KEY_ID}
|
export AWS_ACCESS_KEY_ID=${S3_KEY_ID}
|
||||||
export AWS_SECRET_ACCESS_KEY=${S3_KEY_SECRET}
|
export AWS_SECRET_ACCESS_KEY=${S3_KEY_SECRET}
|
||||||
export AWS_DEFAULT_REGION=ap-northeast-2
|
export AWS_DEFAULT_REGION=ap-northeast-2
|
||||||
aws s3 cp ${tmpdir}/${target} s3://${S3_BUCKET}/${S3_PATH}/${target}
|
|
||||||
|
[[ ( -n "${S3_HOST}" ) ]] && PARAM_AWS_ENDPOINT_URL=" --endpoint-url ${S3_PROTOCOL}://${S3_HOST}"
|
||||||
|
|
||||||
|
aws ${PARAM_AWS_ENDPOINT_URL} s3 cp ${tmpdir}/${target} s3://${S3_BUCKET}/${S3_PATH}/${target}
|
||||||
|
|
||||||
rm -rf ${tmpdir}/*.md5
|
rm -rf ${tmpdir}/*.md5
|
||||||
rm -rf ${tmpdir}/"${target}"
|
rm -rf ${tmpdir}/"${target}"
|
||||||
@@ -436,9 +441,10 @@ print_debug "Backup routines Initialized on $(date)"
|
|||||||
today=$(date +"%Y%m%d")
|
today=$(date +"%Y%m%d")
|
||||||
|
|
||||||
if [[ $DB_DUMP_BEGIN =~ ^\+(.*)$ ]]; then
|
if [[ $DB_DUMP_BEGIN =~ ^\+(.*)$ ]]; then
|
||||||
waittime=$(( ${BASH_REMATCH[1]} * 60 ))
|
waittime=$(( ${BASH_REMATCH[1]} * 60 ))
|
||||||
|
target_time=$(($current_time + $waittime))
|
||||||
else
|
else
|
||||||
target_time=$(date --date="${today}${DB_DUMP_BEGIN}" +"%s")
|
target_time=$(date --date="${today}${DB_DUMP_BEGIN}" +"%s")
|
||||||
if [[ "$target_time" < "$current_time" ]]; then
|
if [[ "$target_time" < "$current_time" ]]; then
|
||||||
target_time=$(($target_time + 24*60*60))
|
target_time=$(($target_time + 24*60*60))
|
||||||
fi
|
fi
|
||||||
@@ -498,7 +504,7 @@ print_debug "Backup routines Initialized on $(date)"
|
|||||||
esac
|
esac
|
||||||
|
|
||||||
### Zabbix
|
### Zabbix
|
||||||
if var_true "$CONTAINER_ENABLE_MONITORING}" ; then
|
if var_true "${CONTAINER_ENABLE_MONITORING}" ; then
|
||||||
print_notice "Sending Backup Statistics to Zabbix"
|
print_notice "Sending Backup Statistics to Zabbix"
|
||||||
silent zabbix_sender -c /etc/zabbix/zabbix_agentd.conf -k dbbackup.size -o "$(stat -c%s "${DB_DUMP_TARGET}"/"${target}")"
|
silent zabbix_sender -c /etc/zabbix/zabbix_agentd.conf -k dbbackup.size -o "$(stat -c%s "${DB_DUMP_TARGET}"/"${target}")"
|
||||||
silent zabbix_sender -c /etc/zabbix/zabbix_agentd.conf -k dbbackup.datetime -o "$(date -r "${DB_DUMP_TARGET}"/"${target}" +'%s')"
|
silent zabbix_sender -c /etc/zabbix/zabbix_agentd.conf -k dbbackup.datetime -o "$(date -r "${DB_DUMP_TARGET}"/"${target}" +'%s')"
|
||||||
|
|||||||
@@ -1,515 +0,0 @@
|
|||||||
<?xml version="1.0" encoding="UTF-8"?>
|
|
||||||
<zabbix_export>
|
|
||||||
<version>3.4</version>
|
|
||||||
<date>2018-02-02T19:04:27Z</date>
|
|
||||||
<groups>
|
|
||||||
<group>
|
|
||||||
<name>Discovered Containers</name>
|
|
||||||
</group>
|
|
||||||
<group>
|
|
||||||
<name>Templates</name>
|
|
||||||
</group>
|
|
||||||
</groups>
|
|
||||||
<templates>
|
|
||||||
<template>
|
|
||||||
<template>Service - ICMP</template>
|
|
||||||
<name>Service - ICMP (Ping)</name>
|
|
||||||
<description/>
|
|
||||||
<groups>
|
|
||||||
<group>
|
|
||||||
<name>Templates</name>
|
|
||||||
</group>
|
|
||||||
</groups>
|
|
||||||
<applications>
|
|
||||||
<application>
|
|
||||||
<name>ICMP</name>
|
|
||||||
</application>
|
|
||||||
</applications>
|
|
||||||
<items>
|
|
||||||
<item>
|
|
||||||
<name>ICMP ping</name>
|
|
||||||
<type>3</type>
|
|
||||||
<snmp_community/>
|
|
||||||
<snmp_oid/>
|
|
||||||
<key>icmpping</key>
|
|
||||||
<delay>1m</delay>
|
|
||||||
<history>1w</history>
|
|
||||||
<trends>365d</trends>
|
|
||||||
<status>0</status>
|
|
||||||
<value_type>3</value_type>
|
|
||||||
<allowed_hosts/>
|
|
||||||
<units/>
|
|
||||||
<snmpv3_contextname/>
|
|
||||||
<snmpv3_securityname/>
|
|
||||||
<snmpv3_securitylevel>0</snmpv3_securitylevel>
|
|
||||||
<snmpv3_authprotocol>0</snmpv3_authprotocol>
|
|
||||||
<snmpv3_authpassphrase/>
|
|
||||||
<snmpv3_privprotocol>0</snmpv3_privprotocol>
|
|
||||||
<snmpv3_privpassphrase/>
|
|
||||||
<params/>
|
|
||||||
<ipmi_sensor/>
|
|
||||||
<authtype>0</authtype>
|
|
||||||
<username/>
|
|
||||||
<password/>
|
|
||||||
<publickey/>
|
|
||||||
<privatekey/>
|
|
||||||
<port/>
|
|
||||||
<description/>
|
|
||||||
<inventory_link>0</inventory_link>
|
|
||||||
<applications>
|
|
||||||
<application>
|
|
||||||
<name>ICMP</name>
|
|
||||||
</application>
|
|
||||||
</applications>
|
|
||||||
<valuemap>
|
|
||||||
<name>Service state</name>
|
|
||||||
</valuemap>
|
|
||||||
<logtimefmt/>
|
|
||||||
<preprocessing/>
|
|
||||||
<jmx_endpoint/>
|
|
||||||
<master_item/>
|
|
||||||
</item>
|
|
||||||
<item>
|
|
||||||
<name>ICMP loss</name>
|
|
||||||
<type>3</type>
|
|
||||||
<snmp_community/>
|
|
||||||
<snmp_oid/>
|
|
||||||
<key>icmppingloss</key>
|
|
||||||
<delay>1m</delay>
|
|
||||||
<history>1w</history>
|
|
||||||
<trends>365d</trends>
|
|
||||||
<status>0</status>
|
|
||||||
<value_type>0</value_type>
|
|
||||||
<allowed_hosts/>
|
|
||||||
<units>%</units>
|
|
||||||
<snmpv3_contextname/>
|
|
||||||
<snmpv3_securityname/>
|
|
||||||
<snmpv3_securitylevel>0</snmpv3_securitylevel>
|
|
||||||
<snmpv3_authprotocol>0</snmpv3_authprotocol>
|
|
||||||
<snmpv3_authpassphrase/>
|
|
||||||
<snmpv3_privprotocol>0</snmpv3_privprotocol>
|
|
||||||
<snmpv3_privpassphrase/>
|
|
||||||
<params/>
|
|
||||||
<ipmi_sensor/>
|
|
||||||
<authtype>0</authtype>
|
|
||||||
<username/>
|
|
||||||
<password/>
|
|
||||||
<publickey/>
|
|
||||||
<privatekey/>
|
|
||||||
<port/>
|
|
||||||
<description/>
|
|
||||||
<inventory_link>0</inventory_link>
|
|
||||||
<applications>
|
|
||||||
<application>
|
|
||||||
<name>ICMP</name>
|
|
||||||
</application>
|
|
||||||
</applications>
|
|
||||||
<valuemap/>
|
|
||||||
<logtimefmt/>
|
|
||||||
<preprocessing/>
|
|
||||||
<jmx_endpoint/>
|
|
||||||
<master_item/>
|
|
||||||
</item>
|
|
||||||
<item>
|
|
||||||
<name>ICMP response time</name>
|
|
||||||
<type>3</type>
|
|
||||||
<snmp_community/>
|
|
||||||
<snmp_oid/>
|
|
||||||
<key>icmppingsec</key>
|
|
||||||
<delay>1m</delay>
|
|
||||||
<history>1w</history>
|
|
||||||
<trends>365d</trends>
|
|
||||||
<status>0</status>
|
|
||||||
<value_type>0</value_type>
|
|
||||||
<allowed_hosts/>
|
|
||||||
<units>s</units>
|
|
||||||
<snmpv3_contextname/>
|
|
||||||
<snmpv3_securityname/>
|
|
||||||
<snmpv3_securitylevel>0</snmpv3_securitylevel>
|
|
||||||
<snmpv3_authprotocol>0</snmpv3_authprotocol>
|
|
||||||
<snmpv3_authpassphrase/>
|
|
||||||
<snmpv3_privprotocol>0</snmpv3_privprotocol>
|
|
||||||
<snmpv3_privpassphrase/>
|
|
||||||
<params/>
|
|
||||||
<ipmi_sensor/>
|
|
||||||
<authtype>0</authtype>
|
|
||||||
<username/>
|
|
||||||
<password/>
|
|
||||||
<publickey/>
|
|
||||||
<privatekey/>
|
|
||||||
<port/>
|
|
||||||
<description/>
|
|
||||||
<inventory_link>0</inventory_link>
|
|
||||||
<applications>
|
|
||||||
<application>
|
|
||||||
<name>ICMP</name>
|
|
||||||
</application>
|
|
||||||
</applications>
|
|
||||||
<valuemap/>
|
|
||||||
<logtimefmt/>
|
|
||||||
<preprocessing/>
|
|
||||||
<jmx_endpoint/>
|
|
||||||
<master_item/>
|
|
||||||
</item>
|
|
||||||
</items>
|
|
||||||
<discovery_rules/>
|
|
||||||
<httptests/>
|
|
||||||
<macros/>
|
|
||||||
<templates/>
|
|
||||||
<screens/>
|
|
||||||
</template>
|
|
||||||
<template>
|
|
||||||
<template>Zabbix - Container Agent</template>
|
|
||||||
<name>Zabbix - Container Agent</name>
|
|
||||||
<description/>
|
|
||||||
<groups>
|
|
||||||
<group>
|
|
||||||
<name>Discovered Containers</name>
|
|
||||||
</group>
|
|
||||||
<group>
|
|
||||||
<name>Templates</name>
|
|
||||||
</group>
|
|
||||||
</groups>
|
|
||||||
<applications>
|
|
||||||
<application>
|
|
||||||
<name>Packages</name>
|
|
||||||
</application>
|
|
||||||
<application>
|
|
||||||
<name>Zabbix agent</name>
|
|
||||||
</application>
|
|
||||||
</applications>
|
|
||||||
<items>
|
|
||||||
<item>
|
|
||||||
<name>Hostname of Container</name>
|
|
||||||
<type>0</type>
|
|
||||||
<snmp_community/>
|
|
||||||
<snmp_oid/>
|
|
||||||
<key>agent.hostname</key>
|
|
||||||
<delay>1h</delay>
|
|
||||||
<history>1w</history>
|
|
||||||
<trends>0</trends>
|
|
||||||
<status>0</status>
|
|
||||||
<value_type>1</value_type>
|
|
||||||
<allowed_hosts/>
|
|
||||||
<units/>
|
|
||||||
<snmpv3_contextname/>
|
|
||||||
<snmpv3_securityname/>
|
|
||||||
<snmpv3_securitylevel>0</snmpv3_securitylevel>
|
|
||||||
<snmpv3_authprotocol>0</snmpv3_authprotocol>
|
|
||||||
<snmpv3_authpassphrase/>
|
|
||||||
<snmpv3_privprotocol>0</snmpv3_privprotocol>
|
|
||||||
<snmpv3_privpassphrase/>
|
|
||||||
<params/>
|
|
||||||
<ipmi_sensor/>
|
|
||||||
<authtype>0</authtype>
|
|
||||||
<username/>
|
|
||||||
<password/>
|
|
||||||
<publickey/>
|
|
||||||
<privatekey/>
|
|
||||||
<port/>
|
|
||||||
<description/>
|
|
||||||
<inventory_link>3</inventory_link>
|
|
||||||
<applications>
|
|
||||||
<application>
|
|
||||||
<name>Zabbix agent</name>
|
|
||||||
</application>
|
|
||||||
</applications>
|
|
||||||
<valuemap/>
|
|
||||||
<logtimefmt/>
|
|
||||||
<preprocessing/>
|
|
||||||
<jmx_endpoint/>
|
|
||||||
<master_item/>
|
|
||||||
</item>
|
|
||||||
<item>
|
|
||||||
<name>Contaner OS</name>
|
|
||||||
<type>0</type>
|
|
||||||
<snmp_community/>
|
|
||||||
<snmp_oid/>
|
|
||||||
<key>agent.os</key>
|
|
||||||
<delay>6h</delay>
|
|
||||||
<history>30d</history>
|
|
||||||
<trends>0</trends>
|
|
||||||
<status>0</status>
|
|
||||||
<value_type>1</value_type>
|
|
||||||
<allowed_hosts/>
|
|
||||||
<units/>
|
|
||||||
<snmpv3_contextname/>
|
|
||||||
<snmpv3_securityname/>
|
|
||||||
<snmpv3_securitylevel>0</snmpv3_securitylevel>
|
|
||||||
<snmpv3_authprotocol>0</snmpv3_authprotocol>
|
|
||||||
<snmpv3_authpassphrase/>
|
|
||||||
<snmpv3_privprotocol>0</snmpv3_privprotocol>
|
|
||||||
<snmpv3_privpassphrase/>
|
|
||||||
<params/>
|
|
||||||
<ipmi_sensor/>
|
|
||||||
<authtype>0</authtype>
|
|
||||||
<username/>
|
|
||||||
<password/>
|
|
||||||
<publickey/>
|
|
||||||
<privatekey/>
|
|
||||||
<port/>
|
|
||||||
<description/>
|
|
||||||
<inventory_link>5</inventory_link>
|
|
||||||
<applications>
|
|
||||||
<application>
|
|
||||||
<name>Zabbix agent</name>
|
|
||||||
</application>
|
|
||||||
</applications>
|
|
||||||
<valuemap/>
|
|
||||||
<logtimefmt/>
|
|
||||||
<preprocessing/>
|
|
||||||
<jmx_endpoint/>
|
|
||||||
<master_item/>
|
|
||||||
</item>
|
|
||||||
<item>
|
|
||||||
<name>Zabbix Agent ping</name>
|
|
||||||
<type>0</type>
|
|
||||||
<snmp_community/>
|
|
||||||
<snmp_oid/>
|
|
||||||
<key>agent.ping</key>
|
|
||||||
<delay>1m</delay>
|
|
||||||
<history>1w</history>
|
|
||||||
<trends>365d</trends>
|
|
||||||
<status>0</status>
|
|
||||||
<value_type>3</value_type>
|
|
||||||
<allowed_hosts/>
|
|
||||||
<units/>
|
|
||||||
<snmpv3_contextname/>
|
|
||||||
<snmpv3_securityname/>
|
|
||||||
<snmpv3_securitylevel>0</snmpv3_securitylevel>
|
|
||||||
<snmpv3_authprotocol>0</snmpv3_authprotocol>
|
|
||||||
<snmpv3_authpassphrase/>
|
|
||||||
<snmpv3_privprotocol>0</snmpv3_privprotocol>
|
|
||||||
<snmpv3_privpassphrase/>
|
|
||||||
<params/>
|
|
||||||
<ipmi_sensor/>
|
|
||||||
<authtype>0</authtype>
|
|
||||||
<username/>
|
|
||||||
<password/>
|
|
||||||
<publickey/>
|
|
||||||
<privatekey/>
|
|
||||||
<port/>
|
|
||||||
<description>The agent always returns 1 for this item. It could be used in combination with nodata() for availability check.</description>
|
|
||||||
<inventory_link>0</inventory_link>
|
|
||||||
<applications>
|
|
||||||
<application>
|
|
||||||
<name>Zabbix agent</name>
|
|
||||||
</application>
|
|
||||||
</applications>
|
|
||||||
<valuemap>
|
|
||||||
<name>Zabbix agent ping status</name>
|
|
||||||
</valuemap>
|
|
||||||
<logtimefmt/>
|
|
||||||
<preprocessing/>
|
|
||||||
<jmx_endpoint/>
|
|
||||||
<master_item/>
|
|
||||||
</item>
|
|
||||||
<item>
|
|
||||||
<name>Zabbix Agent Version</name>
|
|
||||||
<type>0</type>
|
|
||||||
<snmp_community/>
|
|
||||||
<snmp_oid/>
|
|
||||||
<key>agent.version</key>
|
|
||||||
<delay>1h</delay>
|
|
||||||
<history>1w</history>
|
|
||||||
<trends>0</trends>
|
|
||||||
<status>0</status>
|
|
||||||
<value_type>1</value_type>
|
|
||||||
<allowed_hosts/>
|
|
||||||
<units/>
|
|
||||||
<snmpv3_contextname/>
|
|
||||||
<snmpv3_securityname/>
|
|
||||||
<snmpv3_securitylevel>0</snmpv3_securitylevel>
|
|
||||||
<snmpv3_authprotocol>0</snmpv3_authprotocol>
|
|
||||||
<snmpv3_authpassphrase/>
|
|
||||||
<snmpv3_privprotocol>0</snmpv3_privprotocol>
|
|
||||||
<snmpv3_privpassphrase/>
|
|
||||||
<params/>
|
|
||||||
<ipmi_sensor/>
|
|
||||||
<authtype>0</authtype>
|
|
||||||
<username/>
|
|
||||||
<password/>
|
|
||||||
<publickey/>
|
|
||||||
<privatekey/>
|
|
||||||
<port/>
|
|
||||||
<description/>
|
|
||||||
<inventory_link>0</inventory_link>
|
|
||||||
<applications>
|
|
||||||
<application>
|
|
||||||
<name>Zabbix agent</name>
|
|
||||||
</application>
|
|
||||||
</applications>
|
|
||||||
<valuemap/>
|
|
||||||
<logtimefmt/>
|
|
||||||
<preprocessing/>
|
|
||||||
<jmx_endpoint/>
|
|
||||||
<master_item/>
|
|
||||||
</item>
|
|
||||||
<item>
|
|
||||||
<name>Upgradable Packages</name>
|
|
||||||
<type>0</type>
|
|
||||||
<snmp_community/>
|
|
||||||
<snmp_oid/>
|
|
||||||
<key>packages.upgradable</key>
|
|
||||||
<delay>6h</delay>
|
|
||||||
<history>90d</history>
|
|
||||||
<trends>365d</trends>
|
|
||||||
<status>0</status>
|
|
||||||
<value_type>3</value_type>
|
|
||||||
<allowed_hosts/>
|
|
||||||
<units/>
|
|
||||||
<snmpv3_contextname/>
|
|
||||||
<snmpv3_securityname/>
|
|
||||||
<snmpv3_securitylevel>0</snmpv3_securitylevel>
|
|
||||||
<snmpv3_authprotocol>0</snmpv3_authprotocol>
|
|
||||||
<snmpv3_authpassphrase/>
|
|
||||||
<snmpv3_privprotocol>0</snmpv3_privprotocol>
|
|
||||||
<snmpv3_privpassphrase/>
|
|
||||||
<params/>
|
|
||||||
<ipmi_sensor/>
|
|
||||||
<authtype>0</authtype>
|
|
||||||
<username/>
|
|
||||||
<password/>
|
|
||||||
<publickey/>
|
|
||||||
<privatekey/>
|
|
||||||
<port/>
|
|
||||||
<description/>
|
|
||||||
<inventory_link>0</inventory_link>
|
|
||||||
<applications>
|
|
||||||
<application>
|
|
||||||
<name>Packages</name>
|
|
||||||
</application>
|
|
||||||
</applications>
|
|
||||||
<valuemap/>
|
|
||||||
<logtimefmt/>
|
|
||||||
<preprocessing/>
|
|
||||||
<jmx_endpoint/>
|
|
||||||
<master_item/>
|
|
||||||
</item>
|
|
||||||
</items>
|
|
||||||
<discovery_rules/>
|
|
||||||
<httptests/>
|
|
||||||
<macros/>
|
|
||||||
<templates/>
|
|
||||||
<screens/>
|
|
||||||
</template>
|
|
||||||
</templates>
|
|
||||||
<triggers>
|
|
||||||
<trigger>
|
|
||||||
<expression>{Service - ICMP:icmpping.max(3m)}=3</expression>
|
|
||||||
<recovery_mode>0</recovery_mode>
|
|
||||||
<recovery_expression/>
|
|
||||||
<name>Cannot be pinged</name>
|
|
||||||
<correlation_mode>0</correlation_mode>
|
|
||||||
<correlation_tag/>
|
|
||||||
<url/>
|
|
||||||
<status>0</status>
|
|
||||||
<priority>5</priority>
|
|
||||||
<description/>
|
|
||||||
<type>0</type>
|
|
||||||
<manual_close>0</manual_close>
|
|
||||||
<dependencies/>
|
|
||||||
<tags/>
|
|
||||||
</trigger>
|
|
||||||
<trigger>
|
|
||||||
<expression>{Service - ICMP:icmppingloss.min(10m)}>50</expression>
|
|
||||||
<recovery_mode>0</recovery_mode>
|
|
||||||
<recovery_expression/>
|
|
||||||
<name>Ping loss is too high</name>
|
|
||||||
<correlation_mode>0</correlation_mode>
|
|
||||||
<correlation_tag/>
|
|
||||||
<url/>
|
|
||||||
<status>0</status>
|
|
||||||
<priority>4</priority>
|
|
||||||
<description/>
|
|
||||||
<type>0</type>
|
|
||||||
<manual_close>0</manual_close>
|
|
||||||
<dependencies>
|
|
||||||
<dependency>
|
|
||||||
<name>Cannot be pinged</name>
|
|
||||||
<expression>{Service - ICMP:icmpping.max(3m)}=3</expression>
|
|
||||||
<recovery_expression/>
|
|
||||||
</dependency>
|
|
||||||
</dependencies>
|
|
||||||
<tags/>
|
|
||||||
</trigger>
|
|
||||||
<trigger>
|
|
||||||
<expression>{Service - ICMP:icmppingsec.avg(2m)}>100</expression>
|
|
||||||
<recovery_mode>0</recovery_mode>
|
|
||||||
<recovery_expression/>
|
|
||||||
<name>Ping Response time is too high</name>
|
|
||||||
<correlation_mode>0</correlation_mode>
|
|
||||||
<correlation_tag/>
|
|
||||||
<url/>
|
|
||||||
<status>0</status>
|
|
||||||
<priority>4</priority>
|
|
||||||
<description/>
|
|
||||||
<type>1</type>
|
|
||||||
<manual_close>0</manual_close>
|
|
||||||
<dependencies>
|
|
||||||
<dependency>
|
|
||||||
<name>Cannot be pinged</name>
|
|
||||||
<expression>{Service - ICMP:icmpping.max(3m)}=3</expression>
|
|
||||||
<recovery_expression/>
|
|
||||||
</dependency>
|
|
||||||
</dependencies>
|
|
||||||
<tags/>
|
|
||||||
</trigger>
|
|
||||||
<trigger>
|
|
||||||
<expression>{Zabbix - Container Agent:packages.upgradable.last()}>0</expression>
|
|
||||||
<recovery_mode>0</recovery_mode>
|
|
||||||
<recovery_expression/>
|
|
||||||
<name>Upgraded Packages in Container Available</name>
|
|
||||||
<correlation_mode>0</correlation_mode>
|
|
||||||
<correlation_tag/>
|
|
||||||
<url/>
|
|
||||||
<status>0</status>
|
|
||||||
<priority>1</priority>
|
|
||||||
<description/>
|
|
||||||
<type>0</type>
|
|
||||||
<manual_close>0</manual_close>
|
|
||||||
<dependencies/>
|
|
||||||
<tags/>
|
|
||||||
</trigger>
|
|
||||||
<trigger>
|
|
||||||
<expression>{Zabbix - Container Agent:agent.ping.nodata(3m)}=1</expression>
|
|
||||||
<recovery_mode>0</recovery_mode>
|
|
||||||
<recovery_expression/>
|
|
||||||
<name>Zabbix agent is unreachable</name>
|
|
||||||
<correlation_mode>0</correlation_mode>
|
|
||||||
<correlation_tag/>
|
|
||||||
<url/>
|
|
||||||
<status>0</status>
|
|
||||||
<priority>5</priority>
|
|
||||||
<description/>
|
|
||||||
<type>0</type>
|
|
||||||
<manual_close>0</manual_close>
|
|
||||||
<dependencies/>
|
|
||||||
<tags/>
|
|
||||||
</trigger>
|
|
||||||
</triggers>
|
|
||||||
<value_maps>
|
|
||||||
<value_map>
|
|
||||||
<name>Service state</name>
|
|
||||||
<mappings>
|
|
||||||
<mapping>
|
|
||||||
<value>0</value>
|
|
||||||
<newvalue>Down</newvalue>
|
|
||||||
</mapping>
|
|
||||||
<mapping>
|
|
||||||
<value>1</value>
|
|
||||||
<newvalue>Up</newvalue>
|
|
||||||
</mapping>
|
|
||||||
</mappings>
|
|
||||||
</value_map>
|
|
||||||
<value_map>
|
|
||||||
<name>Zabbix agent ping status</name>
|
|
||||||
<mappings>
|
|
||||||
<mapping>
|
|
||||||
<value>1</value>
|
|
||||||
<newvalue>Up</newvalue>
|
|
||||||
</mapping>
|
|
||||||
</mappings>
|
|
||||||
</value_map>
|
|
||||||
</value_maps>
|
|
||||||
</zabbix_export>
|
|
||||||
Reference in New Issue
Block a user