Dzahn has submitted this change and it was merged.

Change subject: icinga: default duration for icinga-downtime
......................................................................


icinga: default duration for icinga-downtime

Provide 2h default downtime, for convenience

Change-Id: I577b488764ca020d0fcfcb762ac1c7ecec950015
---
M modules/icinga/files/icinga-downtime
1 file changed, 6 insertions(+), 2 deletions(-)

Approvals:
  jenkins-bot: Verified
  Dzahn: Looks good to me, approved



diff --git a/modules/icinga/files/icinga-downtime 
b/modules/icinga/files/icinga-downtime
index 0140a25..05aab26 100755
--- a/modules/icinga/files/icinga-downtime
+++ b/modules/icinga/files/icinga-downtime
@@ -6,7 +6,7 @@
 # example: ./icinga-downtime -h mw1021 -d 7200 -r "something happened"
 #
 # -h <hostname> should be the (short) name of a host as shown in the Icinga UI
-# -d <duration> how long should the downtime last, in seconds (2 hrs = 7200)
+# -d <duration> how long should the downtime last, in seconds (default 7200 
(2h))
 # -r <reason>   a string with the reason for the downtime
 #
 
@@ -36,11 +36,15 @@
 esac
 done
 
-if [ -z $hostname ] || [ -z $duration ] || [ -z "$reason" ]; then
+if [ -z "$hostname" ] || [ -z "$reason" ]; then
     echo "usage: $0 -h <hostname> -d <duration> -r <reason>"
     exit
 fi
 
+if [ -z "$duration" ]; then
+    duration=7200
+fi
+
 start_time=$(date +%s) # now
 end_time=$(( $start_time + $duration ))
 

-- 
To view, visit https://gerrit.wikimedia.org/r/317720
To unsubscribe, visit https://gerrit.wikimedia.org/r/settings

Gerrit-MessageType: merged
Gerrit-Change-Id: I577b488764ca020d0fcfcb762ac1c7ecec950015
Gerrit-PatchSet: 2
Gerrit-Project: operations/puppet
Gerrit-Branch: production
Gerrit-Owner: Filippo Giunchedi <fgiunch...@wikimedia.org>
Gerrit-Reviewer: Alexandros Kosiaris <akosia...@wikimedia.org>
Gerrit-Reviewer: Dzahn <dz...@wikimedia.org>
Gerrit-Reviewer: jenkins-bot <>

_______________________________________________
MediaWiki-commits mailing list
MediaWiki-commits@lists.wikimedia.org
https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits

Reply via email to