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
9e10ae9c
Commit
9e10ae9c
authored
3 years ago
by
Hahn Axel (hahn)
Browse files
Options
Downloads
Patches
Plain Diff
check clientbackup: no tmpfile; show more output
parent
8ff7e46a
No related branches found
No related tags found
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
check_clientbackup
+17
-9
17 additions, 9 deletions
check_clientbackup
with
17 additions
and
9 deletions
check_clientbackup
+
17
−
9
View file @
9e10ae9c
...
...
@@ -8,38 +8,46 @@
# 2016-12-23 v1.1 added readable exitcode from shared functions file
# 2020-03-05 v1.2 <axel.hahn@iml.unibe.ch> switch to ph.* helper functions
# 2020-04-04 v1.3 <axel.hahn@iml.unibe.ch> set status unknown if never executed
# 2022-02-17 v1.4 <axel.hahn@iml.unibe.ch> no tmpfile; show more output to see backed up dirs
# ======================================================================
.
`
dirname
$0
`
/inc_pluginfunctions
.
$(
dirname
$0
)
/inc_pluginfunctions
sInstalldir
=
/opt/imlbackup/client/
sChecker
=
$sInstalldir
/check_clientbackup.sh
tmpfile
=
/tmp/clientbackup_status.out
sInstalldir
=
/home/axel/skripte/client
sChecker
=
$sInstalldir
/check_clientbackup.sh
if
[
!
-x
$sChecker
]
;
then
ph.abort
"
$sChecker
not found - maybe clientbackup is not installed."
fi
$sChecker
>
$tmpfile
result
=
$(
$sChecker
|
sed
"s#
\[
[0-9][0-9]*m# #g"
)
rc
=
$?
if
[
$rc
-eq
0
]
;
then
ph.setStatus
"ok"
else
grep
"Backup was never executed"
$tmpfile
2>/dev/null
if
[
$?
-eq
0
]
;
then
if
echo
"
$result
"
|
grep
"Backup was never executed"
2>/dev/null
then
ph.setStatus
"unknown"
else
ph.setStatus
"critical"
fi
fi
ph.status
"
`
fgrep
"MONITORINFO:"
$tmpfile
|
cut
-f
2-
-d
':'
`
"
ph.status
echo
"
$result
"
|
grep
-F
"MONITORINFO:"
|
cut
-f
2-
-d
':'
echo
echo
"--- localdump:"
echo
"
$result
"
|
grep
-v
"STATUS"
|
cut
-f
2-
-d
":"
|
grep
"
\
backup
\ \[
"
echo
echo
"--- transfer:"
echo
"
$result
"
|
grep
"DIR
\
[A-Z]*
\
/"
rm
-f
$tmpfile
ph.exit
# ----------------------------------------------------------------------
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