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
GitLab community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
IML Open Source
icinga-checks
Merge requests
!235
Docker checks: add check for docker stats
Code
Review changes
Check out branch
Download
Patches
Plain diff
Expand sidebar
Merged
Docker checks: add check for docker stats
docker-checks
into
master
Overview
0
Commits
3
Pipelines
0
Changes
2
Merged
Hahn Axel (hahn)
requested to merge
docker-checks
into
master
1 year ago
Overview
0
Commits
3
Pipelines
0
Changes
2
0
0
Merge request reports
Viewing commit
763cf06a
Prev
Next
Show latest version
2 files
+
9
−
9
Inline
Compare changes
Side-by-side
Inline
Show whitespace changes
Show one file at a time
Files
2
763cf06a
update includes
· 763cf06a
Hahn Axel (hahn)
authored
1 year ago
inc_dockerfunctions.sh
+
4
−
6
View file @ 763cf06a
Edit in single-file editor
Open in Web IDE
Show full file
@@ -28,14 +28,14 @@ _is_docker_detected=0
# param string json data
# param string jq filter
function
_filterJson
(){
echo
"
$1
"
| jq
"
$2
"
echo
"
$1
"
| jq
-r
"
$2
"
}
# filter json data with jq (by expecting a single result) and remove quotes
# param string json data
# param string jq filter
function
_getString
(){
_filterJson
"
$1
"
"
$2
"
|
tr
-d
'"'
|
sed
"s#^null
\$
##"
_filterJson
"
$1
"
"
$2
"
|
sed
"s#^null
\$
##
g
"
}
# if DOCKER_HOST is not set we try to detect the user running "containerd"
@@ -74,12 +74,10 @@ function _detectDockererror(){
ph.exit
fi
local
sSrvErrror
;
sSrvErrror
=
$(
_filterJson
"
$data
"
".ServerErrors"
)
if
[
"
$sSrvErrror
"
!=
"null"
]
;
then
if
grep
'"ServerErrors"'
<<<
"
$data
"
>
/dev/null
;
then
ph.setStatus unknown
ph.status
"Unable to connect to Docker:"
echo
"
$sSrvEr
rror
"
|
grep
"^ "
_filterJson
"
$data
"
".ServerE
rror
s
"
|
grep
"^ "
ph.exit
fi
Loading