From ecb831f05ac9ce6b21a786867a13947bff235e17 Mon Sep 17 00:00:00 2001 From: Daniel Berteaud Date: Mon, 26 Oct 2020 19:12:49 +0100 Subject: [PATCH] Run upsc commands with 2>/de/null With default conf, it'll print "Init SSL without certificate database" which we're not interested in in this context (and would break Zabbix item) --- zabbix_scripts/util_generate_sensors_ini | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/zabbix_scripts/util_generate_sensors_ini b/zabbix_scripts/util_generate_sensors_ini index 7a58384..a52e07e 100755 --- a/zabbix_scripts/util_generate_sensors_ini +++ b/zabbix_scripts/util_generate_sensors_ini @@ -366,7 +366,7 @@ if ($upsc && -x $upsc){ threshold_high => $def_ups_temp_thres_high, threshold_low => $def_ups_temp_thres_high-$temp_ups_hyst, unit => '°C', - cmd => "$upsc $ups ups.temperature" + cmd => "$upsc $ups ups.temperature 2>/dev/null" }; print "Found a temperature sensor for ups $ups\n"; last; @@ -378,7 +378,7 @@ if ($upsc && -x $upsc){ threshold_high => $def_pwr_rel_thres_high, threshold_low => $def_pwr_rel_thres_high-$pwr_rel_hyst, unit => '%', - cmd => "$upsc $ups ups.load" + cmd => "$upsc $ups ups.load 2>/dev/null" }; } }