Dzahn has submitted this change and it was merged.
Change subject: schedule icinga downtimes for new installs
......................................................................
schedule icinga downtimes for new installs
re: < bblack> ^ is there some way we can automatically suppress
notifications on brand-new hosts for their first hour or so?
Change-Id: I67eebdedfeb384efc2be121256b9c7d2637ac32b
---
A files/misc/scripts/scheduledowntime
1 file changed, 17 insertions(+), 0 deletions(-)
Approvals:
jenkins-bot: Verified
Dzahn: Looks good to me, approved
diff --git a/files/misc/scripts/scheduledowntime
b/files/misc/scripts/scheduledowntime
new file mode 100755
index 0000000..0f30c65
--- /dev/null
+++ b/files/misc/scripts/scheduledowntime
@@ -0,0 +1,17 @@
+#!/bin/bash
+# schedule icinga downtime for a new host
+#
+# have this triggered on neon somehow
+# when new hosts are installed and
+# icinga spam should be avoided
+
+icinga_user=$USER
+icinga_fifo=/var/lib/nagios/rw/nagios.cmd
+icinga_host=$1
+
+duration=$(( 2 * 60 * 60)) ; 2 hours
+ts_from=$(date +%s)
+ts_to=$(( ts_from + duration))
+
+printf "[%lu]
SCHEDULE_HOST_DOWNTIME;${icinga_host};${ts_from};${ts_to};1;0;${duration};${icinga_user};automatic
downtime for newly installed host\n" $(date +%s) > $icinga_fifo
+
--
To view, visit https://gerrit.wikimedia.org/r/144839
To unsubscribe, visit https://gerrit.wikimedia.org/r/settings
Gerrit-MessageType: merged
Gerrit-Change-Id: I67eebdedfeb384efc2be121256b9c7d2637ac32b
Gerrit-PatchSet: 1
Gerrit-Project: operations/puppet
Gerrit-Branch: production
Gerrit-Owner: Dzahn <[email protected]>
Gerrit-Reviewer: BBlack <[email protected]>
Gerrit-Reviewer: Dzahn <[email protected]>
Gerrit-Reviewer: Giuseppe Lavagetto <[email protected]>
Gerrit-Reviewer: jenkins-bot <>
_______________________________________________
MediaWiki-commits mailing list
[email protected]
https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits