├── examples
├── .gitkeep
└── docker-compose.yml
├── .dockerignore
├── .github
├── FUNDING.yml
├── config.yml
├── dependabot.yml
├── workflows
│ ├── main.yml
│ └── manual.yml
└── ISSUE_TEMPLATE
│ ├── feature_request.md
│ └── bug_report.md
├── install
├── assets
│ ├── defaults
│ │ └── 20-backuppc
│ └── functions
│ │ └── 20-backuppc
└── etc
│ ├── services.available
│ ├── 20-backuppc
│ │ └── run
│ └── 11-fcgiwrap
│ │ └── run
│ ├── cont-init.d
│ └── 20-backuppc
│ ├── zabbix
│ └── zabbix_agentd.conf.d
│ │ ├── backuppc.conf
│ │ └── scripts
│ │ └── perl
│ │ ├── backuppc-discover.pl
│ │ └── backuppc.pl
│ └── nginx
│ └── sites.available
│ └── backuppc.conf
├── LICENSE
├── Dockerfile
├── CHANGELOG.md
├── README.md
└── zabbix_templates
└── app-backuppc.json
/examples/.gitkeep:
--------------------------------------------------------------------------------
1 |
--------------------------------------------------------------------------------
/.dockerignore:
--------------------------------------------------------------------------------
1 | examples/
2 |
--------------------------------------------------------------------------------
/.github/FUNDING.yml:
--------------------------------------------------------------------------------
1 | github: [tiredofit]
2 |
--------------------------------------------------------------------------------
/.github/config.yml:
--------------------------------------------------------------------------------
1 | blank_issues_enabled: false
2 |
--------------------------------------------------------------------------------
/.github/dependabot.yml:
--------------------------------------------------------------------------------
1 | version: 2
2 | updates:
3 | # Maintain dependencies for GitHub Actions
4 | - package-ecosystem: "github-actions"
5 | directory: "/"
6 | schedule:
7 | interval: "daily"
8 |
--------------------------------------------------------------------------------
/install/assets/defaults/20-backuppc:
--------------------------------------------------------------------------------
1 | #!/command/with-contenv bash
2 |
3 | BACKUPPC_ADMIN_USER=${BACKUPPC_ADMIN_USER:-"backuppc"}
4 | CONFIG_PATH=${CONFIG_PATH:-"/etc/backuppc/"}
5 | DATA_PATH=${DATA_PATH:-"/var/lib/backuppc/"}
6 | LOG_PATH=${LOG_PATH:-"/www/logs/"}
7 | SSH_KEYS_PATH=${SSH_KEYS_PATH:-"/home/backuppc/.ssh"}
8 |
--------------------------------------------------------------------------------
/install/etc/services.available/20-backuppc/run:
--------------------------------------------------------------------------------
1 | #!/command/with-contenv bash
2 |
3 | source /assets/functions/00-container
4 | prepare_service defaults single
5 |
6 | PROCESS_NAME="backuppc"
7 |
8 | check_container_initialized
9 | check_service_initialized 11-fcgiwrap
10 | liftoff
11 |
12 | print_start "Starting BackupPC ${BACKUPPC_VERSION}"
13 | silent exec s6-setuidgid backuppc /usr/local/BackupPC/bin/BackupPC
14 |
--------------------------------------------------------------------------------
/install/etc/cont-init.d/20-backuppc:
--------------------------------------------------------------------------------
1 | #!/command/with-contenv bash
2 |
3 | source /assets/functions/00-container
4 | prepare_service
5 | PROCESS_NAME="backuppc"
6 |
7 | bootstrap_filesystem
8 | create_zabbix backuppc
9 | generate_ssh_keys
10 | install_backuppc
11 | configure_ui
12 |
13 | print_info "BackupPC ${BACKUPPC_VERSION} initialization complete, now starting web server on port ${NGINX_LISTEN_PORT}"
14 | liftoff
15 |
--------------------------------------------------------------------------------
/install/etc/zabbix/zabbix_agentd.conf.d/backuppc.conf:
--------------------------------------------------------------------------------
1 | # Zabbix BackupPC Configuration
2 | # Find Companion Zabbix Server Templates at https://github.com/tiredofit/docker-backuppc
3 | # Autoregister=backuppc
4 |
5 | UserParameter=backuppc.collect_data,sudo -u backuppc /etc/zabbix/zabbix_agentd.conf.d/scripts/perl/backuppc.pl
6 | UserParameter=backuppc.discover,sudo -u backuppc /etc/zabbix/zabbix_agentd.conf.d/scripts/perl/backuppc-discover.pl
7 |
--------------------------------------------------------------------------------
/.github/workflows/main.yml:
--------------------------------------------------------------------------------
1 | name: "build_image"
2 |
3 | on:
4 | push:
5 | paths:
6 | - "**"
7 | - "!README.md"
8 |
9 | jobs:
10 | build:
11 | uses: tiredofit/github_actions/.github/workflows/default_amd64.yml@main
12 | #uses: tiredofit/github_actions/.github/workflows/default_amd64.yml@main
13 | #uses: tiredofit/github_actions/.github/workflows/default_amd64_armv7_arm64.yml@main
14 | #uses: tiredofit/github_actions/.github/workflows/default_amd64_arm64.yml@main
15 | secrets: inherit
16 |
--------------------------------------------------------------------------------
/install/etc/services.available/11-fcgiwrap/run:
--------------------------------------------------------------------------------
1 | #!/command/with-contenv bash
2 |
3 | source /assets/functions/00-container
4 | PROCESS_NAME="fcgiwrap"
5 |
6 | check_container_initialized
7 | check_service_initialized init 10-nginx
8 | liftoff
9 |
10 | print_start "Starting fcgiwrap"
11 | silent exec /usr/bin/spawn-fcgi \
12 | -s /var/run/fcgiwrap.sock \
13 | -P /var/run/fcgiwrap.pid \
14 | -u backuppc \
15 | -g backuppc \
16 | -U backuppc \
17 | -G backuppc \
18 | -M 660 \
19 | -n -- \
20 | /usr/bin/fcgiwrap
21 |
--------------------------------------------------------------------------------
/.github/workflows/manual.yml:
--------------------------------------------------------------------------------
1 | name: "manual_build_image"
2 |
3 | on:
4 | workflow_dispatch:
5 | inputs:
6 | Manual Build:
7 | description: 'Manual Build'
8 | required: false
9 |
10 | jobs:
11 | build:
12 | uses: tiredofit/github_actions/.github/workflows/default_amd64.yml@main
13 | #uses: tiredofit/github_actions/.github/workflows/default_amd64.yml@main
14 | #uses: tiredofit/github_actions/.github/workflows/default_amd64_armv7_arm64.yml@main
15 | #uses: tiredofit/github_actions/.github/workflows/default_amd64_arm64.yml@main
16 | secrets: inherit
17 |
--------------------------------------------------------------------------------
/.github/ISSUE_TEMPLATE/feature_request.md:
--------------------------------------------------------------------------------
1 | ---
2 | name: Feature request
3 | about: Suggest an idea or feature
4 | title: ''
5 | labels: enhancement
6 | assignees: ''
7 |
8 | ---
9 |
10 | ---
11 | name: Feature Request
12 | about: Suggest an idea for this project
13 |
14 | ---
15 |
16 | **Description of the feature**
17 |
18 |
19 | **Benftits of feature**
20 |
21 |
22 | **Additional context**
23 |
24 |
--------------------------------------------------------------------------------
/install/etc/nginx/sites.available/backuppc.conf:
--------------------------------------------------------------------------------
1 | server {
2 | ### Don't Touch This
3 | listen {{NGINX_LISTEN_PORT}};
4 | server_name localhost;
5 | root {{NGINX_WEBROOT}};
6 | ###
7 |
8 | index /index.cgi;
9 |
10 | location / {
11 | location ~ \.cgi$ {
12 | include fastcgi_params;
13 | fastcgi_pass unix:/var/run/fcgiwrap.sock;
14 |
15 | ## Always force backuppc
16 | fastcgi_param REMOTE_ADDR $remote_addr;
17 | fastcgi_param REMOTE_USER backuppc;
18 | fastcgi_param SCRIPT_FILENAME /www/cgi-bin/BackupPC/BackupPC_Admin;
19 | }
20 | }
21 |
22 | ### Don't edit past here
23 | include /etc/nginx/snippets/site_optimization.conf;
24 | include /etc/nginx/snippets/exploit_protection.conf;
25 | }
26 |
--------------------------------------------------------------------------------
/examples/docker-compose.yml:
--------------------------------------------------------------------------------
1 | version: '2.4'
2 | services:
3 |
4 | backuppc-app:
5 | image: tiredofit/backuppc
6 | container_name: backuppc-app
7 | labels:
8 | - traefik.enable=true
9 | - traefik.http.routers.backuppc.rule=Host(`backuppc.example.com`)
10 | - traefik.http.services.backuppc.loadbalancer.server.port=80
11 | volumes:
12 | - ./data:/var/lib/backuppc
13 | - ./conf/etc/:/etc/backuppc
14 | - ./conf/home/:/home/backuppc
15 | - ./logs:/www/logs
16 | environment:
17 | - CONTAINER_NAME=backuppc-app
18 | - USER_BACKUPPC=1000
19 | - GROUP_BACKUPPC=1000
20 |
21 | - NGINX_AUTHENTICATION_TYPE=BASIC
22 | - NGINX_AUTHENTICATION_BASIC_USER1=backuppc
23 | - NGINX_AUTHENTICATION_BASIC_PASS1=backuppc
24 | - DEBUG_MODE=FALSE
25 | networks:
26 | - proxy
27 | - services
28 | restart: always
29 |
30 | networks:
31 | proxy:
32 | external: true
33 | services:
34 | external: true
35 |
--------------------------------------------------------------------------------
/.github/ISSUE_TEMPLATE/bug_report.md:
--------------------------------------------------------------------------------
1 | ---
2 | name: Bug report
3 | about: If something isn't working right..
4 | title: ''
5 | labels: bug
6 | assignees: ''
7 |
8 | ---
9 |
10 | ### Summary
11 |
12 |
13 |
14 |
15 | ### Steps to reproduce
16 |
17 |
18 |
19 |
20 | ### What is the expected *correct* behavior?
21 |
22 |
23 |
24 |
25 | ### Relevant logs and/or screenshots
26 |
27 |
28 |
29 | ### Environment
30 |
31 |
32 | - Image version / tag:
33 | - Host OS:
34 |
35 |
36 | Any logs | docker-compose.yml
37 |
38 |
39 |
40 |
41 | ### Possible fixes
42 |
43 |
--------------------------------------------------------------------------------
/LICENSE:
--------------------------------------------------------------------------------
1 | The MIT License (MIT)
2 |
3 | Copyright (c) 2022 Dave Conroy
4 |
5 | Permission is hereby granted, free of charge, to any person obtaining a copy
6 | of this software and associated documentation files (the "Software"), to deal
7 | in the Software without restriction, including without limitation the rights
8 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9 | copies of the Software, and to permit persons to whom the Software is
10 | furnished to do so, subject to the following conditions:
11 |
12 | The above copyright notice and this permission notice shall be included in all
13 | copies or substantial portions of the Software.
14 |
15 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21 | SOFTWARE.
22 |
--------------------------------------------------------------------------------
/install/etc/zabbix/zabbix_agentd.conf.d/scripts/perl/backuppc-discover.pl:
--------------------------------------------------------------------------------
1 | #!/usr/bin/perl
2 |
3 | # Backuppc
4 | use lib "/usr/local/BackupPC/lib";
5 | use BackupPC::Lib;
6 | use BackupPC::CGI::Lib;
7 |
8 | #Other
9 | use Data::Dumper;
10 |
11 | # Globals
12 | $bpc = BackupPC::Lib->new();
13 | $hosts = $bpc->HostInfoRead();
14 |
15 | # Collect Data
16 | GetStatusInfo("jobs queueLen info");
17 | &hosts_info();
18 |
19 |
20 | # Functions
21 | sub hosts_info
22 | {
23 | print '{ "data":['."\n";
24 | my $comma='';
25 | while ( my ($host, $value) = each(%$hosts) )
26 | {
27 | print $comma.' {"{#BACKUPHOST}":"'.$host.'"}'."\n";
28 | $comma=",";
29 | }
30 | print " ]}";
31 | }
32 |
33 |
34 |
35 | sub GetStatusInfo
36 | {
37 | my($status) = @_;
38 | ServerConnect();
39 | %Status = () if ( $status =~ /\bhosts\b/ );
40 | %StatusHost = () if ( $status =~ /\bhost\(/ );
41 | my $reply = $bpc->ServerMesg("status $status");
42 | $reply = $1 if ( $reply =~ /(.*)/s );
43 | eval($reply);
44 | # ignore status related to admin and trashClean jobs
45 | if ( $status =~ /\bhosts\b/ ) {
46 | foreach my $host ( grep(/admin/, keys(%Status)) ) {
47 | delete($Status{$host}) if ( $bpc->isAdminJob($host) );
48 | }
49 | delete($Status{$bpc->trashJob});
50 | }
51 | }
52 |
53 | #
54 | # Returns the list of hosts that should appear in the navigation bar
55 | # for this user. If $getAll is set, the admin gets all the hosts.
56 | # Otherwise, regular users get hosts for which they are the user or
57 | # are listed in the moreUsers column in the hosts file.
58 | #
59 | sub GetUserHosts
60 | {
61 | my($getAll) = @_;
62 | my @hosts;
63 |
64 | if ( $getAll ) {
65 | @hosts = sort keys %$Hosts;
66 | } else {
67 | @hosts = sort grep { $Hosts->{$_}{user} eq $User ||
68 | defined($Hosts->{$_}{moreUsers}{$User}) } keys(%$Hosts);
69 | }
70 | return @hosts;
71 | }
72 |
73 |
74 | sub ServerConnect
75 | {
76 | #
77 | # Verify that the server connection is ok
78 | #
79 | return if ( $bpc->ServerOK() );
80 | $bpc->ServerDisconnect();
81 | if ( my $err = $bpc->ServerConnect($Conf{ServerHost}, $Conf{ServerPort}) ) {
82 | if ( CheckPermission()
83 | && -f $Conf{ServerInitdPath}
84 | && $Conf{ServerInitdStartCmd} ne "" ) {
85 | my $content = eval("qq{$Lang->{Admin_Start_Server}}");
86 | Header(eval("qq{$Lang->{Unable_to_connect_to_BackupPC_server}}"), $content);
87 | Trailer();
88 | exit(1);
89 | } else {
90 | ErrorExit(eval("qq{$Lang->{Unable_to_connect_to_BackupPC_server}}"));
91 | }
92 | }
93 | }
94 |
95 |
96 |
97 |
--------------------------------------------------------------------------------
/install/assets/functions/20-backuppc:
--------------------------------------------------------------------------------
1 | #!/command/with-contenv bash
2 |
3 | bootstrap_filesystem() {
4 | print_debug "[bootstrap_filesystem] Creating Configuration directory"
5 | if [ ! -d "${CONFIG_PATH}" ]; then
6 | mkdir -p "${CONFIG_PATH}"
7 | fi
8 | if [ "$(stat -c '%u' "${CONFIG_PATH}")" != "$(id -u backuppc)" ] ; then chown -R backuppc:backuppc "${CONFIG_PATH}" ; fi
9 | if dir_empty "${CONFIG_PATH}" ; then
10 | print_notice "[bootstrap_filesystem] Detected New Installation - Generating default configuration"
11 | fi
12 |
13 | print_debug "[bootstrap_filesystem] Creating Configuration directory"
14 | if [ ! -d "${DATA_PATH}" ]; then
15 | mkdir -p "${DATA_PATH}"
16 | fi
17 | if [ "$(stat -c '%u' "${DATA_PATH}")" != "$(id -u backuppc)" ] ; then chown backuppc:backuppc "${DATA_PATH}" ; fi
18 |
19 |
20 | print_debug "[bootstrap_filesystem] Creating SSH Keys directory"
21 | if [ ! -d "${SSH_KEYS_PATH}" ]; then
22 | mkdir -p "${SSH_KEYS_PATH}"
23 | fi
24 |
25 | if [ "$(stat -c '%u' "${SSH_KEYS_PATH}")" != "$(id -u backuppc)" ] ; then chown -R backuppc:backuppc "${SSH_KEYS_PATH}" ; fi
26 | if [ "$(stat -c '%a' "${SSH_KEYS_PATH}")" != "700" ] ; then chmod 700 "${SSH_KEYS_PATH}" ; fi
27 | if [[ "${SSH_KEYS_PATH}" =~ "/home/backupppc".* ]] ; then
28 | if [ "$(stat -c '%u' "/home/backuppc")" != "$(id -u backuppc)" ] ; then chown -R backuppc:backuppc "/home/backuppc" ; fi
29 | fi
30 | if [ ! -d "/home/backuppc/.ssh" ] ; then
31 | ln -sf "${SSH_KEYS_PATH}" /home/backuppc/.ssh
32 | fi
33 |
34 | print_debug "[bootstrap_filesystem] Creating Logfiles"
35 | if [ ! -d "${LOG_PATH}" ]; then
36 | mkdir -p "${LOG_PATH}"
37 | fi
38 | if [ "$(stat -c '%u' "${LOG_PATH}")" != "$(id -u backuppc)" ] ; then chown -R backuppc:backuppc "${LOG_PATH}" ; fi
39 | }
40 |
41 | configure_ui() {
42 | sed -ie "s/^\$Conf{CgiAdminUsers}\s*=\s*'\w*'/\$Conf{CgiAdminUsers} = 'backuppc'/g" "${CONFIG_PATH}"/config.pl
43 | }
44 |
45 | generate_ssh_keys() {
46 | if [ ! -f "${SSH_KEYS_PATH}"/id_rsa ]; then
47 | print_notice "[generate_ssh_keys] Creating RSA SSH key"
48 | silent su backuppc -s /bin/sh -c "ssh-keygen -t rsa -b 4096 -N '' -f ${SSH_KEYS_PATH}/id_rsa"
49 | fi
50 |
51 | if [ ! -f "${SSH_KEYS_PATH}"/id_ed25519 ]; then
52 | print_notice "[generate_ssh_keys] Creating ed25519 SSH key"
53 | silent su backuppc -s /bin/sh -c "ssh-keygen -t ed25519 -o -a 100 -q -N '' -f ${SSH_KEYS_PATH}/id_ed25519"
54 | fi
55 | }
56 |
57 | install_backuppc() {
58 | print_debug "[install_backuppc] Installing BackupPC ${BACKUPPC_VERSION}"
59 | cd /assets/install || exit
60 | silent perl configure.pl \
61 | --batch \
62 | --config-dir "${CONFIG_PATH}" \
63 | --cgi-dir /www/cgi-bin/BackupPC \
64 | --data-dir "${DATA_PATH}" \
65 | --hostname localhost \
66 | --html-dir /www/html/BackupPC \
67 | --html-dir-url /BackupPC \
68 | --install-dir /usr/local/BackupPC \
69 | --log-dir "${LOG_PATH}"
70 | }
71 |
--------------------------------------------------------------------------------
/Dockerfile:
--------------------------------------------------------------------------------
1 | ARG DISTRO="alpine"
2 | ARG DISTRO_VARIANT="3.19"
3 |
4 | FROM docker.io/tiredofit/nginx:${DISTRO}-${DISTRO_VARIANT}
5 | LABEL maintainer="Dave Conroy (github.com/tiredofit)"
6 |
7 | ARG BACKUPPC_VERSION
8 | ARG BACKUPPC_XS_VERSION
9 | ARG PAR2_VERSION
10 | ARG RSYNC_BPC_VERSION
11 |
12 | ENV BACKUPPC_VERSION=${BACKUPPC_VERSION:-"4.4.0"} \
13 | BACKUPPC_XS_VERSION=${BACKUPPC_XS_VERSION:-"0.62"} \
14 | PAR2_VERSION=${PAR2_VERSION:-"v0.8.0"} \
15 | RSYNC_BPC_VERSION=${RSYNC_BPC_VERSION:-"3.1.3.0"} \
16 | CONTAINER_ENABLE_PERMISSIONS=TRUE \
17 | USER_BACKUPPC=1000 \
18 | GROUP_BACKUPPC=1000 \
19 | NGINX_ENABLE_CREATE_SAMPLE_HTML=FALSE \
20 | NGINX_LISTEN_PORT=80 \
21 | NGINX_USER=backuppc \
22 | NGINX_GROUP=backuppc \
23 | NGINX_SITE_ENABLED=backuppc \
24 | CONTAINER_ENABLE_MESSAGING=TRUE \
25 | IMAGE_NAME="tiredofit/backuppc" \
26 | IMAGE_REPO_URL="https://github.com/tiredofit/docker-backuppc/"
27 |
28 | RUN source /assets/functions/00-container && \
29 | set -x && \
30 | addgroup -S -g ${GROUP_BACKUPPC} backuppc && \
31 | adduser -D \
32 | -S \
33 | -h /home/backuppc \
34 | -s /sbin/nologin -G backuppc -g "backuppc" -u ${USER_BACKUPPC} backuppc \
35 | && \
36 | addgroup zabbix backuppc && \
37 | package update && \
38 | package upgrade && \
39 | package install .backuppc-build-deps \
40 | autoconf \
41 | automake \
42 | acl-dev \
43 | build-base \
44 | bzip2-dev \
45 | expat-dev \
46 | g++ \
47 | gcc \
48 | git \
49 | make \
50 | patch \
51 | perl-dev \
52 | perl-app-cpanminus \
53 | && \
54 | \
55 | package install .backuppc-run-deps \
56 | bzip2 \
57 | expat \
58 | gzip \
59 | fcgiwrap \
60 | iputils \
61 | libgomp \
62 | openssh \
63 | openssl \
64 | perl \
65 | perl-archive-zip \
66 | perl-cgi \
67 | perl-file-listing \
68 | perl-json-xs \
69 | perl-time-parsedate \
70 | perl-xml-rss \
71 | pigz \
72 | rrdtool \
73 | rsync \
74 | samba-client \
75 | spawn-fcgi \
76 | sudo \
77 | ttf-dejavu \
78 | && \
79 | \
80 | cpanm -M https://cpan.metacpan.org install \
81 | Net::FTP \
82 | Net::FTP::AutoReconnect \
83 | && \
84 | \
85 | mkdir -p /usr/src/pbzip2 && \
86 | curl -ssL https://launchpad.net/pbzip2/1.1/1.1.13/+download/pbzip2-1.1.13.tar.gz | tar xvfz - --strip=1 -C /usr/src/pbzip2 && \
87 | cd /usr/src/pbzip2 && \
88 | make -j$(nproc)&& \
89 | make install && \
90 | \
91 | clone_git_repo https://github.com/backuppc/backuppc-xs.git ${BACKUPPC_XS_VERSION} && \
92 | perl Makefile.PL && \
93 | make -j$(nproc)&& \
94 | make test && \
95 | make install && \
96 | \
97 | clone_git_repo https://github.com/backuppc/rsync-bpc.git ${RSYNC_BPC_VERSION} && \
98 | ./configure && \
99 | make reconfigure && \
100 | make -j$(nproc)&& \
101 | make install && \
102 | \
103 | clone_git_repo https://github.com/Parchive/par2cmdline.git ${PAR2_VERSION} && \
104 | ./automake.sh && \
105 | ./configure && \
106 | make -j$(nproc)&& \
107 | make check && \
108 | make install && \
109 | \
110 | mkdir -p /assets/install && \
111 | curl -sSL https://github.com/backuppc/backuppc/releases/download/$BACKUPPC_VERSION/BackupPC-$BACKUPPC_VERSION.tar.gz | tar xvfz - --strip 1 -C /assets/install && \
112 | \
113 | curl -sSL https://github.com/backuppc/backuppc/commit/2c9270b9b849b2c86ae6301dd722c97757bc9256.patch -o /assets/install/patchfile.patch && \
114 | cd /assets/install && \
115 | patch -p1 < patchfile.patch && \
116 | package remove .backuppc-build-deps && \
117 | package cleanup && \
118 | rm -rf /root/.cpanm \
119 | /tmp/* \
120 | /usr/src/*
121 |
122 | COPY install/ /
123 |
--------------------------------------------------------------------------------
/CHANGELOG.md:
--------------------------------------------------------------------------------
1 | ## 6.0.4 2024-05-24
2 |
3 | ### Changed
4 | - Optimize 6.0.3
5 |
6 |
7 | ## 6.0.3 2024-05-24
8 |
9 | ### Changed
10 | - Alpine 3.19 base
11 | - Introduce patch from BackupPC upstream to solve Data:Dumper incompatibility with smbclient
12 |
13 |
14 | ## 6.0.2 2023-03-06
15 |
16 | ### Changed
17 | - Add libgomp to suppoer executing PAR2
18 |
19 |
20 | ## 6.0.1 2022-12-20
21 |
22 | ### Changed
23 | - Rollback to using Alpine 3.16 (Perl 5.34.1) due to compatibility issues
24 |
25 |
26 | ## 6.0.0 2022-12-05
27 |
28 | This introduces breaking changes due to the deprecation of the BACKUPPC_UUID and BACKUPPC_GID environment variables. They have now been replaced with USER_BACKUPPC and GROUP_BACKUPPC respectively.
29 | Additionally, the defaults for volume mappings is going to change in an upcoming release. This release introduces the capabilities of altering them from current locations
30 |
31 | ### Added
32 | - Introduce CONFIG_PATH, DATA_PATH, LOG_PATH, SSH_KEY_PATH for customization on where you want to store bits related to this image. See README or code for defaults
33 | - Switch to using container base image User and Group ID modifications (USER_BACKUPPC + GROUP_BACKUPPC)
34 |
35 | ### Changed
36 | - Rework Dockerfile to cleanup issues relating to installation, home directory creation (#13)
37 | - Rework container initialization scripts splitting into functions / modernizing to latest tiredfoit base image
38 |
39 | ### Reverted
40 | - Removal of BACKUPPC_UUID variable (see New features for replacement)
41 | - Removal of BACKUPPC_GUID variable (see new features for replacement)
42 |
43 |
44 | ## 5.3.16 2022-12-01
45 |
46 | ### Changed
47 | - Rework Dockerfile
48 |
49 |
50 | ## 5.3.15 2022-11-23
51 |
52 | ### Added
53 | - Alpine 3.17 base
54 |
55 |
56 | ## 5.3.14 2022-10-05
57 |
58 | ### Changed
59 | - Fix legacy nginx configuration
60 |
61 |
62 | ## 5.3.13 2022-10-04
63 |
64 | ### Changed
65 | - Switch to clone_git_repo function
66 |
67 |
68 | ## 5.3.12 2022-08-17
69 |
70 | ### Changed
71 | - Switch to using exec statements
72 |
73 |
74 | ## 5.3.11 2022-06-23
75 |
76 | ### Added
77 | - Support tiredofit/nginx:6.0.0 and tiredofit/nginx-php-fpm:7.0.0 changes
78 |
79 |
80 | ## 5.3.10 2022-05-24
81 |
82 | ### Changed
83 | - Switch to using secure CPAN mirror when installing Net::FTP
84 |
85 |
86 | ## 5.3.9 2022-05-24
87 |
88 | ### Added
89 | - Alpine 3.16 base
90 |
91 |
92 | ## 5.3.8 2022-02-10
93 |
94 | ### Changed
95 | - Update to support upstream base image features
96 |
97 |
98 | ## 5.3.7 2022-01-13
99 |
100 | ### Added
101 | - Add perl-date-parsetime package
102 |
103 |
104 | ## 5.3.6 2021-12-22
105 |
106 | ### Changed
107 | - Fix for BackuPC Zabbix template not appearing
108 |
109 |
110 | ## 5.3.5 2021-12-15
111 |
112 | ### Changed
113 | - Cleanup for Zabbix Auto agent registration
114 |
115 |
116 | ## 5.3.4 2021-12-12
117 |
118 | ### Changed
119 | - Alpine 3.15 base
120 | - Rework Zabbix Templates
121 |
122 |
123 | ## 5.3.3 2021-12-07
124 |
125 | ### Added
126 | - Add Zabbix auto register support for templates
127 |
128 |
129 | ## 5.3.2 2021-10-20
130 |
131 | ### Added
132 | - Add perl packages to support metrics export
133 |
134 |
135 | ## 5.3.1 2021-07-30
136 |
137 | ### Added
138 | - Update to Alpine 3.14 base
139 |
140 |
141 | ## 5.3.0 2021-04-28
142 |
143 | ### Added
144 | - Add ed25519 SSH client key
145 |
146 | ### Changed
147 | - Add smoke test for testing if smtp is enabled/disabled
148 |
149 |
150 | ## 5.2.5 2021-04-28
151 |
152 | ### Changed
153 | - Permissions fix on script execution
154 |
155 |
156 | ## 5.2.4 2021-04-28
157 |
158 | ### Changed
159 | - Permissions fix on script
160 |
161 |
162 | ## 5.2.3 2021-03-26
163 |
164 | ### Added
165 | - Alpine 3.13 Base
166 |
167 |
168 | ## 5.2.2 2020-11-03
169 |
170 | ### Added
171 | - Update rsync-bpc to 3.13.0
172 |
173 |
174 | ## 5.2.1 2020-07-08
175 |
176 | ### Added
177 | - BackupPC 4.40
178 | - BackupPC_XS 0.62
179 | - Rsync BPC 3.12.2
180 | - Alpine 3.12
181 |
182 |
183 | ## 5.2.0 2020-06-08
184 |
185 | ### Added
186 | - Change to support tiredofit/alpine base image
187 |
188 |
189 | ## 5.1.5 2020-03-16
190 |
191 | ### Changed
192 | - Update msmtp configuration
193 |
194 |
195 | ## 5.1.4 2020-03-09
196 |
197 | ### Added
198 | - BackupPC 4.3.2
199 |
200 |
201 | ## 5.1.3 2020-01-20
202 |
203 | ### Added
204 | - Add ttf-dejavu package to properly generate graphs
205 |
206 | ## 5.1.2 2020-01-13
207 |
208 | ### Changed
209 | - Change to allow BackupPC process to execute properly
210 |
211 |
212 | ## 5.1.1 2020-01-02
213 |
214 | ### Changed
215 | - Additional changes to support new tiredofit/backuppc image
216 |
217 |
218 | ## 5.1.0 2019-12-29
219 |
220 | ### Added
221 | - Changes to support new tiredofit/alpine base
222 |
223 | ## 5.0.0 2019-12-12
224 |
225 | ### Added
226 | - Refactored entire image to use tiredofit/nginx as a base
227 |
228 | ### Changed
229 | - Reworked authentication mechanisms
230 | - Cleaned up code
231 |
232 |
233 | ## 4.6 - 2019-07-25
234 |
235 | * BackupPC 4.3.1
236 | * BackupPCXS 0.59
237 | * BackupPC Rsync 3.1.2.1
238 |
239 | ## 4.5 - 2019-06-19
240 |
241 | * Alpine 3.10
242 |
243 | ## 4.4.4 - 2019-02-24
244 |
245 | * Add some error checking
246 |
247 | ## 4.4.3 - 2019-02-24
248 |
249 | * Add Debug during build
250 |
251 | ## 4.4.2 - 2019-02-08
252 |
253 | * Bump to Alpine 3.9
254 |
255 | ## 4.4.1 - 2018-12-11
256 |
257 | * Add acl-dev during build process
258 | * Startup Script cleanup
259 |
260 | ## 4.4 - 2018-12-11
261 |
262 | * BackupPC 4.3.0
263 | * BackupPCXS 0.58
264 | * BackupPC Rsync 3.12.0
265 |
266 | ## 4.3 - 2018-04-15
267 |
268 | * Update permissions to write for Nginx
269 | * Patchup for LLNG Handler Function
270 |
271 | ## 4.2 - 2018-04-15
272 |
273 | * Update BackupPC to 4.2.0
274 |
275 | ## 4.1 - 2018-03-26
276 |
277 | * Add $PORT_NUMBER env variable for changing Nginx Port if using on user_ns: host
278 |
279 | ## 4.0 - 2018-02-25
280 |
281 | * Switch to Nginx w/fcgiwrap from Lightttpd
282 | * Update Rsync_BPC to 3.0.9.12
283 | * Update to Alpine 3.7
284 | * Add new AUTHENTICATION_TYPE variable for BASIC, LLNG (LemonLDAP:NG) and NONE
285 | * Cleanup Source
286 |
287 | ## 3.5 - 2018-01-23
288 |
289 | * Update PAR2 0.80
290 | * Update Rsync BPC to 3.0.9.11
291 | * Zabbix Tweaks
292 |
293 | ## 3.41 - 2017-12-09
294 |
295 | * Filesystem Cleanup
296 |
297 | ## 3.4 - 2017-12-09
298 |
299 | * Version Bump to 4.15
300 | * BackupPC:XS 0.57
301 |
302 | ## 3.31 - 2017-12-09
303 |
304 | * Update BackupXS to 0.56
305 |
306 | ## 3.3 - 2017-11-30
307 |
308 | * Version bump to 4.14
309 |
310 | ## 3.2 - 2017-07-04
311 |
312 | * Version Bump and MSMTP Fixup
313 |
314 | ## 3.1 - 2017-07-04
315 |
316 | * File Cleanup
317 | * MSMTP Fixup
318 |
319 | ## 3.0 - 2017-07-04
320 |
321 | * Rebase with s6
322 | * Add Sudo
323 |
324 | ## 2.1 - 2017-05-14
325 |
326 | * Zabbix Agent Monitoring Scripts Update
327 |
328 | ## 2.0 - 2017-05-12
329 |
330 | * Rebase w/Alpine 3.5
331 | * Zabbix Monitoring Enabled
332 | * BackupPC 4.1.2
333 | * Lighthttpd
334 |
335 | ## 1.0 - 2017-01-01
336 |
337 | * Initial Commit
338 |
--------------------------------------------------------------------------------
/README.md:
--------------------------------------------------------------------------------
1 | # github.com/tiredofit/docker-backuppc
2 |
3 | [](https://github.com/tiredofit/docker-backuppc/releases/latest)
4 | [](https://github.com/tiredofit/docker-backuppc/actions)
5 | [](https://hub.docker.com/r/tiredofit/backuppc/)
6 | [](https://hub.docker.com/r/tiredofit/backuppc/)
7 | [](https://github.com/sponsors/tiredofit)
8 | [](https://www.paypal.me/tiredofit)
9 |
10 | * * *
11 |
12 | ## About
13 | This will build a Docker image for [BackupPC](https://backuppc.github.io/backuppc/) - A highly performant backup system.
14 |
15 | ## Maintainer
16 | - [Dave Conroy](https://github.com/tiredofit)
17 |
18 | # Table of Contents
19 |
20 | - [Configuration](#configuration)
21 | - [Data-Volumes](#data-volumes)
22 | - [Environment Variables](#environment-variables)
23 | - [Networking](#networking)
24 | - [Maintenance](#maintenance)
25 | - [Shell Access](#shell-access)
26 |
27 | ## Prerequisites and Assumptions
28 | - Assumes you are using some sort of SSL terminating reverse proxy such as:
29 | - [Traefik](https://github.com/tiredofit/docker-traefik)
30 | - [Nginx](https://github.com/jc21/nginx-proxy-manager)
31 | - [Caddy](https://github.com/caddyserver/caddy)
32 | - Make sure there is adequate storage available to perform deduplicated backups!
33 |
34 |
35 | ## Installation
36 |
37 | ### Build from Source
38 | Clone this repository and build the image with `docker build -t (imagename) .`
39 |
40 | ### Prebuilt Images
41 | Builds of the image are available on [Docker Hub](https://hub.docker.com/r/tiredofit/backuppc)
42 |
43 | ```bash
44 | docker pull docker.io/tiredofit/backuppc:(imagetag)
45 | ```
46 |
47 | Builds of the image are also available on the [Github Container Registry](https://github.com/tiredofit/docker-backuppc/pkgs/container/docker-backuppc)
48 |
49 | ```
50 | docker pull ghcr.io/tiredofit/docker-backuppc:(imagetag)
51 | ```
52 |
53 | The following image tags are available along with their tagged release based on what's written in the [Changelog](CHANGELOG.md):
54 |
55 | | Container OS | Tag |
56 | | ------------ | --------- |
57 | | Alpine | `:latest` |
58 |
59 | ## Configuration
60 |
61 |
62 | ### Quick Start
63 |
64 | - The quickest way to get started is using [docker-compose](https://docs.docker.com/compose/). See the examples folder for a working [docker-compose.yml](examples/docker-compose.yml) that can be modified for development or production use.
65 |
66 | - Set various [environment variables](#environment-variables) to understand the capabilities of this image.
67 | - Map [persistent storage](#data-volumes) for access to configuration and data files for backup.
68 | - Enter inside the container and as user `backuppc` `ssh-copy-id` your public keys to a remote host
69 | - Visit your Web interface
70 |
71 | ### Persistent Storage
72 |
73 | The following directories are used for configuration and can be mapped for persistent storage.
74 |
75 | | Directory | Description |
76 | | ------------------- | -------------------------------------- |
77 | | `/etc/backuppc` | Configuration Files |
78 | | `/home/backuppc` | Home Directory for Backuppc (SSH Keys) |
79 | | `/var/lib/backuppc` | The backed up Data |
80 | | `/www/logs` | Logfiles for Nginx, BackupPC |
81 |
82 | ### Environment Variables
83 |
84 | #### Base Images used
85 |
86 | This image relies on an [Alpine Linux](https://hub.docker.com/r/tiredofit/alpine) or [Debian Linux](https://hub.docker.com/r/tiredofit/debian) base image that relies on an [init system](https://github.com/just-containers/s6-overlay) for added capabilities. Outgoing SMTP capabilities are handlded via `msmtp`. Individual container performance monitoring is performed by [zabbix-agent](https://zabbix.org). Additional tools include: `bash`,`curl`,`less`,`logrotate`, `nano`.
87 |
88 | Be sure to view the following repositories to understand all the customizable options:
89 |
90 | | Image | Description |
91 | | ------------------------------------------------------ | -------------------------------------- |
92 | | [OS Base](https://github.com/tiredofit/docker-alpine/) | Customized Image based on Alpine Linux |
93 | | [Nginx](https://github.com/tiredofit/docker-nginx/) | Nginx webserver |
94 |
95 | #### Container Options
96 |
97 | | Variable | Description | Default |
98 | | ---------------- | ----------------------------- | ---------------------- |
99 | | `USER_BACKUPPC` | The uid for the backuppc user | `1000` |
100 | | `GROUP_BACKUPPC` | The gid for the backuppc user | `1000` |
101 | | `CONFIG_PATH` | BackupPC Configuration Files | `/etc/backuppc` |
102 | | `DATA_PATH` | BackupPC data backups | `/var/lib/backuppc` |
103 | | `LOG_PATH` | Logfiles for BackupPC | `/www/logs/backuppc` |
104 | | `SSH_KEYS_PATH` | SSH Keys Path | `/home/.backuppc/.ssh` |
105 |
106 |
107 | #### Authentication
108 |
109 | By default, this image does not use authentication. This is definitely not recommended on a production environment! Based on the environment variables from the [Nginx Base Image](https://github.com/tiredofit/docker-nginx/) you can set them here:
110 |
111 | It's highly recommend you set at minimum:
112 |
113 | ```bash
114 | NGINX_AUTHENTICATION_TYPE=BASIC
115 | NGINX_AUTHENTICATION_BASIC_USER1=backuppc
116 | NGINX_AUTHENTICATION_BASIC_PASS1=backuppc
117 | ```
118 |
119 | | Parameter | Description | Default |
120 | | ------------------------------------------- | ------------------------------------------------------------------------------ | -------------- |
121 | | `NGINX_AUTHENTICATION_TYPE` | Protect the site with `BASIC`, `LDAP`, `LLNG` | `NONE` |
122 | | `NGINX_AUTHENTICATION_TITLE` | Challenge response when visiting protected site | `Please login` |
123 | | `NGINX_AUTHENTICATION_BASIC_USER1` | If `BASIC` chosen enter this for the username to protect site | `admin` |
124 | | `NGINX_AUTHENTICATION_BASIC_PASS1` | If `BASIC` chosen enter this for the password to protect site | `password` |
125 | | `NGINX_AUTHENTICATION_BASIC_USER2` | As above, increment for more users | |
126 | | `NGINX_AUTHENTICATION_BASIC_PASS2` | As above, increment for more users | |
127 | | `NGINX_AUTHENTICATION_LDAP_HOST` | Hostname and port number of LDAP Server - ie `ldap://ldapserver:389` | |
128 | | `NGINX_AUTHENTICATION_LDAP_BIND_DN` | User to Bind to LDAP - ie `cn=admin,dc=orgname,dc=org` | |
129 | | `NGINX_AUTHENTICATION_LDAP_BIND_PW` | Password for Above Bind User - ie `password` | |
130 | | `NGINX_AUTHENTICATION_LDAP_BASE_DN` | Base Distringuished Name - eg `dc=hostname,dc=com` | |
131 | | `NGINX_AUTHENTICATION_LDAP_ATTRIBUTE` | Unique Identifier Attrbiute -ie `uid` | |
132 | | `NGINX_AUTHENTICATION_LDAP_SCOPE` | LDAP Scope for searching - ie `sub` | |
133 | | `NGINX_AUTHENTICATION_LDAP_FILTER` | Define what object that is searched for (ie `objectClass=person`) | |
134 | | `NGINX_AUTHENTICATION_LDAP_GROUP_ATTRIBUTE` | If searching inside of a group what is the Group Attribute - ie `uniquemember` | |
135 | | `NGINX_AUTHENTICATION_LLNG_HANDLER_HOST` | If `LLNG` chosen use hostname of handler | `llng-handler` |
136 | | `NGINX_AUTHENTICATION_LLNG_HANDLER_PORT` | If `LLNG` chosen use this port for handler | `2884` |
137 | | `NGINX_AUTHENTICATION_LLNG_ATTRIBUTE1` | Syntax: HEADER_NAME, Variable, Upstream Variable - See note below | |
138 | | `NGINX_AUTHENTICATION_LLNG_ATTRIBUTE2` | Syntax: HEADER_NAME, Variable, Upstream Variable - See note below | |
139 |
140 | When working with `NGINX_AUTHENTICATION_LLNG_ATTRIBUTE2` you will need to omit any `$` chracters from your string. It will be added in upon container startup. Example:
141 | `NGINX_AUTHENTICATION_LLNG_ATTRIBUTE1=HTTP_AUTH_USER,uid,upstream_http_uid` will get converted into `HTTP_AUTH_USER,$uid,$upstream_http_uid` and get placed in the appropriate areas in the configuration.
142 | * * *
143 |
144 | #### SMTP Options
145 |
146 | See the [MSMTP Configuration Options](https://marlam.de/msmtp/msmtp.html) for further information on options to configure MSMTP.
147 |
148 | | Parameter | Description | Default |
149 | | --------------------- | ------------------------------------------------- | --------------- |
150 | | `SMTP_AUTO_FROM` | Add setting to support sending through Gmail SMTP | `FALSE` |
151 | | `SMTP_HOST` | Hostname of SMTP Server | `postfix-relay` |
152 | | `SMTP_PORT` | Port of SMTP Server | `25` |
153 | | `SMTP_DOMAIN` | HELO Domain | `docker` |
154 | | `SMTP_MAILDOMAIN` | Mail Domain From | `local` |
155 | | `SMTP_AUTHENTICATION` | SMTP Authentication | `none` |
156 | | `SMTP_USER` | SMTP Username | `` |
157 | | `SMTP_PASS` | SMTP Password | `` |
158 | | `SMTP_TLS` | Use TLS | `FALSE` |
159 | | `SMTP_STARTTLS` | Start TLS from within session | `FALSE` |
160 | | `SMTP_TLSCERTCHECK` | Check remote certificate | `FALSE` |
161 |
162 | ### Networking
163 |
164 | The following ports are exposed and available to public interfaces
165 |
166 | | Port | Description |
167 | | ---- | ----------- |
168 | | `80` | HTTP |
169 |
170 | **NOTE**: It is highly recommended this be run through a SSL proxy, or via localhost and tunnel via SSH.
171 |
172 | ## Maintenance
173 |
174 | ### Shell Access
175 |
176 | For debugging and maintenance purposes you may want access the containers shell.
177 |
178 | ````bash
179 | docker exec -it (whatever your container name is) bash
180 | ````
181 |
182 | ## Support
183 |
184 | These images were built to serve a specific need in a production environment and gradually have had more functionality added based on requests from the community.
185 |
186 | ### Usage
187 | - The [Discussions board](../../discussions) is a great place for working with the community on tips and tricks of using this image.
188 | - [Sponsor me](https://tiredofit.ca/sponsor) for personalized support
189 |
190 | ### Bugfixes
191 | - Please, submit a [Bug Report](issues/new) if something isn't working as expected. I'll do my best to issue a fix in short order.
192 |
193 | ### Feature Requests
194 | - Feel free to submit a feature request, however there is no guarantee that it will be added, or at what timeline.
195 | - [Sponsor me](https://tiredofit.ca/sponsor) regarding development of features.
196 |
197 | ### Updates
198 | - Best effort to track upstream changes, More priority if I am actively using the image in a production environment.
199 | - [Sponsor me](https://tiredofit.ca/sponsor) for up to date releases.
200 |
201 | ## License
202 | MIT. See [LICENSE](LICENSE) for more details.
203 |
204 | # References
205 |
206 | - http://backuppc.sourceforge.net/
207 | - https://backuppc.github.io/backuppc/
208 |
--------------------------------------------------------------------------------
/install/etc/zabbix/zabbix_agentd.conf.d/scripts/perl/backuppc.pl:
--------------------------------------------------------------------------------
1 | #!/usr/bin/perl
2 | #
3 | # Based on script from https://www.zabbix.com/forum/showthread.php?t=17273
4 | #
5 | # Backuppc
6 | use lib "/usr/local/BackupPC/lib";
7 | use BackupPC::Lib;
8 | use BackupPC::CGI::Lib;
9 |
10 | #Other
11 | use Data::Dumper;
12 |
13 | # Globals
14 | $bpc = BackupPC::Lib->new();
15 | $hosts = $bpc->HostInfoRead();
16 |
17 | # Setup
18 | &var_config();
19 | &zabbix_config();
20 |
21 | # %Info = Pool Info
22 | # %QueueLen = Command Queues
23 | # %Jobs = jobs
24 |
25 | # Collect Data
26 | GetStatusInfo("jobs queueLen info");
27 | #print Dumper(%Info);
28 | &jobs_info();
29 | &pool_info();
30 | &queue_info();
31 | &general_info();
32 | &hosts_info();
33 |
34 | # Push Data to Zabbix
35 | foreach my $key (keys %Val) {
36 | if ($Var{$key})
37 | {
38 | zabbix_post($Var{$key},$Val{$key});
39 | #print "$Var{$key} | $Val{$key}\n";
40 | }
41 | }
42 | print "1";
43 |
44 |
45 | # Functions
46 | sub hosts_info
47 | {
48 | # Variables
49 | $fullSizeTot = 0;
50 | $fullCnt = 0;
51 | $fullCnt2 = 0;
52 | $incrSizeTot = 0;
53 | $incrCnt = 0;
54 | $incrCnt2 = 0;
55 | $total_speed_full = 0;
56 | $total_speed_incr = 0;
57 |
58 | $no_backups_2 = "NONE";
59 | $no_backups_3 = "NONE";
60 | $no_backups_4 = "NONE";
61 | $no_backups_5 = "NONE";
62 |
63 | while ( my ($host, $value) = each(%$hosts) )
64 | {
65 |
66 | my @Backups = $bpc->BackupInfoRead($host);
67 | $bpc->ConfigRead($host);
68 | my %Conf = $bpc->Conf();
69 |
70 | # Variables
71 | my $fullAge;
72 | my $fullSize;
73 | my $fullDur;
74 | my $incrAge;
75 | my $incrSize;
76 | my $incrDur;
77 | my $vfullAge="fullAge".$host;
78 | my $vfullSize="fullSize".$host;
79 | my $vfullDur="fullDur".$host;
80 | my $vincrAge="incrAge".$host;
81 | my $vincrSize="incrSize".$host;
82 | my $vincrDur="incrDur".$host;
83 | my $vfullErrs="fullErrs".$host;
84 | my $vfullBadShare="fullBadShare".$host;
85 | my $vfullBadFile="fullBadFile".$host;
86 | my $vfulltarErrs="fulltarErrs".$host;
87 | my $vincrErrs="incrErrs".$host;
88 | my $vincrBadShare="incrBadShare".$host;
89 | my $vincrBadFile="incrBadFile".$host;
90 | my $vincrtarErrs="incrtarErrs".$host;
91 |
92 | $Var{$vfullAge}="backuppc.fullage[".$host."]";
93 | $Var{$vfullSize}="backuppc.fullsize[".$host."]";
94 | $Var{$vfullDur}="backuppc.fulldur[".$host."]";
95 | $Var{$vincrAge}="backuppc.incrage[".$host."]";
96 | $Var{$vincrSize}="backuppc.incrsize[".$host."]";
97 | $Var{$vincrDur}="backuppc.incrdur[".$host."]";
98 | $Var{$vfullErrs}="backuppc.fullerrs[".$host."]";
99 | $Var{$vfullBadShare}="backuppc.fullbadshare[".$host."]";
100 | $Var{$vfullBadFile}="backuppc.fullbadfile[".$host."]";
101 | $Var{$vfulltarErrs}="backuppc.fulltarerrs[".$host."]";
102 | $Var{$vincrErrs}="backuppc.increrrs[".$host."]";
103 | $Var{$vincrBadShare}="backuppc.incrbadshare[".$host."]";
104 | $Var{$vincrBadFile}="backuppc.incrbadfile[".$host."]";
105 | $Var{$vincrtarErrs}="backuppc.incrtarerrs[".$host."]";
106 | for ( my $i = 0 ; $i < @Backups ; $i++ )
107 | {
108 | if ( $Backups[$i]{type} eq "full" )
109 | {
110 | $fullCnt++;
111 | if ( $fullAge < 0 || $Backups[$i]{startTime} > $fullAge )
112 | {
113 | $fullAge = $Backups[$i]{startTime};
114 | $fullSize = $Backups[$i]{size};
115 | $fullDur = $Backups[$i]{endTime} - $Backups[$i]{startTime};
116 | $Val{$vfullErrs}=$Backups[$i]{xferErrs};
117 | $Val{$vfullBadShare}=$Backups[$i]{xferBadShare};
118 | $Val{$vfullBadFile}=$Backups[$i]{xferBadFile};
119 | $Val{$vfulltarErrs}=$Backups[$i]{tarErrs};
120 | $Val{$vfullAge}=(time() - $fullAge)/86400;
121 | $Val{$vfullSize}=$fullSize;
122 | $Val{$vfullDur}=$fullDur;
123 | }
124 | $fullSizeTot += $Backups[$i]{size};
125 | }
126 | else
127 | {
128 | $incrCnt++;
129 | if ( $incrAge < 0 || $Backups[$i]{startTime} > $incrAge )
130 | {
131 | $incrAge = $Backups[$i]{startTime};
132 | $incrSize = $Backups[$i]{size};
133 | $incrDur = $Backups[$i]{endTime} - $Backups[$i]{startTime};
134 | $Val{$vincrErrs}=$Backups[$i]{xferErrs};
135 | $Val{$vincrBadShare}=$Backups[$i]{xferBadShare};
136 | $Val{$vincrBadFile}=$Backups[$i]{xferBadFile};
137 | $Val{$vincrtarErrs}=$Backups[$i]{tarErrs};
138 | $Val{$vincrAge}=(time() - $incrAge)/86400;
139 | $Val{$vincrSize}=$incrSize;
140 | $Val{$vincrDur}=$incrDur;
141 | }
142 | $incrSizeTot += $Backups[$i]{size};
143 | }
144 | }
145 | # Sum the Last Full Backup Speed
146 | if ($fullSize > 0 && $fullDur >0)
147 | {
148 | $total_speed_full += ($fullSize / $fullDur);
149 | $fullCnt2++;
150 | }
151 | # Sum the Last Full Incr Speed
152 | if ($incrSize > 0 && $incrDur >0)
153 | {
154 | $total_speed_incr += ($incrSize / $incrDur);
155 | $incrCnt2++;
156 | }
157 |
158 | if ($host eq "haulingaz")
159 | {
160 | print "Full Age: $fullAge\n";
161 | print "Full Period: $Conf{FullPeriod}\n";
162 | print "Incr Age: $incrAge\n";
163 | print "Incr Period: $Conf{IncrPeriod}\n";
164 | }
165 |
166 | # Check for Hosts that don't have backups (Full)
167 | my $skip_inc = 0;
168 |
169 | # If we have a full that less than 2 days old we can skip
170 | if ( (time() - $fullAge) < ( (86400 * 2) ) && $Conf{BackupsDisable} == 0 )
171 | { $skip_inc = 1;}
172 |
173 | # If we don't have any fulls, we are going to set the no_backups so we can skip inc
174 | if ( (time() - $fullAge) > ( ($Conf{FullPeriod} * 86400) + (86400 * 2) ) &&
175 | $Conf{BackupsDisable} == 0 )
176 | { if ($no_backups_2 eq "NONE") { $no_backups_2 = "$host"} else { $no_backups_2 .=
177 | "\n$host" } $skip_inc = 1;}
178 |
179 | if ( (time() - $fullAge) > ( ($Conf{FullPeriod} * 86400) + (86400 * 3) ) &&
180 | $Conf{BackupsDisable} == 0 )
181 | { if ($no_backups_3 eq "NONE") { $no_backups_3 = "$host"} else { $no_backups_3 .=
182 | "\n$host" } $skip_inc = 1;}
183 |
184 | if ( (time() - $fullAge) > ( ($Conf{FullPeriod} * 86400) + (86400 * 4) ) &&
185 | $Conf{BackupsDisable} == 0 )
186 | { if ($no_backups_4 eq "NONE") { $no_backups_4 = "$host"} else { $no_backups_4 .=
187 | "\n$host" } $skip_inc = 1;}
188 |
189 | if ( (time() - $fullAge) > ( ($Conf{FullPeriod} * 86400) + (86400 * 5) ) &&
190 | $Conf{BackupsDisable} == 0 )
191 | { if ($no_backups_5 eq "NONE") { $no_backups_5 = "$host"} else { $no_backups_5 .=
192 | "\n$host" } $skip_inc = 1;}
193 |
194 | # Check for Hosts that don't have backups (Incremental)
195 | if ( (time() - $incrAge) > ( ($Conf{IncrPeriod} * 86400) + (86400 * 2) ) &&
196 | $Conf{BackupsDisable} == 0 && $Conf{IncrKeepCnt} > 0 && $skip_inc == 0)
197 | { if ($no_backups_2 eq "NONE") { $no_backups_2 = "$host"} else { $no_backups_2 .=
198 | "\n$host" } }
199 |
200 | if ( (time() - $incrAge) > ( ($Conf{IncrPeriod} * 86400) + (86400 * 3) ) &&
201 | $Conf{BackupsDisable} == 0 && $Conf{IncrKeepCnt} > 0 && $skip_inc == 0)
202 | { if ($no_backups_3 eq "NONE") { $no_backups_3 = "$host"} else { $no_backups_3 .=
203 | "\n$host" } }
204 |
205 | if ( (time() - $incrAge) > ( ($Conf{IncrPeriod} * 86400) + (86400 * 4) ) &&
206 | $Conf{BackupsDisable} == 0 && $Conf{IncrKeepCnt} > 0 && $skip_inc == 0)
207 | { if ($no_backups_4 eq "NONE") { $no_backups_4 = "$host"} else { $no_backups_4 .=
208 | "\n$host" } }
209 |
210 | if ( (time() - $incrAge) > ( ($Conf{IncrPeriod} * 86400) + (86400 * 5) ) &&
211 | $Conf{BackupsDisable} == 0 && $Conf{IncrKeepCnt} > 0 && $skip_inc == 0)
212 | { if ($no_backups_5 eq "NONE") { $no_backups_5 = "$host"} else { $no_backups_5 .=
213 | "\n$host" } }
214 |
215 |
216 | }
217 | if ($fullCnt2 > 0 )
218 | { $Val{hostsAvgFullSpeed} = ($total_speed_full / $fullCnt2); }
219 | if ($incrCnt2 > 0 )
220 | { $Val{hostsAvgIncrSpeed} = ($total_speed_incr / $incrCnt2); }
221 | $Val{hostsFullSize} = $fullSizeTot;
222 | $Val{hostsFullCount} = $fullCnt;
223 | $Val{hostsIncrSize} = $incrSizeTot;
224 | $Val{hostsIncrCount} = $incrCnt;
225 | $Val{hostsNoBackups2} = $no_backups_2;
226 | $Val{hostsNoBackups3} = $no_backups_3;
227 | $Val{hostsNoBackups4} = $no_backups_4;
228 | $Val{hostsNoBackups5} = $no_backups_5;
229 | }
230 |
231 | sub pool_info
232 | {
233 | while ( my ($key, $value) = each(%Info) )
234 | {
235 | if ($key =~ /pool/)
236 | {$Val{$key} = int($Info{$key}); }
237 | }
238 | }
239 |
240 |
241 | sub general_info
242 | {
243 | $Val{startTime} = time() - $Info{startTime};
244 | $Val{Version} = $Info{Version};
245 | $Val{ConfigLTime} = time() - $Info{ConfigLTime};
246 |
247 | }
248 |
249 | sub queue_info
250 | {
251 | while ( my ($key, $value) = each(%QueueLen) )
252 | {
253 | if ($key =~ /Queue/)
254 | {$Val{$key} = $QueueLen{$key};}
255 | }
256 | }
257 |
258 | sub jobs_info
259 | {
260 | $Val{JobsIncr} = 0;
261 | $Val{JobsFull} = 0;
262 | $Val{JobsOther} = 0;
263 |
264 | # Jobs
265 | while ( my ($key, $value) = each(%Jobs) ) {
266 | #print "$key => $value\n";
267 | #print Dumper($value);
268 | if (!($key =~ /trashClean/i))
269 | {
270 | # Count Incrementail Jobs
271 | if( $value->{'type'} eq 'incr')
272 | { $Val{JobsIncr}++; }
273 |
274 | # Count Full Jobs
275 | elsif( $value->{'type'} eq 'full')
276 | { $Val{JobsFull}++; }
277 |
278 | # Everything Else
279 | else { $Val{JobsOther}++; }
280 | }
281 | }
282 |
283 | }
284 |
285 | sub GetStatusInfo
286 | {
287 | my($status) = @_;
288 | ServerConnect();
289 | %Status = () if ( $status =~ /\bhosts\b/ );
290 | %StatusHost = () if ( $status =~ /\bhost\(/ );
291 | my $reply = $bpc->ServerMesg("status $status");
292 | $reply = $1 if ( $reply =~ /(.*)/s );
293 | eval($reply);
294 | # ignore status related to admin and trashClean jobs
295 | if ( $status =~ /\bhosts\b/ ) {
296 | foreach my $host ( grep(/admin/, keys(%Status)) ) {
297 | delete($Status{$host}) if ( $bpc->isAdminJob($host) );
298 | }
299 | delete($Status{$bpc->trashJob});
300 | }
301 | }
302 |
303 | #
304 | # Returns the list of hosts that should appear in the navigation bar
305 | # for this user. If $getAll is set, the admin gets all the hosts.
306 | # Otherwise, regular users get hosts for which they are the user or
307 | # are listed in the moreUsers column in the hosts file.
308 | #
309 | sub GetUserHosts
310 | {
311 | my($getAll) = @_;
312 | my @hosts;
313 |
314 | if ( $getAll ) {
315 | @hosts = sort keys %$Hosts;
316 | } else {
317 | @hosts = sort grep { $Hosts->{$_}{user} eq $User ||
318 | defined($Hosts->{$_}{moreUsers}{$User}) } keys(%$Hosts);
319 | }
320 | return @hosts;
321 | }
322 |
323 |
324 | sub ServerConnect
325 | {
326 | #
327 | # Verify that the server connection is ok
328 | #
329 | return if ( $bpc->ServerOK() );
330 | $bpc->ServerDisconnect();
331 | if ( my $err = $bpc->ServerConnect($Conf{ServerHost}, $Conf{ServerPort}) ) {
332 | if ( CheckPermission()
333 | && -f $Conf{ServerInitdPath}
334 | && $Conf{ServerInitdStartCmd} ne "" ) {
335 | my $content = eval("qq{$Lang->{Admin_Start_Server}}");
336 | Header(eval("qq{$Lang->{Unable_to_connect_to_BackupPC_server}}"), $content);
337 | Trailer();
338 | exit(1);
339 | } else {
340 | ErrorExit(eval("qq{$Lang->{Unable_to_connect_to_BackupPC_server}}"));
341 | }
342 | }
343 | }
344 |
345 |
346 | sub zabbix_config {
347 |
348 | open(CONFIG,"/etc/zabbix/zabbix_agentd.conf");
349 | foreach()
350 | {
351 | $zabbix_host = $1 if (/Hostname\s*=\s*(.*)/);
352 | $zabbix_server = $1 if (/Server\s*=\s*(.*)/);
353 | }
354 | close CONFIG;
355 | }
356 |
357 | sub zabbix_post {
358 | my $key = $_[0];
359 | my $val = $_[1];
360 | my @servers = split(',', $zabbix_server);
361 |
362 | foreach my $server (@servers) {
363 | my $cmd = "zabbix_sender -z zabbix-proxy -p 10051 -s $zabbix_host -k $key -o '$val'";
364 | system("$cmd >/dev/null");
365 | }
366 | }
367 |
368 |
369 | sub var_config {
370 |
371 | # Pool Info
372 | $Var{poolFileCnt} = "backuppc.pool_file_count";
373 | $Var{poolDirCnt} = "backuppc.pool_dir_count";
374 | #$Var{poolFileCntRm} = "backuppc.pool_file_removed";
375 | $Var{poolFileCntRep} = "backuppc.pool_file_repeat";
376 | $Var{poolFileRepMax} = "backuppc.pool_file_repeat_max";
377 | $Var{poolFileLinkMax} = "backuppc.pool_file_link_max";
378 | $Var{poolKb} = "backuppc.pool_size";
379 | $Var{cpoolFileCnt} = "backuppc.cpool_file_count";
380 | $Var{cpoolDirCnt} = "backuppc.cpool_dir_count";
381 | #$Var{cpoolFileCntRm} = "backuppc.cpool_file_removed";
382 | $Var{cpoolFileCntRep} = "backuppc.cpool_file_repeat";
383 | $Var{cpoolFileRepMax} = "backuppc.cpool_file_repeat_max";
384 | $Var{cpoolFileLinkMax} = "backuppc.cpool_file_link_max";
385 | $Var{cpoolKb} = "backuppc.cpool_size";
386 |
387 | # General Stats
388 | $Var{startTime} = "backuppc.uptime";
389 | $Var{Version} = "backuppc.version";
390 | $Var{ConfigLTime} = "backuppc.config_load_time";
391 |
392 | # Queues
393 | $Var{CmdQueue} = "backuppc.queue_command";
394 | $Var{UserQueue} = "backuppc.queue_user";
395 | $Var{BgQueue} = "backuppc.queue_background";
396 |
397 | # Jobs
398 | $Var{JobsIncr} = "backuppc.jobs_incr";
399 | $Var{JobsFull} = "backuppc.jobs_full";
400 | $Var{JobsOther} = "backuppc.jobs_other";
401 |
402 |
403 | # Hosts
404 | $Var{hostsAvgFullSpeed} = "backuppc.hosts_full_speed";
405 | $Var{hostsAvgIncrSpeed} = "backuppc.hosts_incr_speed";
406 | $Var{hostsFullSize} = "backuppc.hosts_full_size";
407 | $Var{hostsFullCount} = "backuppc.hosts_full_count";
408 | $Var{hostsIncrSize} = "backuppc.hosts_incr_size";
409 | $Var{hostsIncrCount} = "backuppc.hosts_incr_count";
410 | $Var{hostsNoBackups2} = "backuppc.hosts_nobackup_2";
411 | $Var{hostsNoBackups3} = "backuppc.hosts_nobackup_3";
412 | $Var{hostsNoBackups4} = "backuppc.hosts_nobackup_4";
413 | $Var{hostsNoBackups5} = "backuppc.hosts_nobackup_5";
414 | }
415 |
--------------------------------------------------------------------------------
/zabbix_templates/app-backuppc.json:
--------------------------------------------------------------------------------
1 | {
2 | "zabbix_export": {
3 | "version": "5.4",
4 | "date": "2021-12-13T01:04:47Z",
5 | "groups": [
6 | {
7 | "uuid": "3500ba09d0534297840ca620c9dd46bf",
8 | "name": "Backup"
9 | },
10 | {
11 | "uuid": "7df96b18c230490a9a0a9e2307226338",
12 | "name": "Templates"
13 | }
14 | ],
15 | "templates": [
16 | {
17 | "uuid": "9caddf6c00c743199019d559f4085e28",
18 | "template": "BackupPC",
19 | "name": "BackupPC",
20 | "description": "Template for monitoring BackupPC instance\n\nThis is meant to be used with https://github.com/tiredofit/docker-backuppc",
21 | "groups": [
22 | {
23 | "name": "Backup"
24 | },
25 | {
26 | "name": "Templates"
27 | }
28 | ],
29 | "items": [
30 | {
31 | "uuid": "38d5865eedcc41c1ba16635c3307a78a",
32 | "name": "BackupPC: Collect Data",
33 | "type": "ZABBIX_ACTIVE",
34 | "key": "backuppc.collect_data",
35 | "history": "0",
36 | "trends": "0",
37 | "value_type": "TEXT",
38 | "description": "system.run[\"sudo -u backuppc /etc/zabbix/zabbix_agentd.conf.d/backuppc.pl\"]",
39 | "request_method": "POST",
40 | "tags": [
41 | {
42 | "tag": "Application",
43 | "value": "BackupPC"
44 | }
45 | ]
46 | },
47 | {
48 | "uuid": "5b83f50bfa774b27878f17012cc77b38",
49 | "name": "BackupPC: Config Uptime",
50 | "type": "TRAP",
51 | "snmp_oid": "interfaces.ifTable.ifEntry.ifInOctets.1",
52 | "key": "backuppc.config_load_time",
53 | "delay": "0",
54 | "history": "7d",
55 | "units": "uptime",
56 | "request_method": "POST",
57 | "tags": [
58 | {
59 | "tag": "Application",
60 | "value": "BackupPC"
61 | }
62 | ]
63 | },
64 | {
65 | "uuid": "e504b0e4c36d40218532eade15db1351",
66 | "name": "BackupPC: Pool Directory Count (Compressed)",
67 | "type": "TRAP",
68 | "snmp_oid": "interfaces.ifTable.ifEntry.ifInOctets.1",
69 | "key": "backuppc.cpool_dir_count",
70 | "delay": "0",
71 | "history": "7d",
72 | "request_method": "POST",
73 | "tags": [
74 | {
75 | "tag": "Application",
76 | "value": "BackupPC"
77 | }
78 | ]
79 | },
80 | {
81 | "uuid": "e623b37b7ec84b16b6383edc761c9ab4",
82 | "name": "BackupPC: Pool File Count (Compressed)",
83 | "type": "TRAP",
84 | "snmp_oid": "interfaces.ifTable.ifEntry.ifInOctets.1",
85 | "key": "backuppc.cpool_file_count",
86 | "delay": "0",
87 | "history": "7d",
88 | "request_method": "POST",
89 | "tags": [
90 | {
91 | "tag": "Application",
92 | "value": "BackupPC"
93 | }
94 | ]
95 | },
96 | {
97 | "uuid": "122be6aae4f5464c9057f4f9eafe1a66",
98 | "name": "BackupPC: Pool File Max Links (Compressed)",
99 | "type": "TRAP",
100 | "snmp_oid": "interfaces.ifTable.ifEntry.ifInOctets.1",
101 | "key": "backuppc.cpool_file_link_max",
102 | "delay": "0",
103 | "history": "7d",
104 | "request_method": "POST",
105 | "tags": [
106 | {
107 | "tag": "Application",
108 | "value": "BackupPC"
109 | }
110 | ]
111 | },
112 | {
113 | "uuid": "653632ef59774675a36fdb0bc0905757",
114 | "name": "BackupPC: Pool File Repeat (Compressed)",
115 | "type": "TRAP",
116 | "snmp_oid": "interfaces.ifTable.ifEntry.ifInOctets.1",
117 | "key": "backuppc.cpool_file_repeat",
118 | "delay": "0",
119 | "history": "7d",
120 | "request_method": "POST",
121 | "tags": [
122 | {
123 | "tag": "Application",
124 | "value": "BackupPC"
125 | }
126 | ]
127 | },
128 | {
129 | "uuid": "d054d159602b403dbf13d50047a19eab",
130 | "name": "BackupPC: Pool File Repeat Max (Compressed)",
131 | "type": "TRAP",
132 | "snmp_oid": "interfaces.ifTable.ifEntry.ifInOctets.1",
133 | "key": "backuppc.cpool_file_repeat_max",
134 | "delay": "0",
135 | "history": "7d",
136 | "request_method": "POST",
137 | "tags": [
138 | {
139 | "tag": "Application",
140 | "value": "BackupPC"
141 | }
142 | ]
143 | },
144 | {
145 | "uuid": "21cebc1156ae40bc885b773d53ec5e9f",
146 | "name": "BackupPC: Pool Size (Compressed)",
147 | "type": "TRAP",
148 | "snmp_oid": "interfaces.ifTable.ifEntry.ifInOctets.1",
149 | "key": "backuppc.cpool_size",
150 | "delay": "0",
151 | "history": "7d",
152 | "units": "B",
153 | "preprocessing": [
154 | {
155 | "type": "MULTIPLIER",
156 | "parameters": [
157 | "1024"
158 | ]
159 | }
160 | ],
161 | "request_method": "POST",
162 | "tags": [
163 | {
164 | "tag": "Application",
165 | "value": "BackupPC"
166 | }
167 | ]
168 | },
169 | {
170 | "uuid": "f27f0c01a3064fa4bebfd7040b64e04f",
171 | "name": "BackupPC: Hosts with full age more than 1 week",
172 | "type": "TRAP",
173 | "key": "backuppc.hosts_full_age_days",
174 | "delay": "0",
175 | "history": "7d",
176 | "trends": "0",
177 | "value_type": "TEXT",
178 | "request_method": "POST",
179 | "tags": [
180 | {
181 | "tag": "Application",
182 | "value": "BackupPC"
183 | }
184 | ],
185 | "triggers": [
186 | {
187 | "uuid": "930bfa04f02c405090a52477eeb2efec",
188 | "expression": "find(/BackupPC/backuppc.hosts_full_age_days,,\"like\",\"NONE\")=0",
189 | "name": "BackupPC: {HOSTNAME} Full backup older than 1 week",
190 | "status": "DISABLED",
191 | "priority": "DISASTER",
192 | "description": "BackupPC has some hosts missing weekly full backup. Please take action to correct."
193 | }
194 | ]
195 | },
196 | {
197 | "uuid": "ebd2c266afa648a2ad9037eac78f0c40",
198 | "name": "BackupPC: Full Backup Count",
199 | "type": "TRAP",
200 | "snmp_oid": "interfaces.ifTable.ifEntry.ifInOctets.1",
201 | "key": "backuppc.hosts_full_count",
202 | "delay": "0",
203 | "history": "7d",
204 | "request_method": "POST",
205 | "tags": [
206 | {
207 | "tag": "Application",
208 | "value": "BackupPC"
209 | }
210 | ]
211 | },
212 | {
213 | "uuid": "e7751fde827a4503881228d539a64638",
214 | "name": "BackupPC: Full Backup Size",
215 | "type": "TRAP",
216 | "key": "backuppc.hosts_full_size",
217 | "delay": "0",
218 | "history": "7d",
219 | "units": "B",
220 | "request_method": "POST",
221 | "tags": [
222 | {
223 | "tag": "Application",
224 | "value": "BackupPC"
225 | }
226 | ]
227 | },
228 | {
229 | "uuid": "161a998c3fd1456da4193062961741f8",
230 | "name": "BackupPC: Average Backup Speed (Full)",
231 | "type": "TRAP",
232 | "snmp_oid": "interfaces.ifTable.ifEntry.ifInOctets.1",
233 | "key": "backuppc.hosts_full_speed",
234 | "delay": "0",
235 | "history": "7d",
236 | "trends": "0",
237 | "value_type": "FLOAT",
238 | "units": "B/sec",
239 | "request_method": "POST",
240 | "tags": [
241 | {
242 | "tag": "Application",
243 | "value": "BackupPC"
244 | }
245 | ]
246 | },
247 | {
248 | "uuid": "6cc5e47fb04c421b8712cb257a40541f",
249 | "name": "BackupPC: Incremental Backup Count",
250 | "type": "TRAP",
251 | "snmp_oid": "interfaces.ifTable.ifEntry.ifInOctets.1",
252 | "key": "backuppc.hosts_incr_count",
253 | "delay": "0",
254 | "history": "7d",
255 | "request_method": "POST",
256 | "tags": [
257 | {
258 | "tag": "Application",
259 | "value": "BackupPC"
260 | }
261 | ]
262 | },
263 | {
264 | "uuid": "5343e1d3512349f39d7172637a11adfb",
265 | "name": "BackupPC: Incremental Backup Size",
266 | "type": "TRAP",
267 | "snmp_oid": "interfaces.ifTable.ifEntry.ifInOctets.1",
268 | "key": "backuppc.hosts_incr_size",
269 | "delay": "0",
270 | "history": "7d",
271 | "units": "B",
272 | "request_method": "POST",
273 | "tags": [
274 | {
275 | "tag": "Application",
276 | "value": "BackupPC"
277 | }
278 | ]
279 | },
280 | {
281 | "uuid": "09c0d12ddb6047c2b123b4357fb40f08",
282 | "name": "BackupPC: Average Backup Speed (Incremental)",
283 | "type": "TRAP",
284 | "snmp_oid": "interfaces.ifTable.ifEntry.ifInOctets.1",
285 | "key": "backuppc.hosts_incr_speed",
286 | "delay": "0",
287 | "history": "7d",
288 | "trends": "0",
289 | "value_type": "FLOAT",
290 | "units": "B/sec",
291 | "request_method": "POST",
292 | "tags": [
293 | {
294 | "tag": "Application",
295 | "value": "BackupPC"
296 | }
297 | ]
298 | },
299 | {
300 | "uuid": "3199c688768d4ed09d9874a686a1ea96",
301 | "name": "BackupPC: Hosts with No backups (2 Days)",
302 | "type": "TRAP",
303 | "key": "backuppc.hosts_nobackup_2",
304 | "delay": "0",
305 | "history": "7d",
306 | "trends": "0",
307 | "value_type": "TEXT",
308 | "request_method": "POST",
309 | "tags": [
310 | {
311 | "tag": "Application",
312 | "value": "BackupPC"
313 | }
314 | ]
315 | },
316 | {
317 | "uuid": "52bb6f79b1c244478870d1f602bdcf79",
318 | "name": "BackupPC: Hosts with No backups (3 Days)",
319 | "type": "TRAP",
320 | "snmp_oid": "interfaces.ifTable.ifEntry.ifInOctets.1",
321 | "key": "backuppc.hosts_nobackup_3",
322 | "delay": "0",
323 | "history": "7d",
324 | "trends": "0",
325 | "value_type": "TEXT",
326 | "units": "uptime",
327 | "request_method": "POST",
328 | "tags": [
329 | {
330 | "tag": "Application",
331 | "value": "BackupPC"
332 | }
333 | ]
334 | },
335 | {
336 | "uuid": "2d91ae6512c94fbe99b4b0cecd959963",
337 | "name": "BackupPC: Hosts with No backups (4 Days)",
338 | "type": "TRAP",
339 | "snmp_oid": "interfaces.ifTable.ifEntry.ifInOctets.1",
340 | "key": "backuppc.hosts_nobackup_4",
341 | "delay": "0",
342 | "history": "7d",
343 | "trends": "0",
344 | "value_type": "TEXT",
345 | "units": "uptime",
346 | "request_method": "POST",
347 | "tags": [
348 | {
349 | "tag": "Application",
350 | "value": "BackupPC"
351 | }
352 | ]
353 | },
354 | {
355 | "uuid": "3b81c57ca42b4a8ebbf01423ac11cd14",
356 | "name": "BackupPC: Hosts with No backups (5 Days)",
357 | "type": "TRAP",
358 | "snmp_oid": "interfaces.ifTable.ifEntry.ifInOctets.1",
359 | "key": "backuppc.hosts_nobackup_5",
360 | "delay": "0",
361 | "history": "7d",
362 | "trends": "0",
363 | "value_type": "TEXT",
364 | "units": "uptime",
365 | "request_method": "POST",
366 | "tags": [
367 | {
368 | "tag": "Application",
369 | "value": "BackupPC"
370 | }
371 | ],
372 | "triggers": [
373 | {
374 | "uuid": "bdd0d9e68b2b409b8067c7fc73dd41a0",
375 | "expression": "find(/BackupPC/backuppc.hosts_nobackup_5,,\"like\",\"NONE\")=0",
376 | "name": "BackupPC: Host without Backups (5 Days)",
377 | "status": "DISABLED",
378 | "priority": "DISASTER",
379 | "description": "There are some hosts that have not been backed up in 5 Days, this should be checked immediately."
380 | }
381 | ]
382 | },
383 | {
384 | "uuid": "d9223ad5b60c442fbe3e5c1289a7c349",
385 | "name": "BackupPC: Jobs (Full Backup)",
386 | "type": "TRAP",
387 | "snmp_oid": "interfaces.ifTable.ifEntry.ifInOctets.1",
388 | "key": "backuppc.jobs_full",
389 | "delay": "0",
390 | "history": "7d",
391 | "request_method": "POST",
392 | "tags": [
393 | {
394 | "tag": "Application",
395 | "value": "BackupPC"
396 | }
397 | ]
398 | },
399 | {
400 | "uuid": "d451de55d0b74e02a0f00d3d11387ae6",
401 | "name": "BackupPC: Jobs (Incremental Backup)",
402 | "type": "TRAP",
403 | "snmp_oid": "interfaces.ifTable.ifEntry.ifInOctets.1",
404 | "key": "backuppc.jobs_incr",
405 | "delay": "0",
406 | "history": "7d",
407 | "request_method": "POST",
408 | "tags": [
409 | {
410 | "tag": "Application",
411 | "value": "BackupPC"
412 | }
413 | ]
414 | },
415 | {
416 | "uuid": "19eac73ca63545d6bed9fa394a2a41a5",
417 | "name": "BackupPC: Jobs (Other Backup)",
418 | "type": "TRAP",
419 | "snmp_oid": "interfaces.ifTable.ifEntry.ifInOctets.1",
420 | "key": "backuppc.jobs_other",
421 | "delay": "0",
422 | "history": "7d",
423 | "request_method": "POST",
424 | "tags": [
425 | {
426 | "tag": "Application",
427 | "value": "BackupPC"
428 | }
429 | ]
430 | },
431 | {
432 | "uuid": "29e339ffcd22492a9a056693a424b92b",
433 | "name": "BackupPC: Pool Directory Count",
434 | "type": "TRAP",
435 | "key": "backuppc.pool_dir_count",
436 | "delay": "0",
437 | "history": "7d",
438 | "request_method": "POST",
439 | "tags": [
440 | {
441 | "tag": "Application",
442 | "value": "BackupPC"
443 | }
444 | ]
445 | },
446 | {
447 | "uuid": "aa4335e69d3c4c068bdeb9e1525be5bd",
448 | "name": "BackupPC: Pool File Count",
449 | "type": "TRAP",
450 | "snmp_oid": "interfaces.ifTable.ifEntry.ifInOctets.1",
451 | "key": "backuppc.pool_file_count",
452 | "delay": "0",
453 | "history": "7d",
454 | "request_method": "POST",
455 | "tags": [
456 | {
457 | "tag": "Application",
458 | "value": "BackupPC"
459 | }
460 | ]
461 | },
462 | {
463 | "uuid": "f921e5dd7edb4730af28e7d0cbc901ec",
464 | "name": "BackupPC: Pool File Max Links",
465 | "type": "TRAP",
466 | "snmp_oid": "interfaces.ifTable.ifEntry.ifInOctets.1",
467 | "key": "backuppc.pool_file_link_max",
468 | "delay": "0",
469 | "history": "7d",
470 | "request_method": "POST",
471 | "tags": [
472 | {
473 | "tag": "Application",
474 | "value": "BackupPC"
475 | }
476 | ]
477 | },
478 | {
479 | "uuid": "dddf80e30bbb420bb51fa517bda36873",
480 | "name": "BackupPC: Pool File Repeat",
481 | "type": "TRAP",
482 | "snmp_oid": "interfaces.ifTable.ifEntry.ifInOctets.1",
483 | "key": "backuppc.pool_file_repeat",
484 | "delay": "0",
485 | "history": "7d",
486 | "request_method": "POST",
487 | "tags": [
488 | {
489 | "tag": "Application",
490 | "value": "BackupPC"
491 | }
492 | ]
493 | },
494 | {
495 | "uuid": "99beaa3f926741f3b97cbe5c3471b7a3",
496 | "name": "BackupPC: Pool File Repeat Max",
497 | "type": "TRAP",
498 | "snmp_oid": "interfaces.ifTable.ifEntry.ifInOctets.1",
499 | "key": "backuppc.pool_file_repeat_max",
500 | "delay": "0",
501 | "history": "7d",
502 | "request_method": "POST",
503 | "tags": [
504 | {
505 | "tag": "Application",
506 | "value": "BackupPC"
507 | }
508 | ]
509 | },
510 | {
511 | "uuid": "c5544fbff39e451099df8ee65d667130",
512 | "name": "BackupPC: Pool Size",
513 | "type": "TRAP",
514 | "snmp_oid": "interfaces.ifTable.ifEntry.ifInOctets.1",
515 | "key": "backuppc.pool_size",
516 | "delay": "0",
517 | "history": "7d",
518 | "units": "kbytes",
519 | "preprocessing": [
520 | {
521 | "type": "MULTIPLIER",
522 | "parameters": [
523 | "1024"
524 | ]
525 | }
526 | ],
527 | "request_method": "POST",
528 | "tags": [
529 | {
530 | "tag": "Application",
531 | "value": "BackupPC"
532 | }
533 | ]
534 | },
535 | {
536 | "uuid": "a5a576618df84afc9c0b23213ac4fb7d",
537 | "name": "BackupPC: Queue (Background)",
538 | "type": "TRAP",
539 | "snmp_oid": "interfaces.ifTable.ifEntry.ifInOctets.1",
540 | "key": "backuppc.queue_background",
541 | "delay": "0",
542 | "history": "7d",
543 | "request_method": "POST",
544 | "tags": [
545 | {
546 | "tag": "Application",
547 | "value": "BackupPC"
548 | }
549 | ]
550 | },
551 | {
552 | "uuid": "c361f6c9069e4e62bdb01f05f3582961",
553 | "name": "BackupPC: Queue (Command)",
554 | "type": "TRAP",
555 | "snmp_oid": "interfaces.ifTable.ifEntry.ifInOctets.1",
556 | "key": "backuppc.queue_command",
557 | "delay": "0",
558 | "history": "7d",
559 | "request_method": "POST",
560 | "tags": [
561 | {
562 | "tag": "Application",
563 | "value": "BackupPC"
564 | }
565 | ]
566 | },
567 | {
568 | "uuid": "58bb110711544f3a92748dbb71024d1c",
569 | "name": "BackupPC: Queue (User)",
570 | "type": "TRAP",
571 | "snmp_oid": "interfaces.ifTable.ifEntry.ifInOctets.1",
572 | "key": "backuppc.queue_user",
573 | "delay": "0",
574 | "history": "7d",
575 | "request_method": "POST",
576 | "tags": [
577 | {
578 | "tag": "Application",
579 | "value": "BackupPC"
580 | }
581 | ]
582 | },
583 | {
584 | "uuid": "2a0683c1ac784b68a1fd76861a6917c2",
585 | "name": "BackupPC: Uptime",
586 | "type": "TRAP",
587 | "snmp_oid": "interfaces.ifTable.ifEntry.ifInOctets.1",
588 | "key": "backuppc.uptime",
589 | "delay": "0",
590 | "history": "7d",
591 | "units": "uptime",
592 | "request_method": "POST",
593 | "tags": [
594 | {
595 | "tag": "Application",
596 | "value": "BackupPC"
597 | }
598 | ]
599 | },
600 | {
601 | "uuid": "d203783ea4454c23b85a5f1221bc3eb8",
602 | "name": "BackupPC: Version",
603 | "type": "TRAP",
604 | "snmp_oid": "interfaces.ifTable.ifEntry.ifInOctets.1",
605 | "key": "backuppc.version",
606 | "delay": "0",
607 | "history": "7d",
608 | "trends": "0",
609 | "value_type": "TEXT",
610 | "units": "uptime",
611 | "request_method": "POST",
612 | "tags": [
613 | {
614 | "tag": "Application",
615 | "value": "BackupPC"
616 | }
617 | ]
618 | },
619 | {
620 | "uuid": "40ffe725f6224b18a90076306f92f0a0",
621 | "name": "BackupPC: Memory Usage",
622 | "type": "ZABBIX_ACTIVE",
623 | "key": "proc.mem[,backuppc]",
624 | "history": "7d",
625 | "value_type": "FLOAT",
626 | "units": "B",
627 | "request_method": "POST",
628 | "tags": [
629 | {
630 | "tag": "Application",
631 | "value": "BackupPC"
632 | }
633 | ]
634 | },
635 | {
636 | "uuid": "51d8e48a7e544950a688407324996191",
637 | "name": "BackupPC: BackupPC Process",
638 | "type": "ZABBIX_ACTIVE",
639 | "key": "proc.num[BackupPC]",
640 | "history": "7d",
641 | "request_method": "POST",
642 | "tags": [
643 | {
644 | "tag": "Application",
645 | "value": "BackupPC"
646 | }
647 | ],
648 | "triggers": [
649 | {
650 | "uuid": "da2dde44285e4dadb5a5fd860b5a95e9",
651 | "expression": "sum(/BackupPC/proc.num[BackupPC],#3)=0",
652 | "name": "BackupPC not running",
653 | "priority": "DISASTER",
654 | "description": "The BackupPC process it not running, try restarting the service."
655 | }
656 | ]
657 | },
658 | {
659 | "uuid": "686260b55fd1482bb29e746270e768a9",
660 | "name": "BackupPC: BackupPC_dump Process",
661 | "type": "ZABBIX_ACTIVE",
662 | "key": "proc.num[BackupPC_dump]",
663 | "history": "7d",
664 | "request_method": "POST",
665 | "tags": [
666 | {
667 | "tag": "Application",
668 | "value": "BackupPC"
669 | }
670 | ]
671 | },
672 | {
673 | "uuid": "8b32702e514342489fd18da97b7f40d0",
674 | "name": "BackupPC: BackupPC_link Process",
675 | "type": "ZABBIX_ACTIVE",
676 | "key": "proc.num[BackupPC_link]",
677 | "history": "7d",
678 | "request_method": "POST",
679 | "tags": [
680 | {
681 | "tag": "Application",
682 | "value": "BackupPC"
683 | }
684 | ]
685 | },
686 | {
687 | "uuid": "ef94514c702b4801a8d15db61bf8c37f",
688 | "name": "BackupPC: BackupPC_nightly Process",
689 | "type": "ZABBIX_ACTIVE",
690 | "key": "system.run[\"ps waux | grep BackupPC_nightly | grep -v grep | wc -l\"]",
691 | "history": "7d",
692 | "request_method": "POST",
693 | "tags": [
694 | {
695 | "tag": "Application",
696 | "value": "BackupPC"
697 | }
698 | ]
699 | }
700 | ],
701 | "discovery_rules": [
702 | {
703 | "uuid": "df1222b35c3b4d448a78397e66f8793d",
704 | "name": "Discover backup hosts",
705 | "type": "ZABBIX_ACTIVE",
706 | "key": "backuppc.discover",
707 | "filter": {
708 | "conditions": [
709 | {
710 | "macro": "{#BACKUPHOST}",
711 | "value": ".*",
712 | "formulaid": "A"
713 | }
714 | ]
715 | },
716 | "item_prototypes": [
717 | {
718 | "uuid": "d26cf6e75d3e4861955e746d4b377d18",
719 | "name": "{#BACKUPHOST} full backup age",
720 | "type": "TRAP",
721 | "key": "backuppc.fullage[{#BACKUPHOST}]",
722 | "delay": "0",
723 | "value_type": "FLOAT",
724 | "units": "days",
725 | "request_method": "POST",
726 | "tags": [
727 | {
728 | "tag": "Application",
729 | "value": "BackupPC: backups"
730 | }
731 | ]
732 | },
733 | {
734 | "uuid": "b6d85539ba004653b6f74fd1f4793939",
735 | "name": "{#BACKUPHOST} full backup BadFile",
736 | "type": "TRAP",
737 | "key": "backuppc.fullbadfile[{#BACKUPHOST}]",
738 | "delay": "0",
739 | "value_type": "FLOAT",
740 | "units": "p",
741 | "request_method": "POST",
742 | "tags": [
743 | {
744 | "tag": "Application",
745 | "value": "BackupPC: backups"
746 | }
747 | ],
748 | "trigger_prototypes": [
749 | {
750 | "uuid": "d7d79d12021346e0a2d3c88d14bd4be2",
751 | "expression": "last(/BackupPC/backuppc.fullbadfile[{#BACKUPHOST}])>0",
752 | "name": "{#BACKUPHOST} has bad file in full backup",
753 | "priority": "WARNING"
754 | }
755 | ]
756 | },
757 | {
758 | "uuid": "3c305ec30b8e4297be9502c21bfec3d3",
759 | "name": "{#BACKUPHOST} full backup BadShare",
760 | "type": "TRAP",
761 | "key": "backuppc.fullbadshare[{#BACKUPHOST}]",
762 | "delay": "0",
763 | "value_type": "FLOAT",
764 | "units": "p",
765 | "request_method": "POST",
766 | "tags": [
767 | {
768 | "tag": "Application",
769 | "value": "BackupPC: backups"
770 | }
771 | ],
772 | "trigger_prototypes": [
773 | {
774 | "uuid": "9bf9677cad114965b6b1e3434aad8e1e",
775 | "expression": "last(/BackupPC/backuppc.fullbadshare[{#BACKUPHOST}])>0",
776 | "name": "{#BACKUPHOST} has bad share in full backup",
777 | "priority": "WARNING"
778 | }
779 | ]
780 | },
781 | {
782 | "uuid": "b8d87ef243744f638eae8242e085d2e1",
783 | "name": "{#BACKUPHOST} full backup duration",
784 | "type": "TRAP",
785 | "key": "backuppc.fulldur[{#BACKUPHOST}]",
786 | "delay": "0",
787 | "value_type": "FLOAT",
788 | "units": "s",
789 | "request_method": "POST",
790 | "tags": [
791 | {
792 | "tag": "Application",
793 | "value": "BackupPC: backups"
794 | }
795 | ]
796 | },
797 | {
798 | "uuid": "d6cade5727034ed88f20df869652d34a",
799 | "name": "{#BACKUPHOST} full backup xfer errors",
800 | "type": "TRAP",
801 | "key": "backuppc.fullerrs[{#BACKUPHOST}]",
802 | "delay": "0",
803 | "value_type": "FLOAT",
804 | "units": "p",
805 | "request_method": "POST",
806 | "tags": [
807 | {
808 | "tag": "Application",
809 | "value": "BackupPC: backups"
810 | }
811 | ],
812 | "trigger_prototypes": [
813 | {
814 | "uuid": "a4d67609d3494652a410a7117f9059ea",
815 | "expression": "last(/BackupPC/backuppc.fullerrs[{#BACKUPHOST}])>0",
816 | "name": "{#BACKUPHOST} has error in full backup",
817 | "priority": "AVERAGE",
818 | "manual_close": "YES"
819 | }
820 | ]
821 | },
822 | {
823 | "uuid": "0391d93c4ce441c48e19ce8ec196fdca",
824 | "name": "{#BACKUPHOST} full backup size",
825 | "type": "TRAP",
826 | "key": "backuppc.fullsize[{#BACKUPHOST}]",
827 | "delay": "0",
828 | "value_type": "FLOAT",
829 | "units": "byte",
830 | "request_method": "POST",
831 | "tags": [
832 | {
833 | "tag": "Application",
834 | "value": "BackupPC: backups"
835 | }
836 | ]
837 | },
838 | {
839 | "uuid": "5cb059061812482ea40d6eff5bd66c57",
840 | "name": "{#BACKUPHOST} full backup tar errors",
841 | "type": "TRAP",
842 | "key": "backuppc.fulltarerrs[{#BACKUPHOST}]",
843 | "delay": "0",
844 | "value_type": "FLOAT",
845 | "units": "p",
846 | "request_method": "POST",
847 | "tags": [
848 | {
849 | "tag": "Application",
850 | "value": "BackupPC: backups"
851 | }
852 | ],
853 | "trigger_prototypes": [
854 | {
855 | "uuid": "962bd9c4a0ee40cab40ba32db2a504a1",
856 | "expression": "last(/BackupPC/backuppc.fulltarerrs[{#BACKUPHOST}])>0",
857 | "name": "{#BACKUPHOST} has tar error in full backup",
858 | "priority": "WARNING",
859 | "manual_close": "YES"
860 | }
861 | ]
862 | },
863 | {
864 | "uuid": "d98d067597f9427ca583babc544b6c34",
865 | "name": "{#BACKUPHOST} incremental backup age",
866 | "type": "TRAP",
867 | "key": "backuppc.incrage[{#BACKUPHOST}]",
868 | "delay": "0",
869 | "value_type": "FLOAT",
870 | "units": "days",
871 | "request_method": "POST",
872 | "tags": [
873 | {
874 | "tag": "Application",
875 | "value": "BackupPC: backups"
876 | }
877 | ]
878 | },
879 | {
880 | "uuid": "d38028af4da445e3a6cf2708f4ccb2d1",
881 | "name": "{#BACKUPHOST} incremental backup BadFile",
882 | "type": "TRAP",
883 | "key": "backuppc.incrbadfile[{#BACKUPHOST}]",
884 | "delay": "0",
885 | "value_type": "FLOAT",
886 | "units": "p",
887 | "request_method": "POST",
888 | "tags": [
889 | {
890 | "tag": "Application",
891 | "value": "BackupPC: backups"
892 | }
893 | ],
894 | "trigger_prototypes": [
895 | {
896 | "uuid": "6f15c931040a4c2a9b181b051008246e",
897 | "expression": "last(/BackupPC/backuppc.incrbadfile[{#BACKUPHOST}])>0",
898 | "name": "{#BACKUPHOST} has bad file in incremental backup",
899 | "priority": "WARNING"
900 | }
901 | ]
902 | },
903 | {
904 | "uuid": "8ec151ac333741eabc77aa86f2057a27",
905 | "name": "{#BACKUPHOST} incremental backup BadShare",
906 | "type": "TRAP",
907 | "key": "backuppc.incrbadshare[{#BACKUPHOST}]",
908 | "delay": "0",
909 | "value_type": "FLOAT",
910 | "units": "p",
911 | "request_method": "POST",
912 | "tags": [
913 | {
914 | "tag": "Application",
915 | "value": "BackupPC: backups"
916 | }
917 | ],
918 | "trigger_prototypes": [
919 | {
920 | "uuid": "66e2c640252c4de7a274d3252341c7a8",
921 | "expression": "last(/BackupPC/backuppc.incrbadshare[{#BACKUPHOST}])>0",
922 | "name": "{#BACKUPHOST} has bad share in incremental backup",
923 | "priority": "WARNING"
924 | }
925 | ]
926 | },
927 | {
928 | "uuid": "6f86f53375cd43d4b469a5cbfc006672",
929 | "name": "{#BACKUPHOST} incremental backup duration",
930 | "type": "TRAP",
931 | "key": "backuppc.incrdur[{#BACKUPHOST}]",
932 | "delay": "0",
933 | "value_type": "FLOAT",
934 | "units": "s",
935 | "request_method": "POST",
936 | "tags": [
937 | {
938 | "tag": "Application",
939 | "value": "BackupPC: backups"
940 | }
941 | ]
942 | },
943 | {
944 | "uuid": "1e553fc1d87b47d1a3c6c5359a185194",
945 | "name": "{#BACKUPHOST} incremental backup xfer errors",
946 | "type": "TRAP",
947 | "key": "backuppc.increrrs[{#BACKUPHOST}]",
948 | "delay": "0",
949 | "value_type": "FLOAT",
950 | "units": "p",
951 | "request_method": "POST",
952 | "tags": [
953 | {
954 | "tag": "Application",
955 | "value": "BackupPC: backups"
956 | }
957 | ],
958 | "trigger_prototypes": [
959 | {
960 | "uuid": "9bd5ba1b5d35498f93c3ca67cc4ed0d1",
961 | "expression": "last(/BackupPC/backuppc.increrrs[{#BACKUPHOST}])>0",
962 | "name": "{#BACKUPHOST} has error in incremental backup",
963 | "priority": "AVERAGE",
964 | "manual_close": "YES"
965 | }
966 | ]
967 | },
968 | {
969 | "uuid": "5b1b9253fae44d3b962e5df62cd18529",
970 | "name": "{#BACKUPHOST} incremental backup size",
971 | "type": "TRAP",
972 | "key": "backuppc.incrsize[{#BACKUPHOST}]",
973 | "delay": "0",
974 | "value_type": "FLOAT",
975 | "units": "byte",
976 | "request_method": "POST",
977 | "tags": [
978 | {
979 | "tag": "Application",
980 | "value": "BackupPC: backups"
981 | }
982 | ]
983 | },
984 | {
985 | "uuid": "e0c43afcd31246498dd3a3b870da9cb1",
986 | "name": "{#BACKUPHOST} incremental backup tar errors",
987 | "type": "TRAP",
988 | "key": "backuppc.incrtarerrs[{#BACKUPHOST}]",
989 | "delay": "0",
990 | "value_type": "FLOAT",
991 | "units": "p",
992 | "request_method": "POST",
993 | "tags": [
994 | {
995 | "tag": "Application",
996 | "value": "BackupPC: backups"
997 | }
998 | ],
999 | "trigger_prototypes": [
1000 | {
1001 | "uuid": "f140c5fdf87642e1aa1389fda434d356",
1002 | "expression": "last(/BackupPC/backuppc.incrtarerrs[{#BACKUPHOST}])>0",
1003 | "name": "{#BACKUPHOST} has tar error in incremental backup",
1004 | "priority": "WARNING",
1005 | "manual_close": "YES"
1006 | }
1007 | ]
1008 | }
1009 | ],
1010 | "request_method": "POST"
1011 | }
1012 | ]
1013 | }
1014 | ],
1015 | "triggers": [
1016 | {
1017 | "uuid": "419d852cf0c24f659f73f2ee7df7a420",
1018 | "expression": "find(/BackupPC/backuppc.hosts_nobackup_2,,\"like\",\"NONE\")=0 and find(/BackupPC/backuppc.hosts_nobackup_3,,\"like\",\"NONE\")<>0 and find(/BackupPC/backuppc.hosts_nobackup_4,,\"like\",\"NONE\")<>0 and find(/BackupPC/backuppc.hosts_nobackup_5,,\"like\",\"NONE\")<>0",
1019 | "name": "BackupPC: Host without Backups (2 Days)",
1020 | "priority": "INFO",
1021 | "description": "There are some hosts that have not been backed up in 2 Days, while this is not a problem it should be monitored."
1022 | },
1023 | {
1024 | "uuid": "0a7d9b4abf8e4f719a4003523480deb4",
1025 | "expression": "find(/BackupPC/backuppc.hosts_nobackup_3,,\"like\",\"NONE\")=0 and find(/BackupPC/backuppc.hosts_nobackup_4,,\"like\",\"NONE\")<>0 and find(/BackupPC/backuppc.hosts_nobackup_5,,\"like\",\"NONE\")<>0",
1026 | "name": "BackupPC: Host without Backups (3 Days)",
1027 | "status": "DISABLED",
1028 | "priority": "DISASTER",
1029 | "description": "There are some hosts that have not been backed up in 3 Days, this should be checked soon."
1030 | },
1031 | {
1032 | "uuid": "0d8d326623bb4efa9cf015359f716168",
1033 | "expression": "find(/BackupPC/backuppc.hosts_nobackup_4,,\"like\",\"NONE\")=0 and find(/BackupPC/backuppc.hosts_nobackup_5,,\"like\",\"NONE\")<>0",
1034 | "name": "BackupPC: Host without Backups (4 Days)",
1035 | "status": "DISABLED",
1036 | "priority": "DISASTER",
1037 | "description": "There are some hosts that have not been backed up in 4 Days, this should be checked immediately."
1038 | }
1039 | ]
1040 | }
1041 | }
--------------------------------------------------------------------------------