From a781406b16056cd6d59c8ee6584f49ae4b19d02f Mon Sep 17 00:00:00 2001
From: "Hahn Axel (hahn)" <axel.hahn@iml.unibe.ch>
Date: Thu, 16 Feb 2023 16:06:31 +0100
Subject: [PATCH] adding a generic min and max value did not help

---
 inc_pluginfunctions | 20 ++++++++++++++------
 1 file changed, 14 insertions(+), 6 deletions(-)

diff --git a/inc_pluginfunctions b/inc_pluginfunctions
index dca76fe..0e239a3 100644
--- a/inc_pluginfunctions
+++ b/inc_pluginfunctions
@@ -32,6 +32,7 @@
 # 2022-08-31  v1.4  <axel.hahn@iml.unibe.ch> shellfix corrections
 # 2022-10-25  v1.5  <axel.hahn@iml.unibe.ch> handle empty value in ph.perfadd
 # 2023-01-30  v1.6  <axel.hahn@unibe.ch>     check performance params 5+6 and show a warning if missing
+# 2023-02-16  v1.7  <axel.hahn@unibe.ch>     adding a generic min and max value did not really help
 # ======================================================================
 
 
@@ -440,12 +441,19 @@ function ph.perfadd(){
   local _max=$6
 
   test -z "$_value" && _value=0
-  test -z "$_min"   && echo "WARNING from ph.perfadd: missing param 5 for minimum - setting it to 0"
-  test -z "$_min"   && _min=0
-  test -z "$_max"   && echo "WARNING from ph.perfadd: missing param 6 for maxiumun - setting it to 100"
-  test -z "$_max"   && _max=100
-  
-  echo "${_label}=${_value};${_w};${_c};${_min};${_max}" >>"${ph_perfdatafile}"
+
+  # adding a generic min and max value did not really help
+  # test -z "$_min"   && echo "WARNING from ph.perfadd: missing param 5 for minimum - setting it to 0"
+  # test -z "$_min"   && _min=0
+  # test -z "$_max"   && echo "WARNING from ph.perfadd: missing param 6 for maxiumun - setting it to 100"
+  # test -z "$_max"   && _max=100  
+  # ... so we add them if tey exist only
+  local _minmax=
+  test -n "$_min"   && _minmax+=";$_min"
+  test -n "$_max"   && _minmax+=";$_max"
+
+  # echo "${_label}=${_value};${_w};${_c};${_min};${_max}" >>"${ph_perfdatafile}"
+  echo "${_label}=${_value};${_w};${_c}${_minmax}" >>"${ph_perfdatafile}"
 }
 
 
-- 
GitLab