Volans has submitted this change and it was merged.

Change subject: Icinga: peroperly detect timeouts in raid_handler
......................................................................


Icinga: peroperly detect timeouts in raid_handler

Bug: T142085
Change-Id: I3c52362899232147fac94710de421f70c05aec16
---
M modules/icinga/files/raid_handler.py
M modules/icinga/templates/event_handlers/raid_handler.cfg.erb
2 files changed, 5 insertions(+), 4 deletions(-)

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



diff --git a/modules/icinga/files/raid_handler.py 
b/modules/icinga/files/raid_handler.py
index 05f83c9..31e9722 100644
--- a/modules/icinga/files/raid_handler.py
+++ b/modules/icinga/files/raid_handler.py
@@ -68,7 +68,8 @@
         '-c', dest='datacenter', action='store', required=True,
         help='The name of the datacenter the host is located in')
     parser.add_argument(
-        '-n', dest='notes', action='store', help='The Service notes')
+        '-m', dest='message', action='store', required=True,
+        help='The service Status information output (first line)')
     parser.add_argument(
         '-d', dest='debug', action='store_true', help='Debug level logging')
 
@@ -212,11 +213,11 @@
         logger.debug('Nothing to do, exiting')
         return
 
-    if args.notes is not None and 'Timeout' in args.notes:
+    if 'Timeout' in args.message:
         logger.info(
             ("Skipping RAID Handler execution for host '{}' and "
              "RAID type '{}', timeout detected: {}").format(
-                args.host_address, args.raid_type, args.notes))
+                args.host_address, args.raid_type, args.message))
         return
 
     raid_status = get_raid_status(args.host_address, args.raid_type)
diff --git a/modules/icinga/templates/event_handlers/raid_handler.cfg.erb 
b/modules/icinga/templates/event_handlers/raid_handler.cfg.erb
index e60620d..8104f04 100644
--- a/modules/icinga/templates/event_handlers/raid_handler.cfg.erb
+++ b/modules/icinga/templates/event_handlers/raid_handler.cfg.erb
@@ -1,4 +1,4 @@
 define command{
     command_name    raid_handler
-    command_line    $USER1$/eventhandlers/raid_handler -d -s $SERVICESTATE$ -t 
$SERVICESTATETYPE$ -a $SERVICEATTEMPT$ -H $HOSTNAME$ -n "$SERVICENOTES$" -r 
$ARG1$ -D "$ARG2$" -c $ARG3$
+    command_line    $USER1$/eventhandlers/raid_handler -d -s $SERVICESTATE$ -t 
$SERVICESTATETYPE$ -a $SERVICEATTEMPT$ -H $HOSTNAME$ -m "$SERVICEOUTPUT$" -r 
$ARG1$ -D "$ARG2$" -c $ARG3$
     }

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

Gerrit-MessageType: merged
Gerrit-Change-Id: I3c52362899232147fac94710de421f70c05aec16
Gerrit-PatchSet: 2
Gerrit-Project: operations/puppet
Gerrit-Branch: production
Gerrit-Owner: Volans <[email protected]>
Gerrit-Reviewer: Volans <[email protected]>
Gerrit-Reviewer: jenkins-bot <>

_______________________________________________
MediaWiki-commits mailing list
[email protected]
https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits

Reply via email to