Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
I
icinga-checks
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Container registry
Model registry
Operate
Environments
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
IML Open Source
icinga-checks
Commits
528c306a
Commit
528c306a
authored
1 year ago
by
Hahn Axel (hahn)
Browse files
Options
Downloads
Patches
Plain Diff
update iml_backup_server
parent
bd603a44
Branches
Branches containing commit
No related tags found
1 merge request
!223
6908 check rearbackup
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
check_iml_backup_server
+28
-11
28 additions, 11 deletions
check_iml_backup_server
docs/20_Checks/check_iml_backup_server.md
+19
-14
19 additions, 14 deletions
docs/20_Checks/check_iml_backup_server.md
with
47 additions
and
25 deletions
check_iml_backup_server
+
28
−
11
View file @
528c306a
...
@@ -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
# ----------------------------------------------------------------------
# ----------------------------------------------------------------------
...
...
This diff is collapsed.
Click to expand it.
docs/20_Checks/check_iml_backup_server.md
+
19
−
14
View file @
528c306a
...
@@ -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
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment