Filippo Giunchedi has uploaded a new change for review.

  https://gerrit.wikimedia.org/r/198775

Change subject: check_graphite: accept additional date specification
......................................................................

check_graphite: accept additional date specification

I got bitten by this using from="1hour" and check_graphite goes UNKNOWN in
icinga. Make it more tolerant of other date suffixes, this also makes the help
text work as described ('day' was not accepted).

Change-Id: Ib801f087c55fec5d3b9e3eead6d6101076d68c7d
---
M modules/nagios_common/files/check_commands/check_graphite
1 file changed, 4 insertions(+), 1 deletion(-)


  git pull ssh://gerrit.wikimedia.org:29418/operations/puppet 
refs/changes/75/198775/1

diff --git a/modules/nagios_common/files/check_commands/check_graphite 
b/modules/nagios_common/files/check_commands/check_graphite
index 20166b4..9c344ee 100755
--- a/modules/nagios_common/files/check_commands/check_graphite
+++ b/modules/nagios_common/files/check_commands/check_graphite
@@ -161,7 +161,10 @@
     '''
     parser_name = 'check_threshold'
     from_regex = re.compile('^-(\d+)(\w+)$')
-    _accepted_time_defs = ['hours', 'h', 'w', 'weeks', 'min', 'minutes']
+    _accepted_time_defs = ['hours', 'hour', 'h',
+                           'weeks', 'week', 'w',
+                           'days', 'day', 'd',
+                           'minutes', 'minute', 'min']
 
     @classmethod
     def create_parser(cls, parser):

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

Gerrit-MessageType: newchange
Gerrit-Change-Id: Ib801f087c55fec5d3b9e3eead6d6101076d68c7d
Gerrit-PatchSet: 1
Gerrit-Project: operations/puppet
Gerrit-Branch: production
Gerrit-Owner: Filippo Giunchedi <fgiunch...@wikimedia.org>

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

Reply via email to