[Pacemaker] crm_mon and pingd

Vadym Chepkov vchepkov at gmail.com
Tue Nov 9 07:26:21 EST 2010


On Tue, Nov 9, 2010 at 3:30 AM, Andrew Beekhof <andrew at beekhof.net> wrote:
> On Fri, Nov 5, 2010 at 6:39 PM, Vadym Chepkov <vchepkov at gmail.com> wrote:
>>
>> On Nov 5, 2010, at 1:29 PM, Keisuke MORI wrote:
>>
>>> Hi Vadym,
>>>
>>> Could you provide the output of 'cibadmin -Q' to see what's happening
>>> over there?
>>>
>>> Thanks,
>>
>> As Yuusuke IIDA pointed out this is a new and expected behavior of crm_mon.
>> To be honest I don't excited about it, since -A flag fills screen with master-drbd scores and not just pingd.
>
> hmmm
> maybe we need some user configurable filter. eg.
>   crm_mon -A ping
>

Would it be too much harm to restore the previous behavior at least partially?

diff -r 7f2e453eedfa -r ab2da8a98b47 tools/crm_mon.c
--- a/tools/crm_mon.c   Mon Nov 08 23:13:17 2010 +0100
+++ b/tools/crm_mon.c   Tue Nov 09 07:18:53 2010 -0500
@@ -748,6 +748,17 @@
    g_list_free(sorted_op_list);
 }

+static void get_ping_score(node_t *node, pe_working_set_t *data_set)
+{
+    const char *attr = "pingd";
+    const char *value = NULL;
+    value = g_hash_table_lookup(node->details->attrs, attr);
+
+    if(value != NULL) {
+       print_as(" %s=%s", attr, value);
+    }
+}
+
 static void print_attr_msg(node_t *node, GListPtr rsc_list, const
char *attrname, const char *attrvalue)
 {
    slist_iter(rsc, resource_t, rsc_list, lpc2,
@@ -848,6 +859,9 @@
       }

       print_as("* Node %s: ", crm_element_value(node_state, XML_ATTR_UNAME));
+       if(!print_nodes_attr) {
+               get_ping_score(node, data_set);
+       }
       print_as("\n");

       lrm_rsc = find_xml_node(node_state, XML_CIB_TAG_LRM, FALSE);

Thanks,
Vadym




More information about the Pacemaker mailing list