Skip to content
Snippets Groups Projects
Commit 528c306a authored by Hahn Axel (hahn)'s avatar Hahn Axel (hahn)
Browse files

update iml_backup_server

parent bd603a44
Branches
No related tags found
1 merge request!2236908 check rearbackup
......@@ -10,11 +10,12 @@
# 2020-07-27 v0.x <axel.hahn@iml.unibe.ch>
# 2023-12-20 v0.2 <axel.hahn@iml.unibe.ch>
# 2023-12-21 v1.0 <axel.hahn@iml.unibe.ch> first version
# 2023-12-21 v1.1 <axel.hahn@iml.unibe.ch> Update help text
# ======================================================================
. $(dirname $0)/inc_pluginfunctions
export self_APPVERSION=1.0
export self_APPVERSION=1.1
sInstalldir=/opt/imlbackup/server
sScript=storage_helper.sh
......@@ -24,6 +25,7 @@ sMode=
# FUNCTIONS
# ----------------------------------------------------------------------
# show help
function showHelp(){
local _self; _self=$(basename $0)
cat <<EOF
......@@ -35,33 +37,48 @@ You can get the count of connections or the status of server backup.
See https://os-docs.iml.unibe.ch/iml-backup-server/
SYNTAX:
$_self [-d DIRECTORY] -m MODE
OPTIONS:
-h or --help show this help.
-d or --dir set installation dir of iml deployment to find its check skript
-h, --help
show this help.
-d, --dir PATH
set installation dir of iml deployment to find its check skript
default dir: ${sInstalldir}
script: ${sInstalldir}/${sScript}
-m or --mode mode: set type of result; one of status|backupstatus
-m, --mode MODE
mode: set type of result; one of status|backupstatus
backupstatus status of backup sets of all servers
status count of connected servers
EXAMPLE:
$_self -m status
$_self -m backupstatus
EOF
}
# get all server entries with a given status
# param string status character in 1st column; one of .|?|D|E
# param string text to parse
function _getServerOfStatus(){
local _key="$1"
local _data="$2"
grep "$_key .*| [0-9].* |" <<< "$_data"
}
# get count of servers with a given status
# param string status character in 1st column; one of .|?|D|E
# param string text to parse
function _getStatusCount(){
_getServerOfStatus "$1" "$2" | wc -l
}
# ----------------------------------------------------------------------
# MAIN
# ----------------------------------------------------------------------
......
......@@ -26,7 +26,7 @@ uid=1041(icingaclient) gid=1041(icingaclient) groups=1041(icingaclient),1031(iml
______________________________________________________________________
CHECK_IML_BACKUP_SERVER
v1.0
v1.1
(c) Institute for Medical Education - University of Bern
Licence: GNU GPL 3
......@@ -40,18 +40,26 @@ You can get the count of connections or the status of server backup.
See https://os-docs.iml.unibe.ch/iml-backup-server/
SYNTAX:
check_iml_backup_server [-d DIRECTORY] -m MODE
OPTIONS:
-h or --help show this help.
-d or --dir set installation dir of iml deployment to find its check skript
-h, --help
show this help.
-d, --dir PATH
set installation dir of iml deployment to find its check skript
default dir: /opt/imlbackup/server
script: /opt/imlbackup/server/storage_helper.sh
-m or --mode mode: set type of result; one of status|backupstatus
-m, --mode MODE
mode: set type of result; one of status|backupstatus
backupstatus status of backup sets of all servers
status count of connected servers
EXAMPLE:
check_iml_backup_server -m status
check_iml_backup_server -m backupstatus
......@@ -61,9 +69,6 @@ check_iml_backup_server -m backupstatus
### Backup server status
``check_http -u https://www.example.com/`` is a check that makes an http GET request.
The queck is OK if the responded status code is no error - if it is 2xx (OK) or a redirect (3xx).
```txt
# ./check_iml_backup_server -m backupstatus
OK: Server Backups - 36 servers in backup - 0 errors - 7 disbled - 0 running
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment