diff --git a/check_clientbackup b/check_clientbackup index 6a323a2a0dc068c9123f1b9b00a632529981091d..924c384c66033b94e098e59ac1ac165913987fce 100755 --- a/check_clientbackup +++ b/check_clientbackup @@ -16,16 +16,60 @@ # 2022-08-10 v1.9 <axel.hahn@iml.unibe.ch> FIX: mask the dot in .log # 2022-10-21 v1.10 <axel.hahn@unibe.ch> remove grep: warning: stray \ before white space # show last backup, prune, verify +# 2023-06-22 v1.11 <axel.hahn@unibe.ch> add help and param support; add parameter for install directory # ====================================================================== . $( dirname $0 )/inc_pluginfunctions +self_APPNAME=$( basename $0 | tr [:lower:] [:upper:] ) +self_APPVERSION=1.11 + sInstalldir=/opt/imlbackup/client/ -sChecker=$sInstalldir/check_clientbackup.sh +# ---------------------------------------------------------------------- +# FUNCTIONS +# ---------------------------------------------------------------------- + +function showHelp(){ + _self=$(basename $0) +cat <<EOF +______________________________________________________________________ + +$self_APPNAME +v$self_APPVERSION + +(c) Institute for Medical Education - University of Bern +Licence: GNU GPL 3 +______________________________________________________________________ + +Show status of IML backup. + +SYNTAX: +$_self [-d DIRECTORY] + +OPTIONS: + -h or --help show this help. + -d or --dir set installation dir of iml backup to find its check skript + default: /opt/imlbackup/client/ + +EXAMPLE: +$_self -d /home/backup/imlbackup + set a custom directory und run the backup check + +EOF +} + +# --- check param -h +while [[ "$#" -gt 0 ]]; do case $1 in + -h|--help) showHelp; exit 0;; + -d|--dir) sInstalldir=$2; shift ;shift;; + *) echo "ERROR: Unknown parameter: $1"; showHelp; exit 1; +esac; done + +sChecker=$sInstalldir/check_clientbackup.sh if [ ! -x $sChecker ]; then - ph.abort "$sChecker not found - maybe clientbackup is not installed." + ph.abort "$sChecker not found - maybe clientbackup is not installed here. Use param -d to set the install directory." fi result=$( $sChecker ) diff --git a/docs/20_Checks/_index.md b/docs/20_Checks/_index.md index aa243fb34e2ba46faf1b647e6b855bdd81ebbef9..67f1e67e894c253207397cb4c10f56be470a73df 100644 --- a/docs/20_Checks/_index.md +++ b/docs/20_Checks/_index.md @@ -13,7 +13,7 @@ There is one include script used by all checks: * [check_ceph_io](check_ceph_io.md) * [check_ceph_osd](check_ceph_osd.md) * [check_ceph_status](check_ceph_status.md) -* check_clientbackup +* [check_clientbackup](check_clientbackup.md) * check_couchdb-lb * [check_cpu](check_cpu.md) * [check_cronstatus](check_cronstatus.md) diff --git a/docs/20_Checks/check_ceph_diskfree.md b/docs/20_Checks/check_ceph_diskfree.md index 3b45879977102c874241bc17efe5707f52ae255e..3686600f11576603cce74698c5172cb7b39232c9 100644 --- a/docs/20_Checks/check_ceph_diskfree.md +++ b/docs/20_Checks/check_ceph_diskfree.md @@ -20,7 +20,7 @@ $ check_ceph_diskfree -h ______________________________________________________________________ CHECK_CEPH_DISKFREE -v1.3 +v1.4 (c) Institute for Medical Education - University of Bern Licence: GNU GPL 3 @@ -47,18 +47,16 @@ OPTIONS: `$ check_ceph_diskfree` returns ```txt -check_ceph_diskfree OK: Disksize on Ceph cluster and its pools - warnings: 0 (70 %) .. critcal: 0 (90 %) --- RAW STORAGE --- CLASS SIZE AVAIL USED RAW USED %RAW USED -OK ssd 54 TiB 53 TiB 767 GiB 767 GiB 1.40 -OK TOTAL 54 TiB 53 TiB 767 GiB 767 GiB 1.40 +OK ssd 54 TiB 47 TiB 7.0 TiB 7.0 TiB 13.12 +OK TOTAL 54 TiB 47 TiB 7.0 TiB 7.0 TiB 13.12 --- POOLS --- POOL ID PGS STORED OBJECTS USED %USED MAX AVAIL -OK .mgr 1 1 18 MiB 6 18 MiB 0 16 TiB -OK one 2 32 255 GiB 66.65k 255 GiB 0.50 16 TiB -OK two 3 32 0 B 0 0 B 0 25 TiB - |global-total=59373627899904;;;0;59373627899904 global-avail=58274116272128;;;0;59373627899904 global-used=823559979008;;;0;59373627899904 +OK .mgr 1 1 104 MiB 27 311 MiB 0 14 TiB +OK one 2 128 2.3 TiB 617.97k 7.0 TiB 14.48 14 TiB + |global-total=59373627899904;;;0;59373627899904 global-avail=51677046505472;;;0;59373627899904 global-used=7696581394432;;;0;59373627899904 ``` diff --git a/docs/20_Checks/check_ceph_status.md b/docs/20_Checks/check_ceph_status.md index 47885682e87616f4b2c00df59473014f64e2bbb5..65ad237cf39ce8ff9e714deae7c5fb27bd8d2d95 100644 --- a/docs/20_Checks/check_ceph_status.md +++ b/docs/20_Checks/check_ceph_status.md @@ -2,7 +2,7 @@ ## Introduction -**check_ceph_sttaus** is a plugin to show ceph status. +**check_ceph_status** is a plugin to show ceph status. It switches the state in dependency of the HEALTH_* value. ## Requirements @@ -14,7 +14,7 @@ It switches the state in dependency of the HEALTH_* value. ```txt ______________________________________________________________________ -DEV_CHECK_CEPH_STATUS +CHECK_CEPH_STATUS v1.5 (c) Institute for Medical Education - University of Bern diff --git a/docs/20_Checks/check_client_backup.md b/docs/20_Checks/check_client_backup.md new file mode 100644 index 0000000000000000000000000000000000000000..df31899269becbdcbbbbeecb2450464da6b9c019 --- /dev/null +++ b/docs/20_Checks/check_client_backup.md @@ -0,0 +1,67 @@ +# Check Client backup + +## Introduction + +**check_client_backup** is a plugin to show the backup status of IML Backup. + +📄 Source: https://git-repo.iml.unibe.ch/iml-open-source/iml-backup/ +📜 License: GNU GPL 3.0 +📖 Docs: see docs folder or online https://os-docs.iml.unibe.ch/iml-backup/ + +## Requirements + +* `IML Backup` must be installed. + +## Syntax + +```txt +./check_clientbackup -h +______________________________________________________________________ + +CHECK_CLIENTBACKUP +v1.11 + +(c) Institute for Medical Education - University of Bern +Licence: GNU GPL 3 +______________________________________________________________________ + +Show status of IML backup. +See https://os-docs.iml.unibe.ch/iml-backup/ + +It returns with state UNKNOWN if no backup has been performed yet. +It switches to ERROR an error occured during backup process. + +SYNTAX: +check_clientbackup [-d DIRECTORY] + +OPTIONS: + -h or --help show this help. + -d or --dir set installation dir of iml backup to find its check skript + default: /opt/imlbackup/client/ + +EXAMPLE: +check_clientbackup -d /home/backup/imlbackup + set a custom directory und run the backup check + +``` + +## Examples + +`$ ./check_clientbackup -d ~/skripte/iml-backup/client/` returns + +```txt +OK Client Backup - WITH transfer - last backup log: auto-20230622-091201.log (1 h ago) OK: backup is younger than 24 hours - OK: 10 ... Errors: 0 + +--- transfer: +__REPO__ OK, Backup repository already exists. +__BACKUP__ OK - DIR /var/localdumps/backup +__BACKUP__ OK - DIR /boot +__BACKUP__ OK - DIR /etc +__BACKUP__ OK - DIR /home + +__LAST__backup 1 h ago +__LAST__prune 3 days ago +__LAST__verify 1 days ago +``` + +If you have a database service (Mysql/ MariaD, Postgres, ...) you will get a list of dumped databases.