[packages/monitoring-plugin-check_mysql-heartbeat] strip decimals, shell doesn't process these

glen glen at pld-linux.org
Tue Mar 22 12:39:33 CET 2016


commit 119d5b2f08f7315eb8a491f9c5b03abde0119bb6
Author: Elan Ruusamäe <glen at delfi.ee>
Date:   Tue Mar 22 13:38:07 2016 +0200

    strip decimals, shell doesn't process these

 check_mysql-heartbeat.sh | 3 +++
 1 file changed, 3 insertions(+)
---
diff --git a/check_mysql-heartbeat.sh b/check_mysql-heartbeat.sh
index d6c7805..43a1ea2 100755
--- a/check_mysql-heartbeat.sh
+++ b/check_mysql-heartbeat.sh
@@ -124,6 +124,9 @@ if [ "$rc" != 0 ]; then
 	die UNKNOWN "$secs"
 fi
 
+# strip decimals, shell doesn't process these
+secs=${secs%[.,]*}
+
 [ $secs -gt $critical ] && die CRITICAL "$heartbeat on $hostname $secs seconds over critical treshold $critical seconds"
 [ $secs -gt $warning ] && die WARNING "$heartbeat on $hostname $secs seconds over warning treshold $warning seconds"
 
================================================================

---- gitweb:

http://git.pld-linux.org/gitweb.cgi/packages/monitoring-plugin-check_mysql-heartbeat.git/commitdiff/1e4e0308b503453e713d946f561dc61029726738



More information about the pld-cvs-commit mailing list