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 @@ ...@@ -10,11 +10,12 @@
# 2020-07-27 v0.x <axel.hahn@iml.unibe.ch> # 2020-07-27 v0.x <axel.hahn@iml.unibe.ch>
# 2023-12-20 v0.2 <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.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 . $(dirname $0)/inc_pluginfunctions
export self_APPVERSION=1.0 export self_APPVERSION=1.1
sInstalldir=/opt/imlbackup/server sInstalldir=/opt/imlbackup/server
sScript=storage_helper.sh sScript=storage_helper.sh
...@@ -24,6 +25,7 @@ sMode= ...@@ -24,6 +25,7 @@ sMode=
# FUNCTIONS # FUNCTIONS
# ---------------------------------------------------------------------- # ----------------------------------------------------------------------
# show help
function showHelp(){ function showHelp(){
local _self; _self=$(basename $0) local _self; _self=$(basename $0)
cat <<EOF cat <<EOF
...@@ -35,33 +37,48 @@ You can get the count of connections or the status of server backup. ...@@ -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/ See https://os-docs.iml.unibe.ch/iml-backup-server/
SYNTAX: SYNTAX:
$_self [-d DIRECTORY] -m MODE
$_self [-d DIRECTORY] -m MODE
OPTIONS: OPTIONS:
-h or --help show this help.
-d or --dir set installation dir of iml deployment to find its check skript -h, --help
default dir: ${sInstalldir} show this help.
script: ${sInstalldir}/${sScript}
-m or --mode mode: set type of result; one of status|backupstatus -d, --dir PATH
backupstatus status of backup sets of all servers set installation dir of iml deployment to find its check skript
status count of connected servers default dir: ${sInstalldir}
script: ${sInstalldir}/${sScript}
-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: EXAMPLE:
$_self -m status
$_self -m backupstatus $_self -m status
$_self -m backupstatus
EOF 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(){ function _getServerOfStatus(){
local _key="$1" local _key="$1"
local _data="$2" local _data="$2"
grep "$_key .*| [0-9].* |" <<< "$_data" 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(){ function _getStatusCount(){
_getServerOfStatus "$1" "$2" | wc -l _getServerOfStatus "$1" "$2" | wc -l
} }
# ---------------------------------------------------------------------- # ----------------------------------------------------------------------
# MAIN # MAIN
# ---------------------------------------------------------------------- # ----------------------------------------------------------------------
......
...@@ -26,7 +26,7 @@ uid=1041(icingaclient) gid=1041(icingaclient) groups=1041(icingaclient),1031(iml ...@@ -26,7 +26,7 @@ uid=1041(icingaclient) gid=1041(icingaclient) groups=1041(icingaclient),1031(iml
______________________________________________________________________ ______________________________________________________________________
CHECK_IML_BACKUP_SERVER CHECK_IML_BACKUP_SERVER
v1.0 v1.1
(c) Institute for Medical Education - University of Bern (c) Institute for Medical Education - University of Bern
Licence: GNU GPL 3 Licence: GNU GPL 3
...@@ -40,20 +40,28 @@ You can get the count of connections or the status of server backup. ...@@ -40,20 +40,28 @@ You can get the count of connections or the status of server backup.
See https://os-docs.iml.unibe.ch/iml-backup-server/ See https://os-docs.iml.unibe.ch/iml-backup-server/
SYNTAX: SYNTAX:
check_iml_backup_server [-d DIRECTORY] -m MODE
check_iml_backup_server [-d DIRECTORY] -m MODE
OPTIONS: OPTIONS:
-h or --help show this help.
-d or --dir set installation dir of iml deployment to find its check skript -h, --help
default dir: /opt/imlbackup/server show this help.
script: /opt/imlbackup/server/storage_helper.sh
-m or --mode mode: set type of result; one of status|backupstatus -d, --dir PATH
backupstatus status of backup sets of all servers set installation dir of iml deployment to find its check skript
status count of connected servers default dir: /opt/imlbackup/server
script: /opt/imlbackup/server/storage_helper.sh
-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: EXAMPLE:
check_iml_backup_server -m status
check_iml_backup_server -m backupstatus check_iml_backup_server -m status
check_iml_backup_server -m backupstatus
``` ```
...@@ -61,9 +69,6 @@ check_iml_backup_server -m backupstatus ...@@ -61,9 +69,6 @@ check_iml_backup_server -m backupstatus
### Backup server status ### 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 ```txt
# ./check_iml_backup_server -m backupstatus # ./check_iml_backup_server -m backupstatus
OK: Server Backups - 36 servers in backup - 0 errors - 7 disbled - 0 running 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