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
763cf06a
Commit
763cf06a
authored
1 year ago
by
Hahn Axel (hahn)
Browse files
Options
Downloads
Patches
Plain Diff
update includes
parent
528a04ab
No related branches found
No related tags found
1 merge request
!235
Docker checks: add check for docker stats
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
inc_dockerfunctions.sh
+4
-6
4 additions, 6 deletions
inc_dockerfunctions.sh
inc_pluginfunctions
+5
-3
5 additions, 3 deletions
inc_pluginfunctions
with
9 additions
and
9 deletions
inc_dockerfunctions.sh
+
4
−
6
View file @
763cf06a
...
@@ -28,14 +28,14 @@ _is_docker_detected=0
...
@@ -28,14 +28,14 @@ _is_docker_detected=0
# param string json data
# param string json data
# param string jq filter
# param string jq filter
function
_filterJson
(){
function
_filterJson
(){
echo
"
$1
"
| jq
"
$2
"
echo
"
$1
"
| jq
-r
"
$2
"
}
}
# filter json data with jq (by expecting a single result) and remove quotes
# filter json data with jq (by expecting a single result) and remove quotes
# param string json data
# param string json data
# param string jq filter
# param string jq filter
function
_getString
(){
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"
# if DOCKER_HOST is not set we try to detect the user running "containerd"
...
@@ -74,12 +74,10 @@ function _detectDockererror(){
...
@@ -74,12 +74,10 @@ function _detectDockererror(){
ph.exit
ph.exit
fi
fi
local
sSrvErrror
;
if
grep
'"ServerErrors"'
<<<
"
$data
"
>
/dev/null
;
then
sSrvErrror
=
$(
_filterJson
"
$data
"
".ServerErrors"
)
if
[
"
$sSrvErrror
"
!=
"null"
]
;
then
ph.setStatus unknown
ph.setStatus unknown
ph.status
"Unable to connect to Docker:"
ph.status
"Unable to connect to Docker:"
echo
"
$sSrvEr
rror
"
|
grep
"^ "
_filterJson
"
$data
"
".ServerE
rror
s
"
|
grep
"^ "
ph.exit
ph.exit
fi
fi
...
...
This diff is collapsed.
Click to expand it.
inc_pluginfunctions
+
5
−
3
View file @
763cf06a
...
@@ -299,9 +299,11 @@ function ph._getExp(){
...
@@ -299,9 +299,11 @@ function ph._getExp(){
# test "$_unit" = "m" && echo 10^-3
# test "$_unit" = "m" && echo 10^-3
# test "$_unit" = "c" && echo 10^-2
# test "$_unit" = "c" && echo 10^-2
# test "$_unit" = "d" && echo 10^-1
# test "$_unit" = "d" && echo 10^-1
# test "$_unit" = "k" && echo 10^3
test
"
$_unit
"
=
"k"
&&
echo
10^3
# test "$_unit" = "M" && echo 10^6
test
"
$_unit
"
=
"Mi"
&&
echo
10^6
# test "$_unit" = "G" && echo 10^9
test
"
$_unit
"
=
"Gi"
&&
echo
10^9
test
"
$_unit
"
=
"Ti"
&&
echo
10^9
test
"
$_unit
"
=
"Pi"
&&
echo
10^9
# echo "ERROR: unsupported value: $_value"
# echo "ERROR: unsupported value: $_value"
# exit 1
# exit 1
...
...
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