From 44de2b84ec19ee37c3026fd1ed08bf39f5d90fbf Mon Sep 17 00:00:00 2001 From: Daniel Jakots Date: Wed, 28 Mar 2018 09:50:41 -0400 Subject: [PATCH] Add script to exclude a time slot from monitoring --- .../files/plugins/exclude-time-slot-wrapper.sh | 14 ++++++++++++++ 1 file changed, 14 insertions(+) create mode 100644 nagios-nrpe/files/plugins/exclude-time-slot-wrapper.sh diff --git a/nagios-nrpe/files/plugins/exclude-time-slot-wrapper.sh b/nagios-nrpe/files/plugins/exclude-time-slot-wrapper.sh new file mode 100644 index 00000000..59619030 --- /dev/null +++ b/nagios-nrpe/files/plugins/exclude-time-slot-wrapper.sh @@ -0,0 +1,14 @@ +#!/bin/sh + +# timestamp modulo 1 day. +time=$(($(date +"%s") %86400)) + +# pour trouver les valeurs : prendre l'heure en *UTC* +# et faire H * 3600 + M * 60 + S +if [ $time -ge 7200 ] && [ $time -lt 10800 ]; then + echo "In excluded time slot." + exit 0 +else + $@ + exit $? +fi