[Pacemaker] A patch of crm_mon for the trouble actions.

renayama19661014 at ybb.ne.jp renayama19661014 at ybb.ne.jp
Mon Sep 13 00:30:50 EDT 2010


Hi,

I contribute the patch of the crm_mon command.

A node was offline and, in the case of the shutdown, revised it not to display a trouble action.

Please confirm a patch. 
And, without a problem, please take this revision in a development version.


diff -r 9b95463fde99 tools/crm_mon.c
--- a/tools/crm_mon.c	Mon Sep 13 13:07:16 2010 +0900
+++ b/tools/crm_mon.c	Mon Sep 13 13:07:59 2010 +0900
@@ -829,6 +829,7 @@
     int configured_resources = 0;
     int print_opts = pe_print_ncurses;
     const char *quorum_votes = "unknown";
+    gboolean is_failed_first_disp = TRUE;
 
     if(as_console) {
 	blank_screen();
@@ -989,16 +990,28 @@
     }
 	
     if(xml_has_children(data_set->failed)) {
-	print_as("\nFailed actions:\n");
 	xml_child_iter(data_set->failed, xml_op, 
 		       int val = 0;
+	               node_t *failed_node = NULL;
 		       const char *id = ID(xml_op);
 		       const char *last = crm_element_value(xml_op, "last_run");
 		       const char *node = crm_element_value(xml_op, XML_ATTR_UNAME);
 		       const char *call = crm_element_value(xml_op, XML_LRM_ATTR_CALLID);
 		       const char *rc   = crm_element_value(xml_op, XML_LRM_ATTR_RC);
 		       const char *status = crm_element_value(xml_op, XML_LRM_ATTR_OPSTATUS);
-			       
+
+	               failed_node = pe_find_node(data_set->nodes, node);
+                       if (failed_node != NULL) {
+	                   if ((failed_node->details->shutdown == TRUE) && (failed_node->details->online ==
FALSE)) {
+	                       continue;
+	                   }
+	               }
+
+	               if (is_failed_first_disp){
+	                   is_failed_first_disp = FALSE;
+	                   print_as("\nFailed actions:\n");
+	               }
+	 
 		       val = crm_parse_int(status, "0");
 		       print_as("    %s (node=%s, call=%s, rc=%s, status=%s",
 				id, node, call, rc, op_status2text(val));



Best Regards,
Hideo Yamauchi.

-------------- next part --------------
A non-text attachment was scrubbed...
Name: crm_mon.patch
Type: application/octet-stream
Size: 1653 bytes
Desc: 3579307218-crm_mon.patch
URL: <http://lists.clusterlabs.org/pipermail/pacemaker/attachments/20100913/4ecbc330/attachment-0002.obj>


More information about the Pacemaker mailing list