Code Monkey home page Code Monkey logo

zabbix-template-rescript's Introduction

Zabbix Template: Rescript Restic Backup

This script logs restic backup tasks to Zabbix, when using the rescript wrapper. It's capable of logging various output values of backup, check and forget & prune tasks.

Screenshots

Latest Data

Latest Data

Triggers

Triggers

Requirements

  • Restic
  • Rescript
  • Zabbix-Sender
  • python3
  • python3-pip
  • python3: humanfriendly

How to Use

  1. Download log-rescript.sh and rescript-repo-discovery.pl to /etc/zabbix/scripts/
mkdir -p /etc/zabbix/scripts
cd /etc/zabbix/scripts
curl -O https://raw.githubusercontent.com/sebastian13/zabbix-template-rescript/master/scripts/log-rescript.sh
curl -O https://github.com/sebastian13/zabbix-template-rescript/blob/master/scripts/rescript-repo-discovery.pl
chmod +x log-rescript.sh rescript-repo-discovery.pl
  1. Upload the template zbx_template_rescript-backup to Zabbix Server and assign it to a host

  2. Run the script after each rescript call

Examples

  • As simple as

     rescript reponame && /etc/zabbix/scripts/log-rescript.sh
  • Running as cronjob, I'm reccomending using chronic from moreutils

     26 3 * * * chronic rescript reponame && chronic /etc/zabbix/scripts/log-rescript.sh
  • Within a script

     #!/bin/bash
     
     set -e
     
     # Rescript's automatic function (https://gitlab.com/sulfuror/rescript.sh/wikis/usage)
     # reads the "LOGGING" variable. By default, the "LOGGING" variable is set to "yes".
     # This will create a log file with the output, which is necessary for this script.
     rescript example.repo.1
     # Run this script after each "rescript ..." call.
     source /etc/zabbix/scripts/log-rescript.sh
     
     # If using a rescript command, you have to use the logging flag -l or --log
     # to create a logfile, which is necessary fort his script.
     # -l, --log: create log file with command output.
     rescript example.repo.2 backup -l
     source /etc/zabbix/scripts/log-rescript.sh
     
     # This script will also log the output of a restic check.
     # -C, --check: check for errors in repository
     rescript example.repo.2 backup -lC
     source /etc/zabbix/scripts/log-rescript.sh
     

Adjust Triggers

  • A notification will be sent, if no snapshot id is received for >52h. The macro {$TRIGGER_NOBACKUPTIME} can be changed to any other timeframe. {$TRIGGER_NOBACKUPTIME_LVM} if using LVM Backup.

Rescript LVM Backup Monitoring

This template also enables monitoring of LVM backups via restic and rescript. Take a look at the lvm-restic-backup script for detailed instructions.

zabbix-template-rescript's People

Contributors

sebastian13 avatar

Stargazers

 avatar

Watchers

 avatar  avatar

zabbix-template-rescript's Issues

issue with tokenized

Hi
Currently having an issue sending the info to zabbix getting this error

image

Thank you

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.