Skip to content
Snippets Groups Projects
Commit 763cf06a authored by Hahn Axel (hahn)'s avatar Hahn Axel (hahn)
Browse files

update includes

parent 528a04ab
No related branches found
No related tags found
1 merge request!235Docker checks: add check for docker stats
This commit is part of merge request !235. Comments created here will be created in the context of that merge request.
......@@ -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 "$sSrvErrror" | grep "^ "
_filterJson "$data" ".ServerErrors" | grep "^ "
ph.exit
fi
......
......@@ -299,9 +299,11 @@ function ph._getExp(){
# test "$_unit" = "m" && echo 10^-3
# test "$_unit" = "c" && echo 10^-2
# test "$_unit" = "d" && echo 10^-1
# test "$_unit" = "k" && echo 10^3
# test "$_unit" = "M" && echo 10^6
# test "$_unit" = "G" && echo 10^9
test "$_unit" = "k" && echo 10^3
test "$_unit" = "Mi" && echo 10^6
test "$_unit" = "Gi" && echo 10^9
test "$_unit" = "Ti" && echo 10^9
test "$_unit" = "Pi" && echo 10^9
# echo "ERROR: unsupported value: $_value"
# exit 1
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment