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
...@@ -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 "$sSrvErrror" | grep "^ " _filterJson "$data" ".ServerErrors" | grep "^ "
ph.exit ph.exit
fi fi
......
...@@ -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
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment