mirror of
https://github.com/munin-monitoring/contrib.git
synced 2025-07-21 18:41:03 +00:00
General purpose backup monitoring plugin
If you have a directory where daily, weekly, monthly you generate backups of files, SQL databases, etc, you might want to be informed if the backup generation process is gone or the behavior changes greatly. This monitoring plugin watches the number of young files in a certain directory. Relies on find command to do the job.
This commit is contained in:
parent
275ec0ed66
commit
6e714d7286
1 changed files with 22 additions and 0 deletions
22
plugins/backup/backup.sh
Executable file
22
plugins/backup/backup.sh
Executable file
|
@ -0,0 +1,22 @@
|
|||
#!/bin/sh
|
||||
|
||||
# Configuration directives, edit before first use.
|
||||
BACKUP_DIR=/path/to/your/backups
|
||||
# How old backups should be considered as non-yound anymore in [days].
|
||||
LIFETIME=2
|
||||
|
||||
# The situation is critical if there are no young files, the backup is down.
|
||||
case $1 in
|
||||
config)
|
||||
cat <<'EOM'
|
||||
graph_title Number of young files at backup directory
|
||||
graph_vlabel number
|
||||
autobackup.label number
|
||||
autobackup.critical 1:
|
||||
EOM
|
||||
exit 0;;
|
||||
esac
|
||||
|
||||
printf "autobackup.value "
|
||||
find $BACKUP_DIR -mtime -$LIFETIME | wc -l
|
||||
|
Loading…
Add table
Add a link
Reference in a new issue