dont email usually redundant logs by default
[log-quiet] / sysd-prom-fail-install
index ad9845654480ff0cc93297bb90e7e7b9ee13caec..f25510ef094ce28df9d5cba7e0633bad961aac32 100755 (executable)
 # usage: since this is a counter, in prometheus alert manager you will
 # need to test something like: rate(node_systemd_unit_result_fail_count[30m]) > 0
 
-source /a/bin/errhandle/err
+source /a/bin/bash-bear-trap/bash-bear
 [[ $EUID == 0 ]] || exec sudo -E "${BASH_SOURCE[0]}" "$@"
 
 ser_name=$1
 
 mkdir -p /var/lib/prometheus/node-exporter
 
-f=/var/local/sysd-prom-fail/${ser_name}-result-fail.prom
+f=/var/local/sysd-prom-fail/${ser_name}-result.prom
 
 
-if [[ ! -s /var/lib/prometheus/node-exporter/${ser_name}-result-fail.premerge ]]; then
+if [[ ! -s $f ]]; then
   SERVICE_RESULT=success /usr/local/bin/sysd-prom-fail $ser_name
 fi
 
@@ -48,3 +48,5 @@ if [[ $out ]]; then
     systemctl restart $ser_name ||:
   fi
 fi
+
+# todo: make uninstall script