Blame SOURCES/redhat-bugzilla-1980067.patch

f529f7
From 7b21619f0022b9eba7ad5b9c3c018471c4be9a93 Mon Sep 17 00:00:00 2001
f529f7
From: Paul Evans <pevans@redhat.com>
f529f7
Date: Mon, 8 Feb 2021 18:14:37 +0000
f529f7
Subject: [PATCH 1/7] pmdahacluster: Quick README.md update
f529f7
f529f7
Update README.md to reflect pmns root node update to ha_cluster
f529f7
---
f529f7
 src/pmdas/hacluster/README.md | 4 ++--
f529f7
 1 file changed, 2 insertions(+), 2 deletions(-)
f529f7
f529f7
diff --git a/src/pmdas/hacluster/README.md b/src/pmdas/hacluster/README.md
f529f7
index 4d0fcabf5..709cb721d 100644
f529f7
--- a/src/pmdas/hacluster/README.md
f529f7
+++ b/src/pmdas/hacluster/README.md
f529f7
@@ -6,7 +6,7 @@ The PMDA collects it's metric data from the following components that make up a
f529f7
 
f529f7
 ## General Notes
f529f7
 
f529f7
-### `hacluster.drbd.split_brain`
f529f7
+### `ha_cluster.drbd.split_brain`
f529f7
 
f529f7
 This metric signals if there is a split brain occurring in DRBD per instance resource:volume. The metric will return the value `1` if a split brain is detected, otherwise it will be `0`.
f529f7
 
f529f7
@@ -37,7 +37,7 @@ exposed by this PMDA.
f529f7
 Once the PMDA has been installed, the following command will list all of
f529f7
 the available metrics and their explanatory “help” text:
f529f7
 
f529f7
-		# $ pminfo -fT hacluster
f529f7
+		# $ pminfo -fT ha_cluster
f529f7
 
f529f7
 ## Installation
f529f7
 
f529f7
-- 
f529f7
2.31.1
f529f7
f529f7
f529f7
From f68df957286df0b0c2bb091d1025cf3c4adc2810 Mon Sep 17 00:00:00 2001
f529f7
From: Ken McDonell <kenj@kenj.id.au>
f529f7
Date: Sun, 4 Apr 2021 07:35:45 +1000
f529f7
Subject: [PATCH 2/7] src/pmdas/hacluster/pacemaker.c: plug small mem leak on
f529f7
 error path in hacluster_refresh_pacemaker_resources() (covscan)
f529f7
f529f7
Fixes Coverity CID 366053.
f529f7
---
f529f7
 src/pmdas/hacluster/pacemaker.c | 5 ++++-
f529f7
 1 file changed, 4 insertions(+), 1 deletion(-)
f529f7
f529f7
diff --git a/src/pmdas/hacluster/pacemaker.c b/src/pmdas/hacluster/pacemaker.c
f529f7
index 25d80ed41..2dc53f8cf 100644
f529f7
--- a/src/pmdas/hacluster/pacemaker.c
f529f7
+++ b/src/pmdas/hacluster/pacemaker.c
f529f7
@@ -625,8 +625,11 @@ hacluster_refresh_pacemaker_resources(const char *instance_name, struct resource
f529f7
 
f529f7
 	pmsprintf(buffer, sizeof(buffer), "%s", crm_mon_command);
f529f7
 
f529f7
-	if ((pf = popen(buffer, "r")) == NULL)
f529f7
+	if ((pf = popen(buffer, "r")) == NULL) {
f529f7
+		if (!no_node_attachment)
f529f7
+		    free(tofree);
f529f7
 		return -oserror();
f529f7
+	}
f529f7
 
f529f7
 	while(fgets(buffer, sizeof(buffer)-1, pf) != NULL) {
f529f7
 
f529f7
-- 
f529f7
2.31.1
f529f7
f529f7
f529f7
From 625e3a493611864d8785091d0f95a2e1ec293eea Mon Sep 17 00:00:00 2001
f529f7
From: Paul Evans <pevans@redhat.com>
f529f7
Date: Fri, 9 Apr 2021 21:10:12 +0100
f529f7
Subject: [PATCH 3/7] pmdahacluster: Correct logic for
f529f7
 ha_cluster.pacemaker.resources.* metrics
f529f7
f529f7
Correct the logic for pacemaker resources metrics in the hacluster PMDA
f529f7
simplifying the logic and correcting the issue seen under QA testing
f529f7
pointed out by Ken along with further corrections in the pacemaker
f529f7
resources metric collection.
f529f7
f529f7
Have also included further buffer overflow guarding for the most of
f529f7
the sscanf cases in pacemaker.c.
f529f7
f529f7
Bonus: Corrected spelling mistakes also pointed out in helptext.
f529f7
---
f529f7
 qa/1897.out                     | 32 ++++++++++++++++----------------
f529f7
 src/pmdas/hacluster/help        | 28 ++++++++++++++--------------
f529f7
 src/pmdas/hacluster/pacemaker.c | 19 ++++---------------
f529f7
 3 files changed, 34 insertions(+), 45 deletions(-)
f529f7
f529f7
diff --git a/qa/1897.out b/qa/1897.out
f529f7
index ff9c3ff6c..054b1e92f 100644
f529f7
--- a/qa/1897.out
f529f7
+++ b/qa/1897.out
f529f7
@@ -337,7 +337,7 @@ ha_cluster.pacemaker.nodes.status.dc PMID: 155.3.8 [Whether the node status is g
f529f7
     Data Type: 32-bit unsigned int  InDom: 155.2 0x26c00002
f529f7
     Semantics: instant  Units: count
f529f7
 Help:
f529f7
-Whether the disconnected status is reportered by the node in the cluster, a
f529f7
+Whether the disconnected status is reported by the node in the cluster, a
f529f7
 value of 1 confirms the node status as disconnected.
f529f7
     inst [0 or "node-1"] value 0
f529f7
     inst [1 or "node-2"] value 1
f529f7
@@ -346,7 +346,7 @@ ha_cluster.pacemaker.nodes.status.expected_up PMID: 155.3.7 [Whether the node st
f529f7
     Data Type: 32-bit unsigned int  InDom: 155.2 0x26c00002
f529f7
     Semantics: instant  Units: count
f529f7
 Help:
f529f7
-Whether the expected_up status is reportered by the node in the cluster, a
f529f7
+Whether the expected_up status is reported by the node in the cluster, a
f529f7
 value of 1 confirms the node status as expected_up.
f529f7
     inst [0 or "node-1"] value 1
f529f7
     inst [1 or "node-2"] value 1
f529f7
@@ -355,7 +355,7 @@ ha_cluster.pacemaker.nodes.status.maintenance PMID: 155.3.3 [Whether the node st
f529f7
     Data Type: 32-bit unsigned int  InDom: 155.2 0x26c00002
f529f7
     Semantics: instant  Units: count
f529f7
 Help:
f529f7
-Whether the maintenance status is reportered by the node in the cluster, a
f529f7
+Whether the maintenance status is reported by the node in the cluster, a
f529f7
 value of 1 confirms the node status as online.
f529f7
     inst [0 or "node-1"] value 0
f529f7
     inst [1 or "node-2"] value 0
f529f7
@@ -364,7 +364,7 @@ ha_cluster.pacemaker.nodes.status.online PMID: 155.3.0 [Whether the node status
f529f7
     Data Type: 32-bit unsigned int  InDom: 155.2 0x26c00002
f529f7
     Semantics: instant  Units: count
f529f7
 Help:
f529f7
-Whether the online status is reportered by the node in the cluster, a value of
f529f7
+Whether the online status is reported by the node in the cluster, a value of
f529f7
 1 confirms the node status as online.
f529f7
     inst [0 or "node-1"] value 1
f529f7
     inst [1 or "node-2"] value 1
f529f7
@@ -373,7 +373,7 @@ ha_cluster.pacemaker.nodes.status.pending PMID: 155.3.4 [Whether the node status
f529f7
     Data Type: 32-bit unsigned int  InDom: 155.2 0x26c00002
f529f7
     Semantics: instant  Units: count
f529f7
 Help:
f529f7
-Whether the pending status is reportered by the node in the cluster, a value of
f529f7
+Whether the pending status is reported by the node in the cluster, a value of
f529f7
 1 confirms the node status as pending.
f529f7
     inst [0 or "node-1"] value 0
f529f7
     inst [1 or "node-2"] value 0
f529f7
@@ -382,7 +382,7 @@ ha_cluster.pacemaker.nodes.status.shutdown PMID: 155.3.6 [Whether the node statu
f529f7
     Data Type: 32-bit unsigned int  InDom: 155.2 0x26c00002
f529f7
     Semantics: instant  Units: count
f529f7
 Help:
f529f7
-Whether the shutdown status is reportered by the node in the cluster, a value
f529f7
+Whether the shutdown status is reported by the node in the cluster, a value
f529f7
 of 1 confirms the node status as shutdown.
f529f7
     inst [0 or "node-1"] value 0
f529f7
     inst [1 or "node-2"] value 0
f529f7
@@ -391,7 +391,7 @@ ha_cluster.pacemaker.nodes.status.standby PMID: 155.3.1 [Whether the node status
f529f7
     Data Type: 32-bit unsigned int  InDom: 155.2 0x26c00002
f529f7
     Semantics: instant  Units: count
f529f7
 Help:
f529f7
-Whether the standby status is reportered by the node in the cluster, a value of
f529f7
+Whether the standby status is reported by the node in the cluster, a value of
f529f7
 1 confirms the node status as standby.
f529f7
     inst [0 or "node-1"] value 0
f529f7
     inst [1 or "node-2"] value 0
f529f7
@@ -400,7 +400,7 @@ ha_cluster.pacemaker.nodes.status.standby_on_fail PMID: 155.3.2 [Whether the nod
f529f7
     Data Type: 32-bit unsigned int  InDom: 155.2 0x26c00002
f529f7
     Semantics: instant  Units: count
f529f7
 Help:
f529f7
-Whether the standby_on_fail status is reportered by the node in the cluster,
f529f7
+Whether the standby_on_fail status is reported by the node in the cluster,
f529f7
 a value of 1 confirms the node status as standby_on_fail.
f529f7
     inst [0 or "node-1"] value 0
f529f7
     inst [1 or "node-2"] value 0
f529f7
@@ -409,7 +409,7 @@ ha_cluster.pacemaker.nodes.status.unclean PMID: 155.3.5 [Whether the node status
f529f7
     Data Type: 32-bit unsigned int  InDom: 155.2 0x26c00002
f529f7
     Semantics: instant  Units: count
f529f7
 Help:
f529f7
-Whether the unclean status is reportered by the node in the cluster, a value of
f529f7
+Whether the unclean status is reported by the node in the cluster, a value of
f529f7
 1 confirms the node status as unclean.
f529f7
     inst [0 or "node-1"] value 0
f529f7
     inst [1 or "node-2"] value 0
f529f7
@@ -466,7 +466,7 @@ ha_cluster.pacemaker.resources.managed PMID: 155.5.3 [Value is either true or fa
f529f7
     Semantics: instant  Units: count
f529f7
 Help:
f529f7
 The value of whether the resource instance in the cluster is managed or not.
f529f7
-    inst [0 or "my_first_svc:node-1"] value 0
f529f7
+    inst [0 or "my_first_svc:node-1"] value 1
f529f7
     inst [5 or "rsc_TEST:node-1"] value 1
f529f7
     inst [1 or "rsc_Test:node-1"] value 1
f529f7
     inst [2 or "rsc_Test:node-2"] value 1
f529f7
@@ -489,9 +489,9 @@ ha_cluster.pacemaker.resources.status.active PMID: 155.5.5 [Whether the resource
f529f7
     Data Type: 32-bit unsigned int  InDom: 155.4 0x26c00004
f529f7
     Semantics: instant  Units: count
f529f7
 Help:
f529f7
-Whether the active status is reportered by the resource in the cluster, a
f529f7
+Whether the active status is reported by the resource in the cluster, a
f529f7
 value of 1 confirms the resource status as active.
f529f7
-    inst [0 or "my_first_svc:node-1"] value 0
f529f7
+    inst [0 or "my_first_svc:node-1"] value 1
f529f7
     inst [5 or "rsc_TEST:node-1"] value 1
f529f7
     inst [1 or "rsc_Test:node-1"] value 1
f529f7
     inst [2 or "rsc_Test:node-2"] value 1
f529f7
@@ -502,7 +502,7 @@ ha_cluster.pacemaker.resources.status.blocked PMID: 155.5.7 [Whether the resourc
f529f7
     Data Type: 32-bit unsigned int  InDom: 155.4 0x26c00004
f529f7
     Semantics: instant  Units: count
f529f7
 Help:
f529f7
-Whether the blocked status is reportered by the resource in the cluster, a
f529f7
+Whether the blocked status is reported by the resource in the cluster, a
f529f7
 value of 1 confirms the resource status as blocked.
f529f7
     inst [0 or "my_first_svc:node-1"] value 0
f529f7
     inst [5 or "rsc_TEST:node-1"] value 0
f529f7
@@ -515,7 +515,7 @@ ha_cluster.pacemaker.resources.status.failed PMID: 155.5.8 [Whether the resource
f529f7
     Data Type: 32-bit unsigned int  InDom: 155.4 0x26c00004
f529f7
     Semantics: instant  Units: count
f529f7
 Help:
f529f7
-Whether the failed status is reportered by the resource in the cluster, a 
f529f7
+Whether the failed status is reported by the resource in the cluster, a 
f529f7
 value of 1 confirms the resource status as failed.
f529f7
     inst [0 or "my_first_svc:node-1"] value 0
f529f7
     inst [5 or "rsc_TEST:node-1"] value 0
f529f7
@@ -528,7 +528,7 @@ ha_cluster.pacemaker.resources.status.failure_ignored PMID: 155.5.9 [Whether the
f529f7
     Data Type: 32-bit unsigned int  InDom: 155.4 0x26c00004
f529f7
     Semantics: instant  Units: count
f529f7
 Help:
f529f7
-Whether the failure_ignored status is reportered by the resource in the
f529f7
+Whether the failure_ignored status is reported by the resource in the
f529f7
 cluster, a value of 1 confirms the resource status as failure_ignored.
f529f7
     inst [0 or "my_first_svc:node-1"] value 0
f529f7
     inst [5 or "rsc_TEST:node-1"] value 0
f529f7
@@ -541,7 +541,7 @@ ha_cluster.pacemaker.resources.status.orphaned PMID: 155.5.6 [Whether the resour
f529f7
     Data Type: 32-bit unsigned int  InDom: 155.4 0x26c00004
f529f7
     Semantics: instant  Units: count
f529f7
 Help:
f529f7
-Whether the orphaned status is reportered by the resource in the cluster, a
f529f7
+Whether the orphaned status is reported by the resource in the cluster, a
f529f7
 value of 1 confirms the resource status as orphaned.
f529f7
     inst [0 or "my_first_svc:node-1"] value 0
f529f7
     inst [5 or "rsc_TEST:node-1"] value 0
f529f7
diff --git a/src/pmdas/hacluster/help b/src/pmdas/hacluster/help
f529f7
index fa5bf9106..704e940c0 100644
f529f7
--- a/src/pmdas/hacluster/help
f529f7
+++ b/src/pmdas/hacluster/help
f529f7
@@ -64,39 +64,39 @@ Pacemaker internals.
f529f7
 The membership type given to the node in the Pacemaker cluster.
f529f7
 
f529f7
 @ ha_cluster.pacemaker.nodes.status.online Whether the node status is given as online
f529f7
-Whether the online status is reportered by the node in the cluster, a value of
f529f7
+Whether the online status is reported by the node in the cluster, a value of
f529f7
 1 confirms the node status as online.
f529f7
 
f529f7
 @ ha_cluster.pacemaker.nodes.status.standby Whether the node status is given as standby
f529f7
-Whether the standby status is reportered by the node in the cluster, a value of
f529f7
+Whether the standby status is reported by the node in the cluster, a value of
f529f7
 1 confirms the node status as standby.
f529f7
 
f529f7
 @ ha_cluster.pacemaker.nodes.status.standby_on_fail Whether the node status is given as standby_on_fail
f529f7
-Whether the standby_on_fail status is reportered by the node in the cluster,
f529f7
+Whether the standby_on_fail status is reported by the node in the cluster,
f529f7
 a value of 1 confirms the node status as standby_on_fail.
f529f7
 
f529f7
 @ ha_cluster.pacemaker.nodes.status.maintenance Whether the node status is given as maintenance
f529f7
-Whether the maintenance status is reportered by the node in the cluster, a
f529f7
+Whether the maintenance status is reported by the node in the cluster, a
f529f7
 value of 1 confirms the node status as online.
f529f7
 
f529f7
 @ ha_cluster.pacemaker.nodes.status.pending Whether the node status is given as pending
f529f7
-Whether the pending status is reportered by the node in the cluster, a value of
f529f7
+Whether the pending status is reported by the node in the cluster, a value of
f529f7
 1 confirms the node status as pending.
f529f7
 
f529f7
 @ ha_cluster.pacemaker.nodes.status.unclean Whether the node status is given as unclean
f529f7
-Whether the unclean status is reportered by the node in the cluster, a value of
f529f7
+Whether the unclean status is reported by the node in the cluster, a value of
f529f7
 1 confirms the node status as unclean.
f529f7
 
f529f7
 @ ha_cluster.pacemaker.nodes.status.shutdown Whether the node status is given as shutdown
f529f7
-Whether the shutdown status is reportered by the node in the cluster, a value
f529f7
+Whether the shutdown status is reported by the node in the cluster, a value
f529f7
 of 1 confirms the node status as shutdown.
f529f7
 
f529f7
 @ ha_cluster.pacemaker.nodes.status.expected_up Whether the node status is given as expected_up
f529f7
-Whether the expected_up status is reportered by the node in the cluster, a
f529f7
+Whether the expected_up status is reported by the node in the cluster, a
f529f7
 value of 1 confirms the node status as expected_up.
f529f7
 
f529f7
 @ ha_cluster.pacemaker.nodes.status.dc Whether the node status is given as disconnected
f529f7
-Whether the disconnected status is reportered by the node in the cluster, a
f529f7
+Whether the disconnected status is reported by the node in the cluster, a
f529f7
 value of 1 confirms the node status as disconnected.
f529f7
 
f529f7
 @ ha_cluster.pacemaker.resources.agent The name of the resource agent for this resource
f529f7
@@ -118,23 +118,23 @@ The value of whether the resource instance in the cluster is managed or not.
f529f7
 The value of the given role state for the resource instance in the cluster.
f529f7
 
f529f7
 @ ha_cluster.pacemaker.resources.status.active Whether the resources status is given as active
f529f7
-Whether the active status is reportered by the resource in the cluster, a
f529f7
+Whether the active status is reported by the resource in the cluster, a
f529f7
 value of 1 confirms the resource status as active.
f529f7
 
f529f7
 @ ha_cluster.pacemaker.resources.status.orphaned Whether the resources status is given as orphaned
f529f7
-Whether the orphaned status is reportered by the resource in the cluster, a
f529f7
+Whether the orphaned status is reported by the resource in the cluster, a
f529f7
 value of 1 confirms the resource status as orphaned.
f529f7
 
f529f7
 @ ha_cluster.pacemaker.resources.status.blocked Whether the resources status is given as blocked
f529f7
-Whether the blocked status is reportered by the resource in the cluster, a
f529f7
+Whether the blocked status is reported by the resource in the cluster, a
f529f7
 value of 1 confirms the resource status as blocked.
f529f7
 
f529f7
 @ ha_cluster.pacemaker.resources.status.failed Whether the resources status is given as failed
f529f7
-Whether the failed status is reportered by the resource in the cluster, a 
f529f7
+Whether the failed status is reported by the resource in the cluster, a 
f529f7
 value of 1 confirms the resource status as failed.
f529f7
 
f529f7
 @ ha_cluster.pacemaker.resources.status.failure_ignored Whether the resources status is given as failure_ignored
f529f7
-Whether the failure_ignored status is reportered by the resource in the
f529f7
+Whether the failure_ignored status is reported by the resource in the
f529f7
 cluster, a value of 1 confirms the resource status as failure_ignored.
f529f7
 
f529f7
 @ ha_cluster.corosync.quorate Value given for quorate
f529f7
diff --git a/src/pmdas/hacluster/pacemaker.c b/src/pmdas/hacluster/pacemaker.c
f529f7
index 2dc53f8cf..8f8e626a5 100644
f529f7
--- a/src/pmdas/hacluster/pacemaker.c
f529f7
+++ b/src/pmdas/hacluster/pacemaker.c
f529f7
@@ -513,7 +513,7 @@ hacluster_refresh_pacemaker_nodes(const char *node_name, struct nodes *nodes)
f529f7
 
f529f7
 		/* Collect our node names */
f529f7
 		if (found_nodes && strstr(buffer, node_name)) {
f529f7
-			sscanf(buffer, "%*s %*s %*s online=\"%[^\"]\" standby=\"%[^\"]\" standby_onfail=\"%[^\"]\" maintenance=\"%[^\"]\" pending=\"%[^\"]\" unclean=\"%[^\"]\" shutdown=\"%[^\"]\" expected_up=\"%[^\"]\" is_dc =\"%[^\"]\" %*s type=\"%[^\"]\"",
f529f7
+			sscanf(buffer, "%*s %*s %*s online=\"%9[^\"]\" standby=\"%9[^\"]\" standby_onfail=\"%9[^\"]\" maintenance=\"%9[^\"]\" pending=\"%9[^\"]\" unclean=\"%9[^\"]\" shutdown=\"%9[^\"]\" expected_up=\"%9[^\"]\" is_dc =\"%9[^\"]\" %*s type=\"%9[^\"]\"",
f529f7
 				online,
f529f7
 				standby,
f529f7
 				standby_on_fail,
f529f7
@@ -671,19 +671,8 @@ hacluster_refresh_pacemaker_resources(const char *instance_name, struct resource
f529f7
 			/* Collect our metrics */
f529f7
 			if (strstr(buffer, "resource id=") && strstr(buffer, resource_id)) {
f529f7
 
f529f7
-				if(strstr(resources->clone, "\0") || strstr(resources->group, "\0")) {
f529f7
-					sscanf(buffer, "%*s %*s resource_agent=\"%[^\"]\" role=\"%[^\"]\" active=\"%[^\"]\" orphaned=\"%[^\"]\" blocked=\"%[^\"]\" managed=\"%[^\"]\" failed=\"%[^\"]\" failure_ignored=\"%[^\"]\"",
f529f7
-						resources->agent,
f529f7
-						resources->role,
f529f7
-						active,
f529f7
-						orphaned,
f529f7
-						blocked,
f529f7
-						managed,
f529f7
-						failed,
f529f7
-						failure_ignored
f529f7
-					);
f529f7
-				} else if ((strstr(resources->clone, "\0") || strstr(resources->group, "\0")) && strstr(buffer, "target_role")) { 
f529f7
-					sscanf(buffer, "%*s %*s resource_agent=\"%[^\"]\" role=\"%[^\"]\" %*s active=\"%[^\"]\" orphaned=\"%[^\"]\" blocked=\"%[^\"]\" managed=\"%[^\"]\" failed=\"%[^\"]\" failure_ignored=\"%[^\"]\"",
f529f7
+				if (strstr(buffer, "target_role")) { 
f529f7
+					sscanf(buffer, "%*s %*s resource_agent=\"%[^\"]\" role=\"%[^\"]\" %*s active=\"%7[^\"]\" orphaned=\"%7[^\"]\" blocked=\"%7[^\"]\" managed=\"%7[^\"]\" failed=\"%7[^\"]\" failure_ignored=\"%7[^\"]\"",
f529f7
 						resources->agent,
f529f7
 						resources->role,
f529f7
 						active,
f529f7
@@ -694,7 +683,7 @@ hacluster_refresh_pacemaker_resources(const char *instance_name, struct resource
f529f7
 						failure_ignored
f529f7
 					);
f529f7
 				} else {
f529f7
-					sscanf(buffer, "%*s %*s resource_agent=\"%[^\"]\" role=\"%[^\"]\" %*s active=\"%[^\"]\" orphaned=\"%[^\"]\" blocked=\"%[^\"]\" managed=\"%[^\"]\" failed=\"%[^\"]\" failure_ignored=\"%[^\"]\"",
f529f7
+					sscanf(buffer, "%*s %*s resource_agent=\"%[^\"]\" role=\"%[^\"]\" active=\"%7[^\"]\" orphaned=\"%7[^\"]\" blocked=\"%7[^\"]\" managed=\"%7[^\"]\" failed=\"%7[^\"]\" failure_ignored=\"%7[^\"]\"",
f529f7
 						resources->agent,
f529f7
 						resources->role,
f529f7
 						active,
f529f7
-- 
f529f7
2.31.1
f529f7
f529f7
f529f7
From 7f39eb78a86b244a046d7014c744abe21b3bef52 Mon Sep 17 00:00:00 2001
f529f7
From: Paul Evans <pevans@redhat.com>
f529f7
Date: Fri, 9 Apr 2021 21:12:19 +0100
f529f7
Subject: [PATCH 4/7] pmdahacluster: Reduce log messages from popen()
f529f7
f529f7
The PMDA is designed to be able to collect metrics on setups where not all
f529f7
of the HA Cluster components might exist. Suppress some of these logging
f529f7
warnings when certain components are not available on the host system.
f529f7
---
f529f7
 src/pmdas/hacluster/corosync.c  | 20 +++++++--------
f529f7
 src/pmdas/hacluster/drbd.c      |  8 +++---
f529f7
 src/pmdas/hacluster/pacemaker.c | 14 +++++------
f529f7
 src/pmdas/hacluster/pmda.c      | 44 +++++++++++++++++++--------------
f529f7
 src/pmdas/hacluster/sbd.c       |  4 +--
f529f7
 5 files changed, 49 insertions(+), 41 deletions(-)
f529f7
f529f7
diff --git a/src/pmdas/hacluster/corosync.c b/src/pmdas/hacluster/corosync.c
f529f7
index c7964b621..ee0052dee 100644
f529f7
--- a/src/pmdas/hacluster/corosync.c
f529f7
+++ b/src/pmdas/hacluster/corosync.c
f529f7
@@ -139,10 +139,10 @@ hacluster_refresh_corosync_node(const char *node_name, struct member_votes *node
f529f7
 	char *buffer_ptr;
f529f7
 	FILE *pf;
f529f7
 
f529f7
-	pmsprintf(buffer, sizeof(buffer), "%s", quorumtool_command);
f529f7
+	pmsprintf(buffer, sizeof(buffer), "%s 2>&1", quorumtool_command);
f529f7
 
f529f7
 	if ((pf = popen(buffer, "r")) == NULL)
f529f7
-		return -oserror();
f529f7
+		return oserror();
f529f7
 
f529f7
 	while(fgets(buffer, sizeof(buffer)-1, pf) != NULL) {
f529f7
 		if (strstr(buffer, node_name)) {
f529f7
@@ -187,10 +187,10 @@ hacluster_refresh_corosync_global()
f529f7
 	char buffer[4096], quorate[6];
f529f7
 	FILE *pf;
f529f7
 
f529f7
-	pmsprintf(buffer, sizeof(buffer), "%s", quorumtool_command);
f529f7
+	pmsprintf(buffer, sizeof(buffer), "%s 2>&1", quorumtool_command);
f529f7
 
f529f7
 	if ((pf = popen(buffer, "r")) == NULL)
f529f7
-		return -oserror();
f529f7
+		return oserror();
f529f7
 
f529f7
 	while(fgets(buffer, sizeof(buffer)-1, pf) != NULL) {
f529f7
 	
f529f7
@@ -218,10 +218,10 @@ hacluster_refresh_corosync_global()
f529f7
 	}
f529f7
 	pclose(pf);
f529f7
 
f529f7
-	pmsprintf(buffer, sizeof(buffer), "%s", cfgtool_command);
f529f7
+	pmsprintf(buffer, sizeof(buffer), "%s 2>&1", cfgtool_command);
f529f7
 
f529f7
 	if ((pf = popen(buffer, "r")) == NULL)
f529f7
-		return -oserror();
f529f7
+		return oserror();
f529f7
 
f529f7
 	while(fgets(buffer, sizeof(buffer)-1, pf) != NULL) {
f529f7
 
f529f7
@@ -240,10 +240,10 @@ hacluster_refresh_corosync_ring(const char *ring_name, struct rings *rings)
f529f7
 	FILE *pf;	
f529f7
 	int ring_found = 0;
f529f7
 	
f529f7
-	pmsprintf(buffer, sizeof(buffer), "%s", cfgtool_command);
f529f7
+	pmsprintf(buffer, sizeof(buffer), "%s 2>&1", cfgtool_command);
f529f7
 
f529f7
 	if ((pf = popen(buffer, "r")) == NULL)
f529f7
-		return -oserror();
f529f7
+		return oserror();
f529f7
 
f529f7
 	while(fgets(buffer, sizeof(buffer)-1, pf) != NULL) {
f529f7
 
f529f7
@@ -293,10 +293,10 @@ hacluster_refresh_corosync_ring(const char *ring_name, struct rings *rings)
f529f7
 	}
f529f7
 	pclose(pf);
f529f7
 
f529f7
-	pmsprintf(buffer, sizeof(buffer), "%s", quorumtool_command);
f529f7
+	pmsprintf(buffer, sizeof(buffer), "%s 2>&1", quorumtool_command);
f529f7
 
f529f7
 	if ((pf = popen(buffer, "r")) == NULL)
f529f7
-		return -oserror();  
f529f7
+		return oserror();
f529f7
 	
f529f7
 	/* 
f529f7
 	 * Check corosync-quorumtool for our node_id and ring_id values for our
f529f7
diff --git a/src/pmdas/hacluster/drbd.c b/src/pmdas/hacluster/drbd.c
f529f7
index 7fb3b04d0..bec83031c 100644
f529f7
--- a/src/pmdas/hacluster/drbd.c
f529f7
+++ b/src/pmdas/hacluster/drbd.c
f529f7
@@ -156,10 +156,10 @@ hacluster_refresh_drbd_resource(const char *resource_name, struct resource *reso
f529f7
 
f529f7
 	int found_node = 0, found_volume = 0, nesting = 0;
f529f7
 
f529f7
-	pmsprintf(buffer, sizeof(buffer), "%s", drbdsetup_command);
f529f7
+	pmsprintf(buffer, sizeof(buffer), "%s 2>&1", drbdsetup_command);
f529f7
 
f529f7
 	if ((pf = popen(buffer, "r")) == NULL)
f529f7
-		return -oserror();
f529f7
+		return oserror();
f529f7
 
f529f7
 	/* 
f529f7
 	 * We need to split our combined NODE:VOLUME instance names into their
f529f7
@@ -274,10 +274,10 @@ hacluster_refresh_drbd_peer_device(const char *peer_name, struct peer_device *pe
f529f7
 
f529f7
 	int found_node = 0, found_peer_node = 0, nesting = 0;
f529f7
 
f529f7
-	pmsprintf(buffer, sizeof(buffer), "%s", drbdsetup_command);
f529f7
+	pmsprintf(buffer, sizeof(buffer), "%s 2>&1", drbdsetup_command);
f529f7
 
f529f7
 	if ((pf = popen(buffer, "r")) == NULL)
f529f7
-		return -oserror();
f529f7
+		return oserror();
f529f7
 
f529f7
 	/* 
f529f7
 	 * We need to split our combined NODE:PEER_NODE_ID instance names into
f529f7
diff --git a/src/pmdas/hacluster/pacemaker.c b/src/pmdas/hacluster/pacemaker.c
f529f7
index 8f8e626a5..355f4df5c 100644
f529f7
--- a/src/pmdas/hacluster/pacemaker.c
f529f7
+++ b/src/pmdas/hacluster/pacemaker.c
f529f7
@@ -360,7 +360,7 @@ hacluster_refresh_pacemaker_global()
f529f7
 	char last_written_text[128], stonith[6];
f529f7
 	FILE *pf;
f529f7
 
f529f7
-	pmsprintf(buffer, sizeof(buffer), "%s", cibadmin_command);
f529f7
+	pmsprintf(buffer, sizeof(buffer), "%s 2>&1", cibadmin_command);
f529f7
 
f529f7
 	if ((pf = popen(buffer, "r")) == NULL)
f529f7
 		return -oserror();
f529f7
@@ -374,7 +374,7 @@ hacluster_refresh_pacemaker_global()
f529f7
 	}
f529f7
 	pclose(pf);
f529f7
 
f529f7
-	pmsprintf(buffer, sizeof(buffer), "%s", crm_mon_command);
f529f7
+	pmsprintf(buffer, sizeof(buffer), "%s 2>&1", crm_mon_command);
f529f7
 
f529f7
 	if ((pf = popen(buffer, "r")) == NULL)
f529f7
 		return -oserror();
f529f7
@@ -402,7 +402,7 @@ hacluster_refresh_pacemaker_fail(const char *instance_name, struct fail_count *f
f529f7
 	int found_node_history = 0, found_node_name = 0;
f529f7
 	FILE *pf;
f529f7
 
f529f7
-	pmsprintf(buffer, sizeof(buffer), "%s", crm_mon_command);
f529f7
+	pmsprintf(buffer, sizeof(buffer), "%s 2>&1", crm_mon_command);
f529f7
 
f529f7
 	if ((pf = popen(buffer, "r")) == NULL)
f529f7
 		return -oserror();
f529f7
@@ -455,7 +455,7 @@ hacluster_refresh_pacemaker_constraints(const char *constraints_name, struct loc
f529f7
 	int found_constraints = 0;
f529f7
 	FILE *pf;
f529f7
 
f529f7
-	pmsprintf(buffer, sizeof(buffer), "%s", cibadmin_command);
f529f7
+	pmsprintf(buffer, sizeof(buffer), "%s 2>&1", cibadmin_command);
f529f7
 
f529f7
 	if ((pf = popen(buffer, "r")) == NULL)
f529f7
 		return -oserror();
f529f7
@@ -492,7 +492,7 @@ hacluster_refresh_pacemaker_nodes(const char *node_name, struct nodes *nodes)
f529f7
 	char online[10], standby[10], standby_on_fail[10], maintenance[10], pending[10];
f529f7
 	char unclean[10], shutdown[10], expected_up[10], dc[10];
f529f7
 
f529f7
-	pmsprintf(buffer, sizeof(buffer), "%s", crm_mon_command);
f529f7
+	pmsprintf(buffer, sizeof(buffer), "%s 2>&1", crm_mon_command);
f529f7
 
f529f7
 	if ((pf = popen(buffer, "r")) == NULL)
f529f7
 		return -oserror();
f529f7
@@ -549,7 +549,7 @@ hacluster_refresh_pacemaker_node_attribs(const char *attrib_name, struct attribu
f529f7
 	int found_node_attributes = 0, found_node_name = 0;
f529f7
 	FILE *pf;
f529f7
 
f529f7
-	pmsprintf(buffer, sizeof(buffer), "%s", crm_mon_command);
f529f7
+	pmsprintf(buffer, sizeof(buffer), "%s 2>&1", crm_mon_command);
f529f7
 
f529f7
 	if ((pf = popen(buffer, "r")) == NULL)
f529f7
 		return -oserror();
f529f7
@@ -623,7 +623,7 @@ hacluster_refresh_pacemaker_resources(const char *instance_name, struct resource
f529f7
 		node = strsep(&str, ":");
f529f7
 	}
f529f7
 
f529f7
-	pmsprintf(buffer, sizeof(buffer), "%s", crm_mon_command);
f529f7
+	pmsprintf(buffer, sizeof(buffer), "%s 2>&1", crm_mon_command);
f529f7
 
f529f7
 	if ((pf = popen(buffer, "r")) == NULL) {
f529f7
 		if (!no_node_attachment)
f529f7
diff --git a/src/pmdas/hacluster/pmda.c b/src/pmdas/hacluster/pmda.c
f529f7
index 196de2e64..c7ffac6da 100644
f529f7
--- a/src/pmdas/hacluster/pmda.c
f529f7
+++ b/src/pmdas/hacluster/pmda.c
f529f7
@@ -359,10 +359,10 @@ hacluster_pacemaker_fail_instance_refresh(void)
f529f7
 	FILE		*pf;
f529f7
 	pmInDom		indom = INDOM(PACEMAKER_FAIL_INDOM);
f529f7
 
f529f7
-	pmsprintf(buffer, sizeof(buffer), "%s", crm_mon_command);
f529f7
+	pmsprintf(buffer, sizeof(buffer), "%s 2>&1", crm_mon_command);
f529f7
 
f529f7
 	if ((pf = popen(buffer, "r")) == NULL)
f529f7
-		return -oserror();
f529f7
+		return oserror();
f529f7
 
f529f7
 	while(fgets(buffer, sizeof(buffer)-1, pf) != NULL) {
f529f7
 		/* First we need to check whether we are in <node_history> section*/
f529f7
@@ -426,11 +426,11 @@ hacluster_pacemaker_constraints_instance_refresh(void)
f529f7
 	FILE		*pf;
f529f7
 	pmInDom		indom = INDOM(PACEMAKER_CONSTRAINTS_INDOM);
f529f7
 
f529f7
-	pmsprintf(buffer, sizeof(buffer), "%s", cibadmin_command);
f529f7
+	pmsprintf(buffer, sizeof(buffer), "%s 2>&1", cibadmin_command);
f529f7
 	buffer[sizeof(buffer)-1] = '\0';
f529f7
 
f529f7
 	if ((pf = popen(buffer, "r")) == NULL)
f529f7
-		return -oserror();
f529f7
+		return oserror();
f529f7
 
f529f7
 	while(fgets(buffer, sizeof(buffer)-1, pf) != NULL) {
f529f7
 		/* First we need to check whether we are in <constraints> section*/
f529f7
@@ -472,10 +472,10 @@ hacluster_pacemaker_nodes_instance_refresh(void)
f529f7
 	FILE		*pf;
f529f7
 	pmInDom		indom = INDOM(PACEMAKER_NODES_INDOM);
f529f7
 
f529f7
-	pmsprintf(buffer, sizeof(buffer), "%s", crm_mon_command);
f529f7
+	pmsprintf(buffer, sizeof(buffer), "%s 2>&1", crm_mon_command);
f529f7
 
f529f7
 	if ((pf = popen(buffer, "r")) == NULL)
f529f7
-		return -oserror();
f529f7
+		return oserror();
f529f7
 
f529f7
 	while(fgets(buffer, sizeof(buffer)-1, pf) != NULL) {
f529f7
 		/* First we need to check whether we are in <nodes> section*/
f529f7
@@ -525,10 +525,10 @@ hacluster_pacemaker_node_attrib_instance_refresh(void)
f529f7
 	FILE		*pf;
f529f7
 	pmInDom		indom = INDOM(PACEMAKER_NODE_ATTRIB_INDOM);
f529f7
 
f529f7
-	pmsprintf(buffer, sizeof(buffer), "%s", crm_mon_command);
f529f7
+	pmsprintf(buffer, sizeof(buffer), "%s 2>&1", crm_mon_command);
f529f7
 
f529f7
 	if ((pf = popen(buffer, "r")) == NULL)
f529f7
-		return -oserror();
f529f7
+		return oserror();
f529f7
 
f529f7
 	while(fgets(buffer, sizeof(buffer)-1, pf) != NULL) {
f529f7
 		/* First we need to check whether we are in <node_history> section*/
f529f7
@@ -598,10 +598,10 @@ hacluster_pacemaker_resources_instance_refresh(void)
f529f7
 	FILE		*pf;
f529f7
 	pmInDom		indom= INDOM(PACEMAKER_RESOURCES_INDOM);
f529f7
 
f529f7
-	pmsprintf(buffer, sizeof(buffer), "%s", crm_mon_command);
f529f7
+	pmsprintf(buffer, sizeof(buffer), "%s 2>&1", crm_mon_command);
f529f7
 
f529f7
 	if ((pf = popen(buffer, "r")) == NULL)
f529f7
-		return -oserror();
f529f7
+		return oserror();
f529f7
 
f529f7
 	while(fgets(buffer, sizeof(buffer)-1, pf) != NULL) {
f529f7
 		/* First we need to check whether we are in <resources> section*/
f529f7
@@ -676,9 +676,11 @@ hacluster_corosync_node_instance_refresh(void)
f529f7
 	 * membership information section of corosync-quorumtool output
f529f7
 	 */
f529f7
 	pmdaCacheOp(indom, PMDA_CACHE_INACTIVE);
f529f7
+	
f529f7
+	pmsprintf(buffer, sizeof(buffer), "%s 2>&1", quorumtool_command);
f529f7
 
f529f7
-	if ((pf = popen(quorumtool_command, "r")) == NULL)
f529f7
-		return -oserror();
f529f7
+	if ((pf = popen(buffer, "r")) == NULL)
f529f7
+		return oserror();
f529f7
 
f529f7
 	while (fgets(buffer, sizeof(buffer)-1, pf) != NULL) {
f529f7
 		/* Clear whitespace at start of each line */
f529f7
@@ -735,8 +737,10 @@ hacluster_corosync_ring_instance_refresh(void)
f529f7
 	 */
f529f7
 	pmdaCacheOp(indom, PMDA_CACHE_INACTIVE);
f529f7
 	
f529f7
-	if ((pf = popen(cfgtool_command, "r")) == NULL)
f529f7
-		return -oserror();
f529f7
+	pmsprintf(buffer, sizeof(buffer), "%s 2>&1", cfgtool_command);
f529f7
+	
f529f7
+	if ((pf = popen(buffer, "r")) == NULL)
f529f7
+		return oserror();
f529f7
 
f529f7
 	while(fgets(buffer, sizeof(buffer)-1, pf) != NULL) {
f529f7
 
f529f7
@@ -865,8 +869,10 @@ hacluster_drbd_resource_instance_refresh(void)
f529f7
 	 */
f529f7
 	pmdaCacheOp(indom, PMDA_CACHE_INACTIVE);
f529f7
 	
f529f7
-	if ((pf = popen(drbdsetup_command, "r")) == NULL)
f529f7
-		return -oserror();
f529f7
+	pmsprintf(buffer, sizeof(buffer), "%s 2>&1", drbdsetup_command);
f529f7
+	
f529f7
+	if ((pf = popen(buffer, "r")) == NULL)
f529f7
+		return oserror();
f529f7
 
f529f7
 	while(fgets(buffer, sizeof(buffer)-1, pf) != NULL) {
f529f7
 		/* Clear whitespace at start of each line */
f529f7
@@ -940,8 +946,10 @@ hacluster_drbd_peer_device_instance_refresh(void)
f529f7
 	 */
f529f7
 	pmdaCacheOp(indom, PMDA_CACHE_INACTIVE);
f529f7
 
f529f7
-	if ((pf = popen(drbdsetup_command, "r")) == NULL)
f529f7
-		return -oserror();
f529f7
+	pmsprintf(buffer, sizeof(buffer), "%s 2>&1", drbdsetup_command);
f529f7
+
f529f7
+	if ((pf = popen(buffer, "r")) == NULL)
f529f7
+		return oserror();
f529f7
 
f529f7
 	while(fgets(buffer, sizeof(buffer)-1, pf) != NULL) {
f529f7
 		/* Clear whitespace at start of each line */
f529f7
diff --git a/src/pmdas/hacluster/sbd.c b/src/pmdas/hacluster/sbd.c
f529f7
index 5f55d0734..2824f6589 100644
f529f7
--- a/src/pmdas/hacluster/sbd.c
f529f7
+++ b/src/pmdas/hacluster/sbd.c
f529f7
@@ -74,10 +74,10 @@ hacluster_refresh_sbd_device(const char *sbd_dev, struct sbd *sbd)
f529f7
 	char buffer[4096];
f529f7
 	FILE *pf;
f529f7
 
f529f7
-	pmsprintf(buffer, sizeof(buffer), "%s -d %s dump", sbd_command, sbd_dev);
f529f7
+	pmsprintf(buffer, sizeof(buffer), "%s -d %s dump 2>&1", sbd_command, sbd_dev);
f529f7
 
f529f7
 	if ((pf = popen(buffer, "r")) == NULL)
f529f7
-		return -oserror();
f529f7
+		return oserror();
f529f7
 
f529f7
 	strncpy(sbd->path, sbd_dev, sizeof(sbd->path));
f529f7
 	sbd->path[sizeof(sbd->path)-1] = '\0';
f529f7
-- 
f529f7
2.31.1
f529f7
f529f7
f529f7
From 91241a5f76fc83895621fe35f399b5dcd97e796e Mon Sep 17 00:00:00 2001
f529f7
From: Paul Evans <pevans@redhat.com>
f529f7
Date: Fri, 18 Jun 2021 00:30:39 +0100
f529f7
Subject: [PATCH 5/7] pmdahacluster: Add support for labels on key metrics
f529f7
f529f7
Introduction of a number of labels on some metrics allowing the export
f529f7
of metadata in cases where PM_TYPE_STRING is not supported.
f529f7
f529f7
This will allow information including Pacemaker location constraint data and
f529f7
others to be successfully exported in pmproxy using the OpenMetrics API.
f529f7
f529f7
Satisfies RHBZ# 1972277: PCP - PMDA HA Cluster (pcp-pmda-hacluster) - unable
f529f7
to export pacemaker location constraints data due to unsupported metric type
f529f7
---
f529f7
 qa/1897.out                         |  66 ++++-
f529f7
 src/pmdas/hacluster/corosync.c      |   7 +
f529f7
 src/pmdas/hacluster/corosync.h      |   1 +
f529f7
 src/pmdas/hacluster/drbd.c          |  14 ++
f529f7
 src/pmdas/hacluster/drbd.h          |   2 +
f529f7
 src/pmdas/hacluster/help            |  30 ++-
f529f7
 src/pmdas/hacluster/pacemaker.c     |  21 ++
f529f7
 src/pmdas/hacluster/pacemaker.h     |   3 +
f529f7
 src/pmdas/hacluster/pmda.c          | 369 ++++++++++++++++++++++++++--
f529f7
 src/pmdas/hacluster/pmdahacluster.h |  58 +++--
f529f7
 src/pmdas/hacluster/pmns            | 119 ++++-----
f529f7
 src/pmdas/hacluster/sbd.c           |   7 +
f529f7
 src/pmdas/hacluster/sbd.h           |   1 +
f529f7
 13 files changed, 602 insertions(+), 96 deletions(-)
f529f7
f529f7
diff --git a/qa/1897.out b/qa/1897.out
f529f7
index 054b1e92f..b757e857a 100644
f529f7
--- a/qa/1897.out
f529f7
+++ b/qa/1897.out
f529f7
@@ -76,6 +76,14 @@ Help:
f529f7
 The IP address locally linked to this ring.
f529f7
     inst [0 or "0"] value "192.168.122.101"
f529f7
 
f529f7
+ha_cluster.corosync.rings.all PMID: 155.15.0 [Corosync rings information]
f529f7
+    Data Type: 32-bit unsigned int  InDom: 155.13 0x26c0000d
f529f7
+    Semantics: instant  Units: count
f529f7
+Help:
f529f7
+Value is 1 if a ring exists. The details of the corrosponding ring
f529f7
+is given as label metadata values for this metric.
f529f7
+    inst [0 or "0"] value 1
f529f7
+
f529f7
 ha_cluster.corosync.rings.node_id PMID: 155.8.2 [ID of the local node]
f529f7
     Data Type: 64-bit unsigned int  InDom: 155.6 0x26c00006
f529f7
     Semantics: instant  Units: count
f529f7
@@ -120,6 +128,14 @@ Help:
f529f7
 Amount of writes to the bitmap area of metadata by the DRBD resource:volume.
f529f7
     inst [0 or "drbd1:0"] value 0
f529f7
 
f529f7
+ha_cluster.drbd.connections.all PMID: 155.18.0 [DRBD Peer disk information]
f529f7
+    Data Type: 32-bit unsigned int  InDom: 155.16 0x26c00010
f529f7
+    Semantics: instant  Units: count
f529f7
+Help:
f529f7
+Value is 1 if a drbd peer connection exists. The details of the corrosponding DRBD peer
f529f7
+connection is given as label metadata values for this metric.
f529f7
+    inst [0 or "drbd1:1"] value 1
f529f7
+
f529f7
 ha_cluster.drbd.connections.peer_disk_state PMID: 155.11.4 [Peer disk state]
f529f7
     Data Type: string  InDom: 155.9 0x26c00009
f529f7
     Semantics: instant  Units: count
f529f7
@@ -218,6 +234,14 @@ Help:
f529f7
 Amount in KiB read by the DRBD resource:volume.
f529f7
     inst [0 or "drbd1:0"] value 1888160
f529f7
 
f529f7
+ha_cluster.drbd.resources.all PMID: 155.17.0 [DRBD resource information]
f529f7
+    Data Type: 32-bit unsigned int  InDom: 155.15 0x26c0000f
f529f7
+    Semantics: instant  Units: count
f529f7
+Help:
f529f7
+Value is 1 if a drbd resource exists. The details of the corrosponding drbd resource
f529f7
+is given as label metadata values for this metric.
f529f7
+    inst [0 or "drbd1:0"] value 1
f529f7
+
f529f7
 ha_cluster.drbd.resources.disk_state PMID: 155.10.3 [Disk state]
f529f7
     Data Type: string  InDom: 155.8 0x26c00008
f529f7
     Semantics: instant  Units: count
f529f7
@@ -285,6 +309,14 @@ The number of fail count per node and resource ID, the actual maximum value
f529f7
 depends on Pacemaker internals.
f529f7
     inst [0 or "node-1:my_first_svc"] value 0
f529f7
 
f529f7
+ha_cluster.pacemaker.location_constraints.all PMID: 155.12.0 [Location constraint information]
f529f7
+    Data Type: 32-bit unsigned int  InDom: 155.10 0x26c0000a
f529f7
+    Semantics: instant  Units: count
f529f7
+Help:
f529f7
+Value is 1 if a location constraint exists. The details of the location constraint
f529f7
+is given as label metadata values for this metric.
f529f7
+    inst [0 or "test"] value 1
f529f7
+
f529f7
 ha_cluster.pacemaker.location_constraints.node PMID: 155.2.0 [Node of the location constraint]
f529f7
     Data Type: string  InDom: 155.1 0x26c00001
f529f7
     Semantics: instant  Units: count
f529f7
@@ -327,12 +359,23 @@ ha_cluster.pacemaker.node_attributes PMID: 155.4.0 [Metadata used by Resource Ag
f529f7
     Semantics: instant  Units: count
f529f7
 Help:
f529f7
 The raw values for the cluster metadata attributes and their value per node as
f529f7
-used by the Resource Agents. 
f529f7
+used by the Resource Agents.
f529f7
     inst [0 or "node-1:test_clone_state"] value "PROMOTED"
f529f7
     inst [1 or "node-1:test_site"] value "PRIMARY_SITE_NAME"
f529f7
     inst [2 or "node-2:test_clone_state"] value "DEMOTED"
f529f7
     inst [3 or "node-2:test_site"] value "SECONDARY_SITE_NAME"
f529f7
 
f529f7
+ha_cluster.pacemaker.node_attributes_all PMID: 155.13.0 [Metadata information]
f529f7
+    Data Type: 32-bit unsigned int  InDom: 155.11 0x26c0000b
f529f7
+    Semantics: instant  Units: count
f529f7
+Help:
f529f7
+Value is 1 if a node metadata exists. The details of the node metadata
f529f7
+is given as label metadata values for this metric.
f529f7
+    inst [0 or "node-1:test_clone_state"] value 1
f529f7
+    inst [1 or "node-1:test_site"] value 1
f529f7
+    inst [2 or "node-2:test_clone_state"] value 1
f529f7
+    inst [3 or "node-2:test_site"] value 1
f529f7
+
f529f7
 ha_cluster.pacemaker.nodes.status.dc PMID: 155.3.8 [Whether the node status is given as disconnected]
f529f7
     Data Type: 32-bit unsigned int  InDom: 155.2 0x26c00002
f529f7
     Semantics: instant  Units: count
f529f7
@@ -435,6 +478,19 @@ cluster.
f529f7
     inst [4 or "rsc_fs_TEST:node-1"] value "ocf::heartbeat:Filesystem"
f529f7
     inst [3 or "rsc_ip_TEST:node-1"] value "ocf::heartbeat:IPaddr2"
f529f7
 
f529f7
+ha_cluster.pacemaker.resources.all PMID: 155.14.0 [Pacemaker resources information]
f529f7
+    Data Type: 32-bit unsigned int  InDom: 155.12 0x26c0000c
f529f7
+    Semantics: instant  Units: count
f529f7
+Help:
f529f7
+Value is 1 if a resources exists. The details of the resource
f529f7
+is given as label metadata values for this metric.
f529f7
+    inst [0 or "my_first_svc:node-1"] value 1
f529f7
+    inst [5 or "rsc_TEST:node-1"] value 1
f529f7
+    inst [1 or "rsc_Test:node-1"] value 1
f529f7
+    inst [2 or "rsc_Test:node-2"] value 1
f529f7
+    inst [4 or "rsc_fs_TEST:node-1"] value 1
f529f7
+    inst [3 or "rsc_ip_TEST:node-1"] value 1
f529f7
+
f529f7
 ha_cluster.pacemaker.resources.clone PMID: 155.5.1 [The name of the clone given for this resource]
f529f7
     Data Type: string  InDom: 155.4 0x26c00004
f529f7
     Semantics: instant  Units: count
f529f7
@@ -557,6 +613,14 @@ Help:
f529f7
 Value returns as to whether stonith is enabled or disabled for the cluster.
f529f7
     value 0
f529f7
 
f529f7
+ha_cluster.sbd.all PMID: 155.16.0 [SBD device information]
f529f7
+    Data Type: 32-bit unsigned int  InDom: 155.14 0x26c0000e
f529f7
+    Semantics: instant  Units: count
f529f7
+Help:
f529f7
+Value is 1 if a sbd device exists. The details of the corrosponding SBD device
f529f7
+is given as label metadata values for this metric.
f529f7
+    inst [0 or "/dev/vdb"] value 1
f529f7
+
f529f7
 ha_cluster.sbd.devices.path PMID: 155.9.0 [Path of SBD device]
f529f7
     Data Type: string  InDom: 155.7 0x26c00007
f529f7
     Semantics: instant  Units: count
f529f7
diff --git a/src/pmdas/hacluster/corosync.c b/src/pmdas/hacluster/corosync.c
f529f7
index ee0052dee..5549e59b9 100644
f529f7
--- a/src/pmdas/hacluster/corosync.c
f529f7
+++ b/src/pmdas/hacluster/corosync.c
f529f7
@@ -132,6 +132,13 @@ hacluster_corosync_ring_fetch(int item, struct rings *rings, pmAtomValue *atom)
f529f7
 	return PMDA_FETCH_NOVALUES;
f529f7
 }
f529f7
 
f529f7
+int
f529f7
+hacluster_corosync_ring_all_fetch(int item, pmAtomValue *atom)
f529f7
+{
f529f7
+	atom->ul = 1; /* Assign default exists value 1 */
f529f7
+	return PMDA_FETCH_STATIC;
f529f7
+}
f529f7
+
f529f7
 int
f529f7
 hacluster_refresh_corosync_node(const char *node_name, struct member_votes *node)
f529f7
 {
f529f7
diff --git a/src/pmdas/hacluster/corosync.h b/src/pmdas/hacluster/corosync.h
f529f7
index f3d265d17..11c3b3b45 100644
f529f7
--- a/src/pmdas/hacluster/corosync.h
f529f7
+++ b/src/pmdas/hacluster/corosync.h
f529f7
@@ -73,6 +73,7 @@ extern int hacluster_corosync_global_fetch(int, pmAtomValue *);
f529f7
 extern int hacluster_refresh_corosync_global();
f529f7
 
f529f7
 extern int hacluster_corosync_ring_fetch(int, struct rings *, pmAtomValue *);
f529f7
+extern int hacluster_corosync_ring_all_fetch(int, pmAtomValue *);
f529f7
 extern int hacluster_refresh_corosync_ring(const char *, struct rings *);
f529f7
 
f529f7
 extern void corosync_stats_setup(void);
f529f7
diff --git a/src/pmdas/hacluster/drbd.c b/src/pmdas/hacluster/drbd.c
f529f7
index bec83031c..2c18a5fae 100644
f529f7
--- a/src/pmdas/hacluster/drbd.c
f529f7
+++ b/src/pmdas/hacluster/drbd.c
f529f7
@@ -90,6 +90,13 @@ hacluster_drbd_resource_fetch(int item, struct resource *resource, pmAtomValue *
f529f7
 	return PMDA_FETCH_NOVALUES;
f529f7
 }
f529f7
 
f529f7
+int
f529f7
+hacluster_drbd_resource_all_fetch(int item, pmAtomValue *atom)
f529f7
+{
f529f7
+	atom->ul = 1; /* Assign default exists value 1 */
f529f7
+	return PMDA_FETCH_STATIC;
f529f7
+}
f529f7
+
f529f7
 int
f529f7
 hacluster_drbd_peer_device_fetch(int item, struct peer_device *peer_device, pmAtomValue *atom)
f529f7
 {
f529f7
@@ -146,6 +153,13 @@ hacluster_drbd_peer_device_fetch(int item, struct peer_device *peer_device, pmAt
f529f7
 	return PMDA_FETCH_NOVALUES;
f529f7
 }
f529f7
 
f529f7
+int
f529f7
+hacluster_drbd_peer_device_all_fetch(int item, pmAtomValue *atom)
f529f7
+{
f529f7
+	atom->ul = 1; /* Assign default exists value 1 */
f529f7
+	return PMDA_FETCH_STATIC;
f529f7
+}
f529f7
+
f529f7
 int
f529f7
 hacluster_refresh_drbd_resource(const char *resource_name, struct resource *resource)
f529f7
 {
f529f7
diff --git a/src/pmdas/hacluster/drbd.h b/src/pmdas/hacluster/drbd.h
f529f7
index 0cb687e78..35a2a898c 100644
f529f7
--- a/src/pmdas/hacluster/drbd.h
f529f7
+++ b/src/pmdas/hacluster/drbd.h
f529f7
@@ -83,9 +83,11 @@ struct peer_device {
f529f7
 };
f529f7
 
f529f7
 extern int hacluster_drbd_resource_fetch(int, struct resource *, pmAtomValue *);
f529f7
+extern int hacluster_drbd_resource_all_fetch(int, pmAtomValue *);
f529f7
 extern int hacluster_refresh_drbd_resource(const char *, struct resource *);
f529f7
 
f529f7
 extern int hacluster_drbd_peer_device_fetch(int, struct peer_device *, pmAtomValue *);
f529f7
+extern int hacluster_drbd_peer_device_all_fetch(int, pmAtomValue *);
f529f7
 extern int hacluster_refresh_drbd_peer_device(const char *, struct peer_device *);
f529f7
 
f529f7
 extern void drbd_stats_setup(void);
f529f7
diff --git a/src/pmdas/hacluster/help b/src/pmdas/hacluster/help
f529f7
index 704e940c0..bdcd68e5f 100644
f529f7
--- a/src/pmdas/hacluster/help
f529f7
+++ b/src/pmdas/hacluster/help
f529f7
@@ -42,7 +42,11 @@ Pacemaker cluster.
f529f7
 
f529f7
 @ ha_cluster.pacemaker.node_attributes Metadata used by Resource Agents
f529f7
 The raw values for the cluster metadata attributes and their value per node as
f529f7
-used by the Resource Agents. 
f529f7
+used by the Resource Agents.
f529f7
+
f529f7
+@ ha_cluster.pacemaker.node_attributes_all Metadata information
f529f7
+Value is 1 if a node metadata exists. The details of the node metadata
f529f7
+is given as label metadata values for this metric.
f529f7
 
f529f7
 @ ha_cluster.pacemaker.stonith_enabled Whether stonith is enabled in the cluster
f529f7
 Value returns as to whether stonith is enabled or disabled for the cluster.
f529f7
@@ -60,6 +64,10 @@ The resource role that the location contraint applies to, if any.
f529f7
 The score given to the location constraint by Pacemaker, the value depends on
f529f7
 Pacemaker internals.
f529f7
 
f529f7
+@ ha_cluster.pacemaker.location_constraints.all Location constraint information
f529f7
+Value is 1 if a location constraint exists. The details of the location constraint
f529f7
+is given as label metadata values for this metric.
f529f7
+
f529f7
 @ ha_cluster.pacemaker.nodes.type The type given to the node
f529f7
 The membership type given to the node in the Pacemaker cluster.
f529f7
 
f529f7
@@ -137,6 +145,10 @@ value of 1 confirms the resource status as failed.
f529f7
 Whether the failure_ignored status is reported by the resource in the
f529f7
 cluster, a value of 1 confirms the resource status as failure_ignored.
f529f7
 
f529f7
+@ ha_cluster.pacemaker.resources.all Pacemaker resources information
f529f7
+Value is 1 if a resources exists. The details of the resource
f529f7
+is given as label metadata values for this metric.
f529f7
+
f529f7
 @ ha_cluster.corosync.quorate Value given for quorate
f529f7
 The value represents whether or not the cluster is quorate.
f529f7
 
f529f7
@@ -180,6 +192,10 @@ The number for the Corosync ring.
f529f7
 @ ha_cluster.corosync.rings.ring_id Ring ID
f529f7
 The internal Corosync ring ID, corresponds to the first node to join.
f529f7
 
f529f7
+@ ha_cluster.corosync.rings.all Corosync rings information
f529f7
+Value is 1 if a ring exists. The details of the corrosponding ring
f529f7
+is given as label metadata values for this metric.
f529f7
+
f529f7
 @ ha_cluster.sbd.devices.path Path of SBD device
f529f7
 The full path given to each SBD device.
f529f7
 
f529f7
@@ -187,6 +203,10 @@ The full path given to each SBD device.
f529f7
 The current status given for each of the SBD devices, the value is one of
f529f7
 healthy or unhealthy.
f529f7
 
f529f7
+@ ha_cluster.sbd.all SBD device information
f529f7
+Value is 1 if a sbd device exists. The details of the corrosponding SBD device
f529f7
+is given as label metadata values for this metric.
f529f7
+
f529f7
 @ ha_cluster.sbd.timeouts.mgswait mgswait timeout value
f529f7
 The value threshold for msgwait timeouts for the given SBD device.
f529f7
 
f529f7
@@ -260,6 +280,10 @@ The volume number of ther resource for each resource:volume.
f529f7
 @ ha_cluster.drbd.resources.disk_state Disk state
f529f7
 The current reported disk state of for the resource:volume.
f529f7
 
f529f7
+@ ha_cluster.drbd.resources.all DRBD resource information
f529f7
+Value is 1 if a drbd resource exists. The details of the corrosponding drbd resource
f529f7
+is given as label metadata values for this metric.
f529f7
+
f529f7
 @ ha_cluster.drbd.connections.resource Resource that the connection is for
f529f7
 The given resource that the DRBD connection is for each resource:volume.
f529f7
 
f529f7
@@ -274,3 +298,7 @@ The reported volume for the connection.
f529f7
 
f529f7
 @ ha_cluster.drbd.connections.peer_disk_state Peer disk state
f529f7
 The reported peer disk state for the connection.
f529f7
+
f529f7
+@ ha_cluster.drbd.connections.all DRBD Peer disk information
f529f7
+Value is 1 if a drbd peer connection exists. The details of the corrosponding DRBD peer
f529f7
+connection is given as label metadata values for this metric.
f529f7
diff --git a/src/pmdas/hacluster/pacemaker.c b/src/pmdas/hacluster/pacemaker.c
f529f7
index 355f4df5c..beff98b83 100644
f529f7
--- a/src/pmdas/hacluster/pacemaker.c
f529f7
+++ b/src/pmdas/hacluster/pacemaker.c
f529f7
@@ -221,6 +221,13 @@ hacluster_pacemaker_constraints_fetch(int item, struct location_constraints *loc
f529f7
 	return PMDA_FETCH_NOVALUES;
f529f7
 }
f529f7
 
f529f7
+int
f529f7
+hacluster_pacemaker_constraints_all_fetch(int item, pmAtomValue *atom)
f529f7
+{
f529f7
+	atom->ul = 1; /* Assign default exists value 1 */
f529f7
+	return PMDA_FETCH_STATIC;
f529f7
+}
f529f7
+
f529f7
 int
f529f7
 hacluster_pacemaker_nodes_fetch(int item, struct nodes *nodes, pmAtomValue *atom)
f529f7
 {
f529f7
@@ -297,6 +304,13 @@ hacluster_pacemaker_node_attribs_fetch(int item, struct attributes *attributes,
f529f7
 	return PMDA_FETCH_NOVALUES;
f529f7
 }
f529f7
 
f529f7
+int
f529f7
+hacluster_pacemaker_node_attribs_all_fetch(int item, pmAtomValue *atom)
f529f7
+{
f529f7
+	atom->ul = 1; /* Assign default exists value 1 */
f529f7
+	return PMDA_FETCH_STATIC;
f529f7
+}
f529f7
+
f529f7
 int
f529f7
 hacluster_pacemaker_resources_fetch(int item, struct resources *resources, pmAtomValue *atom)
f529f7
 {
f529f7
@@ -353,6 +367,13 @@ hacluster_pacemaker_resources_fetch(int item, struct resources *resources, pmAto
f529f7
 	return PMDA_FETCH_NOVALUES;
f529f7
 }
f529f7
 
f529f7
+int
f529f7
+hacluster_pacemaker_resources_all_fetch(int item, pmAtomValue *atom)
f529f7
+{
f529f7
+	atom->ul = 1; /* Assign default exists value 1 */
f529f7
+	return PMDA_FETCH_STATIC;
f529f7
+}
f529f7
+
f529f7
 int
f529f7
 hacluster_refresh_pacemaker_global()
f529f7
 {
f529f7
diff --git a/src/pmdas/hacluster/pacemaker.h b/src/pmdas/hacluster/pacemaker.h
f529f7
index fe175e37f..0bd2a7e0f 100644
f529f7
--- a/src/pmdas/hacluster/pacemaker.h
f529f7
+++ b/src/pmdas/hacluster/pacemaker.h
f529f7
@@ -124,15 +124,18 @@ extern int hacluster_pacemaker_fail_fetch(int, struct fail_count *, pmAtomValue
f529f7
 extern int hacluster_refresh_pacemaker_fail(const char *, struct fail_count *);
f529f7
 
f529f7
 extern int hacluster_pacemaker_constraints_fetch(int, struct location_constraints *, pmAtomValue *);
f529f7
+extern int hacluster_pacemaker_constraints_all_fetch(int, pmAtomValue *);
f529f7
 extern int hacluster_refresh_pacemaker_constraints(const char *, struct location_constraints *);
f529f7
 
f529f7
 extern int hacluster_pacemaker_nodes_fetch(int, struct nodes *, pmAtomValue *);
f529f7
 extern int hacluster_refresh_pacemaker_nodes(const char *, struct nodes *);
f529f7
 
f529f7
 extern int hacluster_pacemaker_node_attribs_fetch(int, struct attributes *, pmAtomValue *);
f529f7
+extern int hacluster_pacemaker_node_attribs_all_fetch(int, pmAtomValue *);
f529f7
 extern int hacluster_refresh_pacemaker_node_attribs(const char *, struct attributes *);
f529f7
 
f529f7
 extern int hacluster_pacemaker_resources_fetch(int, struct resources *, pmAtomValue *);
f529f7
+extern int hacluster_pacemaker_resources_all_fetch(int, pmAtomValue *);
f529f7
 extern int hacluster_refresh_pacemaker_resources(const char *, struct resources *);
f529f7
 
f529f7
 extern void pacemaker_stats_setup(void);
f529f7
diff --git a/src/pmdas/hacluster/pmda.c b/src/pmdas/hacluster/pmda.c
f529f7
index c7ffac6da..6c9163b25 100644
f529f7
--- a/src/pmdas/hacluster/pmda.c
f529f7
+++ b/src/pmdas/hacluster/pmda.c
f529f7
@@ -42,6 +42,13 @@ pmdaIndom indomtable[] = {
f529f7
 	{ .it_indom = SBD_DEVICE_INDOM },
f529f7
 	{ .it_indom = DRBD_RESOURCE_INDOM },
f529f7
 	{ .it_indom = DRBD_PEER_DEVICE_INDOM },
f529f7
+	{ .it_indom = PACEMAKER_CONSTRAINTS_ALL_INDOM },
f529f7
+	{ .it_indom = PACEMAKER_NODE_ATTRIB_ALL_INDOM },
f529f7
+	{ .it_indom = PACEMAKER_RESOURCES_ALL_INDOM },
f529f7
+	{ .it_indom = COROSYNC_RING_ALL_INDOM},
f529f7
+	{ .it_indom = SBD_DEVICE_ALL_INDOM},
f529f7
+	{ .it_indom = DRBD_RESOURCE_ALL_INDOM},
f529f7
+	{ .it_indom = DRBD_PEER_DEVICE_ALL_INDOM},
f529f7
 };
f529f7
 
f529f7
 #define INDOM(x) (indomtable[x].it_indom)
f529f7
@@ -83,6 +90,10 @@ pmdaMetric metrictable[] = {
f529f7
 		PMDA_PMID(CLUSTER_PACEMAKER_CONSTRAINTS, PACEMAKER_CONSTRAINTS_SCORE),
f529f7
 		PM_TYPE_STRING, PACEMAKER_CONSTRAINTS_INDOM, PM_SEM_INSTANT,
f529f7
 		PMDA_PMUNITS(0,0,1,0,0,PM_COUNT_ONE) } },
f529f7
+	{ .m_desc = {
f529f7
+		PMDA_PMID(CLUSTER_PACEMAKER_CONSTRAINTS_ALL, 0),
f529f7
+		PM_TYPE_U32, PACEMAKER_CONSTRAINTS_ALL_INDOM, PM_SEM_INSTANT,
f529f7
+		PMDA_PMUNITS(0,0,1,0,0,PM_COUNT_ONE) } },
f529f7
 	{ .m_desc = {
f529f7
 		PMDA_PMID(CLUSTER_PACEMAKER_NODES, PACEMAKER_NODES_ONLINE),
f529f7
 		PM_TYPE_U32, PACEMAKER_NODES_INDOM, PM_SEM_INSTANT,
f529f7
@@ -127,6 +138,10 @@ pmdaMetric metrictable[] = {
f529f7
 		PMDA_PMID(CLUSTER_PACEMAKER_NODE_ATTRIB, PACEMAKER_NODES_ATTRIB_VALUE),
f529f7
 		PM_TYPE_STRING, PACEMAKER_NODE_ATTRIB_INDOM, PM_SEM_INSTANT,
f529f7
 		PMDA_PMUNITS(0,0,1,0,0,PM_COUNT_ONE) } },
f529f7
+	{ .m_desc = {
f529f7
+		PMDA_PMID(CLUSTER_PACEMAKER_NODE_ATTRIB_ALL, 0),
f529f7
+		PM_TYPE_U32, PACEMAKER_NODE_ATTRIB_ALL_INDOM, PM_SEM_INSTANT,
f529f7
+		PMDA_PMUNITS(0,0,1,0,0,PM_COUNT_ONE) } },	
f529f7
 	{ .m_desc = {
f529f7
 		PMDA_PMID(CLUSTER_PACEMAKER_RESOURCES, PACEMAKER_RESOURCES_AGENT),
f529f7
 		PM_TYPE_STRING, PACEMAKER_RESOURCES_INDOM, PM_SEM_INSTANT,
f529f7
@@ -139,6 +154,10 @@ pmdaMetric metrictable[] = {
f529f7
 		PMDA_PMID(CLUSTER_PACEMAKER_RESOURCES, PACEMAKER_RESOURCES_GROUP),
f529f7
 		PM_TYPE_STRING, PACEMAKER_RESOURCES_INDOM, PM_SEM_INSTANT,
f529f7
 		PMDA_PMUNITS(0,0,1,0,0,PM_COUNT_ONE) } },
f529f7
+	{ .m_desc = {
f529f7
+		PMDA_PMID(CLUSTER_PACEMAKER_RESOURCES_ALL, 0),
f529f7
+		PM_TYPE_U32, PACEMAKER_RESOURCES_ALL_INDOM, PM_SEM_INSTANT,
f529f7
+		PMDA_PMUNITS(0,0,1,0,0,PM_COUNT_ONE) } },
f529f7
 	{ .m_desc = {
f529f7
 		PMDA_PMID(CLUSTER_PACEMAKER_RESOURCES, PACEMAKER_RESOURCES_MANAGED),
f529f7
 		PM_TYPE_U32, PACEMAKER_RESOURCES_INDOM, PM_SEM_INSTANT,
f529f7
@@ -228,6 +247,10 @@ pmdaMetric metrictable[] = {
f529f7
 		PMDA_PMID(CLUSTER_COROSYNC_RING, COROSYNC_RINGS_RING_ID),
f529f7
 		PM_TYPE_STRING, COROSYNC_RING_INDOM, PM_SEM_INSTANT,
f529f7
 		PMDA_PMUNITS(0,0,1,0,0,PM_COUNT_ONE) } },
f529f7
+	{ .m_desc = {
f529f7
+		PMDA_PMID(CLUSTER_COROSYNC_RING_ALL, 0),
f529f7
+		PM_TYPE_U32, COROSYNC_RING_ALL_INDOM, PM_SEM_INSTANT,
f529f7
+		PMDA_PMUNITS(0,0,1,0,0,PM_COUNT_ONE) } },	
f529f7
 	/* SBD */
f529f7
 	{ .m_desc = {
f529f7
 		PMDA_PMID(CLUSTER_SBD_DEVICE, SBD_DEVICE_PATH),
f529f7
@@ -237,6 +260,10 @@ pmdaMetric metrictable[] = {
f529f7
 		PMDA_PMID(CLUSTER_SBD_DEVICE, SBD_DEVICE_STATUS),
f529f7
 		PM_TYPE_STRING, SBD_DEVICE_INDOM, PM_SEM_INSTANT,
f529f7
 		PMDA_PMUNITS(0,0,1,0,0,PM_COUNT_ONE) } },
f529f7
+	{ .m_desc = {
f529f7
+		PMDA_PMID(CLUSTER_SBD_DEVICE_ALL, 0),
f529f7
+		PM_TYPE_U32, SBD_DEVICE_ALL_INDOM, PM_SEM_INSTANT,
f529f7
+		PMDA_PMUNITS(0,0,1,0,0,PM_COUNT_ONE) } },
f529f7
 	{ .m_desc = {
f529f7
 		PMDA_PMID(CLUSTER_SBD_DEVICE, SBD_DEVICE_TIMEOUT_MSGWAIT),
f529f7
 		PM_TYPE_U32, SBD_DEVICE_INDOM, PM_SEM_INSTANT,
f529f7
@@ -270,6 +297,10 @@ pmdaMetric metrictable[] = {
f529f7
 		PMDA_PMID(CLUSTER_DRBD_RESOURCE, DRBD_RESOURCE_DISK_STATE),
f529f7
 		PM_TYPE_STRING, DRBD_RESOURCE_INDOM, PM_SEM_INSTANT,
f529f7
 		PMDA_PMUNITS(0,0,1,0,0,PM_COUNT_ONE) } },
f529f7
+	{ .m_desc ={
f529f7
+		PMDA_PMID(CLUSTER_DRBD_RESOURCE_ALL, 0),
f529f7
+		PM_TYPE_U32, DRBD_RESOURCE_ALL_INDOM, PM_SEM_INSTANT,
f529f7
+		PMDA_PMUNITS(0,0,1,0,0,PM_COUNT_ONE) } },
f529f7
 	{ .m_desc = {
f529f7
 		PMDA_PMID(CLUSTER_DRBD_RESOURCE, DRBD_RESOURCE_WRITTEN),
f529f7
 		PM_TYPE_U32, DRBD_RESOURCE_INDOM, PM_SEM_INSTANT,
f529f7
@@ -318,6 +349,10 @@ pmdaMetric metrictable[] = {
f529f7
 		PMDA_PMID(CLUSTER_DRBD_PEER_DEVICE, DRBD_PEER_DEVICE_PEER_DISK_STATE),
f529f7
 		PM_TYPE_STRING, DRBD_PEER_DEVICE_INDOM, PM_SEM_INSTANT,
f529f7
 		PMDA_PMUNITS(0,0,1,0,0,PM_COUNT_ONE) } },
f529f7
+	{ .m_desc = {
f529f7
+		PMDA_PMID(CLUSTER_DRBD_PEER_DEVICE_ALL, 0),
f529f7
+		PM_TYPE_U32, DRBD_PEER_DEVICE_ALL_INDOM, PM_SEM_INSTANT,
f529f7
+		PMDA_PMUNITS(0,0,1,0,0,PM_COUNT_ONE) } },
f529f7
 	{ .m_desc = {
f529f7
 		PMDA_PMID(CLUSTER_DRBD_PEER_DEVICE, DRBD_PEER_DEVICE_CONNECTIONS_SYNC),
f529f7
 		PM_TYPE_FLOAT, DRBD_PEER_DEVICE_INDOM, PM_SEM_INSTANT,
f529f7
@@ -359,6 +394,12 @@ hacluster_pacemaker_fail_instance_refresh(void)
f529f7
 	FILE		*pf;
f529f7
 	pmInDom		indom = INDOM(PACEMAKER_FAIL_INDOM);
f529f7
 
f529f7
+	/*
f529f7
+	 * Update indom cache based off the reading of crm_mon listed in
f529f7
+	 * the output from crm_mon
f529f7
+	 */
f529f7
+	pmdaCacheOp(indom, PMDA_CACHE_INACTIVE);
f529f7
+
f529f7
 	pmsprintf(buffer, sizeof(buffer), "%s 2>&1", crm_mon_command);
f529f7
 
f529f7
 	if ((pf = popen(buffer, "r")) == NULL)
f529f7
@@ -425,6 +466,14 @@ hacluster_pacemaker_constraints_instance_refresh(void)
f529f7
 	int			found_constraints = 0;
f529f7
 	FILE		*pf;
f529f7
 	pmInDom		indom = INDOM(PACEMAKER_CONSTRAINTS_INDOM);
f529f7
+	pmInDom		indom_all = INDOM(PACEMAKER_CONSTRAINTS_ALL_INDOM);
f529f7
+
f529f7
+	/*
f529f7
+	 * Update indom cache based off the reading of cibadmin listed in
f529f7
+	 * the output from cibadmin
f529f7
+	 */
f529f7
+	pmdaCacheOp(indom, PMDA_CACHE_INACTIVE);
f529f7
+	pmdaCacheOp(indom_all, PMDA_CACHE_INACTIVE);
f529f7
 
f529f7
 	pmsprintf(buffer, sizeof(buffer), "%s 2>&1", cibadmin_command);
f529f7
 	buffer[sizeof(buffer)-1] = '\0';
f529f7
@@ -446,6 +495,7 @@ hacluster_pacemaker_constraints_instance_refresh(void)
f529f7
 			struct  pacemaker_constraints *constraints;
f529f7
 
f529f7
 			sts = pmdaCacheLookupName(indom, constraint_name, NULL, (void **)&constraints);
f529f7
+			pmdaCacheLookupName(indom_all, constraint_name, NULL, NULL);
f529f7
 			if (sts == PM_ERR_INST || (sts >=0 && constraints == NULL)) {
f529f7
 				constraints = calloc(1, sizeof(struct pacemaker_constraints));
f529f7
 				if (constraints == NULL) {
f529f7
@@ -457,6 +507,7 @@ hacluster_pacemaker_constraints_instance_refresh(void)
f529f7
 				continue;
f529f7
 
f529f7
 			pmdaCacheStore(indom, PMDA_CACHE_ADD, constraint_name, (void *)constraints);
f529f7
+			pmdaCacheStore(indom_all, PMDA_CACHE_ADD, constraint_name, NULL);
f529f7
 		}
f529f7
 	}
f529f7
 	pclose(pf);
f529f7
@@ -472,6 +523,12 @@ hacluster_pacemaker_nodes_instance_refresh(void)
f529f7
 	FILE		*pf;
f529f7
 	pmInDom		indom = INDOM(PACEMAKER_NODES_INDOM);
f529f7
 
f529f7
+	/*
f529f7
+	 * Update indom cache based off the reading of crm_mon listed in
f529f7
+	 * the output from crm_mon
f529f7
+	 */
f529f7
+	pmdaCacheOp(indom, PMDA_CACHE_INACTIVE);
f529f7
+
f529f7
 	pmsprintf(buffer, sizeof(buffer), "%s 2>&1", crm_mon_command);
f529f7
 
f529f7
 	if ((pf = popen(buffer, "r")) == NULL)
f529f7
@@ -524,6 +581,14 @@ hacluster_pacemaker_node_attrib_instance_refresh(void)
f529f7
 	int			found_node_attributes = 0, found_node_name = 0;
f529f7
 	FILE		*pf;
f529f7
 	pmInDom		indom = INDOM(PACEMAKER_NODE_ATTRIB_INDOM);
f529f7
+	pmInDom		indom_all = INDOM(PACEMAKER_NODE_ATTRIB_ALL_INDOM);
f529f7
+
f529f7
+	/*
f529f7
+	 * Update indom cache based off the reading of crm_mon listed in
f529f7
+	 * the output from crm_mon
f529f7
+	 */
f529f7
+	pmdaCacheOp(indom, PMDA_CACHE_INACTIVE);
f529f7
+	pmdaCacheOp(indom_all, PMDA_CACHE_INACTIVE);
f529f7
 
f529f7
 	pmsprintf(buffer, sizeof(buffer), "%s 2>&1", crm_mon_command);
f529f7
 
f529f7
@@ -571,6 +636,7 @@ hacluster_pacemaker_node_attrib_instance_refresh(void)
f529f7
 				struct  pacemaker_node_attrib *node_attrib;
f529f7
 
f529f7
 				sts = pmdaCacheLookupName(indom, instance_name, NULL, (void **)&node_attrib);
f529f7
+				pmdaCacheLookupName(indom_all, instance_name, NULL, NULL);
f529f7
 				if (sts == PM_ERR_INST || (sts >=0 && node_attrib == NULL)) {
f529f7
 					node_attrib = calloc(1, sizeof(struct pacemaker_node_attrib));
f529f7
 					if (node_attrib == NULL) {
f529f7
@@ -582,6 +648,7 @@ hacluster_pacemaker_node_attrib_instance_refresh(void)
f529f7
 					continue;
f529f7
 
f529f7
 				pmdaCacheStore(indom, PMDA_CACHE_ADD, instance_name, (void *)node_attrib);
f529f7
+				pmdaCacheStore(indom_all, PMDA_CACHE_ADD, instance_name, NULL);
f529f7
 			}
f529f7
 		}
f529f7
 	}
f529f7
@@ -597,6 +664,14 @@ hacluster_pacemaker_resources_instance_refresh(void)
f529f7
 	int			found_resources = 0;
f529f7
 	FILE		*pf;
f529f7
 	pmInDom		indom= INDOM(PACEMAKER_RESOURCES_INDOM);
f529f7
+	pmInDom		indom_all = INDOM(PACEMAKER_RESOURCES_ALL_INDOM);
f529f7
+
f529f7
+	/*
f529f7
+	 * Update indom cache based off the reading of crm_mon listed in
f529f7
+	 * the output from crm_mon
f529f7
+	 */
f529f7
+	pmdaCacheOp(indom, PMDA_CACHE_INACTIVE);
f529f7
+	pmdaCacheOp(indom_all, PMDA_CACHE_INACTIVE);
f529f7
 
f529f7
 	pmsprintf(buffer, sizeof(buffer), "%s 2>&1", crm_mon_command);
f529f7
 
f529f7
@@ -641,6 +716,7 @@ hacluster_pacemaker_resources_instance_refresh(void)
f529f7
 				struct pacemaker_resources *pace_resources;
f529f7
 
f529f7
 				sts = pmdaCacheLookupName(indom, instance_name, NULL, (void **)&pace_resources);
f529f7
+				pmdaCacheLookupName(indom_all, instance_name, NULL, NULL);
f529f7
 				if (sts == PM_ERR_INST || (sts >=0 && pace_resources == NULL)) {
f529f7
 					pace_resources = calloc(1, sizeof(struct pacemaker_resources));
f529f7
 					if (pace_resources == NULL) {
f529f7
@@ -652,6 +728,7 @@ hacluster_pacemaker_resources_instance_refresh(void)
f529f7
 					continue;
f529f7
 
f529f7
 				pmdaCacheStore(indom, PMDA_CACHE_ADD, instance_name, (void *)pace_resources);
f529f7
+				pmdaCacheStore(indom_all, PMDA_CACHE_ADD, instance_name, NULL);
f529f7
 
f529f7
 				/* Clear node name in the event that a resource has not got a node attachment */
f529f7
 				memset(node_name, '\0', sizeof(node_name));
f529f7
@@ -730,12 +807,14 @@ hacluster_corosync_ring_instance_refresh(void)
f529f7
 	char		buffer[4096], ring_name[128];
f529f7
 	FILE		*pf;
f529f7
 	pmInDom		indom = INDOM(COROSYNC_RING_INDOM);
f529f7
+	pmInDom		indom_all = INDOM(COROSYNC_RING_ALL_INDOM);
f529f7
 
f529f7
 	/*
f529f7
 	 * Update indom cache based off number of nodes listed in the
f529f7
 	 * membership information section of corosync-quorumtool output
f529f7
 	 */
f529f7
 	pmdaCacheOp(indom, PMDA_CACHE_INACTIVE);
f529f7
+	pmdaCacheOp(indom_all, PMDA_CACHE_INACTIVE);
f529f7
 	
f529f7
 	pmsprintf(buffer, sizeof(buffer), "%s 2>&1", cfgtool_command);
f529f7
 	
f529f7
@@ -763,6 +842,7 @@ hacluster_corosync_ring_instance_refresh(void)
f529f7
 			struct  corosync_ring *ring;
f529f7
 
f529f7
 			sts = pmdaCacheLookupName(indom, ring_name, NULL, (void **)&ring);
f529f7
+			pmdaCacheLookupName(indom_all, ring_name, NULL, NULL);
f529f7
 			if (sts == PM_ERR_INST || (sts >=0 && ring == NULL)) {
f529f7
 				ring = calloc(1, sizeof(struct corosync_ring));
f529f7
 				if (ring == NULL) {
f529f7
@@ -774,6 +854,7 @@ hacluster_corosync_ring_instance_refresh(void)
f529f7
 				continue;
f529f7
 
f529f7
 			pmdaCacheStore(indom, PMDA_CACHE_ADD, ring_name, (void *)ring);
f529f7
+			pmdaCacheStore(indom_all, PMDA_CACHE_ADD, ring_name, NULL);
f529f7
 		}
f529f7
 	}
f529f7
 	pclose(pf);
f529f7
@@ -789,12 +870,14 @@ hacluster_sbd_device_instance_refresh(void)
f529f7
 	char		*buffer_ptr;
f529f7
 	FILE		*fp;
f529f7
 	pmInDom		indom = INDOM(SBD_DEVICE_INDOM);
f529f7
+	pmInDom		indom_all = INDOM(SBD_DEVICE_ALL_INDOM);
f529f7
 
f529f7
 	/*
f529f7
 	 * Update indom cache based off number of nodes listed in the
f529f7
 	 * membership information section of corosync-quorumtool output
f529f7
 	 */
f529f7
 	pmdaCacheOp(indom, PMDA_CACHE_INACTIVE);
f529f7
+	pmdaCacheOp(indom_all, PMDA_CACHE_INACTIVE);
f529f7
 
f529f7
 	if ((fp = fopen(sbd_path, "r")) == NULL)
f529f7
 		/*
f529f7
@@ -831,6 +914,7 @@ hacluster_sbd_device_instance_refresh(void)
f529f7
 					struct  sbd_device *sbd;
f529f7
 
f529f7
 					sts = pmdaCacheLookupName(indom, dev_name, NULL, (void **)&sbd;;
f529f7
+					pmdaCacheLookupName(indom_all, dev_name, NULL, NULL);
f529f7
 					if (sts == PM_ERR_INST || (sts >=0 && sbd == NULL)) {
f529f7
 						sbd = calloc(1, sizeof(struct sbd_device));
f529f7
 						if (sbd == NULL) {
f529f7
@@ -842,6 +926,7 @@ hacluster_sbd_device_instance_refresh(void)
f529f7
 						continue;
f529f7
 
f529f7
 					pmdaCacheStore(indom, PMDA_CACHE_ADD, dev_name, (void *)sbd);
f529f7
+					pmdaCacheStore(indom_all, PMDA_CACHE_ADD, dev_name, NULL);
f529f7
 				}
f529f7
 			}
f529f7
 		}
f529f7
@@ -860,6 +945,7 @@ hacluster_drbd_resource_instance_refresh(void)
f529f7
 	char		*buffer_ptr;
f529f7
 	FILE		*pf;
f529f7
 	pmInDom		indom = INDOM(DRBD_RESOURCE_INDOM);
f529f7
+	pmInDom		indom_all = INDOM(DRBD_RESOURCE_ALL_INDOM);
f529f7
 
f529f7
 	int found_node = 0, found_volume = 0, nesting = 0;
f529f7
 
f529f7
@@ -868,6 +954,7 @@ hacluster_drbd_resource_instance_refresh(void)
f529f7
 	 * the json output from drbdsetup
f529f7
 	 */
f529f7
 	pmdaCacheOp(indom, PMDA_CACHE_INACTIVE);
f529f7
+	pmdaCacheOp(indom_all, PMDA_CACHE_INACTIVE);
f529f7
 	
f529f7
 	pmsprintf(buffer, sizeof(buffer), "%s 2>&1", drbdsetup_command);
f529f7
 	
f529f7
@@ -910,6 +997,7 @@ hacluster_drbd_resource_instance_refresh(void)
f529f7
 			struct  drbd_resource *resource;
f529f7
 
f529f7
 			sts = pmdaCacheLookupName(indom, resource_name, NULL, (void **)&resource);
f529f7
+			pmdaCacheLookupName(indom_all, resource_name, NULL, NULL);
f529f7
 			if (sts == PM_ERR_INST || (sts >=0 && resource == NULL)) {
f529f7
 				resource = calloc(1, sizeof(struct drbd_resource));
f529f7
 				if (resource == NULL) {
f529f7
@@ -921,6 +1009,7 @@ hacluster_drbd_resource_instance_refresh(void)
f529f7
 				continue;
f529f7
 
f529f7
 			pmdaCacheStore(indom, PMDA_CACHE_ADD, resource_name, (void *)resource);
f529f7
+			pmdaCacheStore(indom_all, PMDA_CACHE_ADD, resource_name, NULL);
f529f7
 			found_volume = 0;
f529f7
 		}
f529f7
 	}
f529f7
@@ -937,6 +1026,7 @@ hacluster_drbd_peer_device_instance_refresh(void)
f529f7
 	char		*buffer_ptr;
f529f7
 	FILE		*pf;
f529f7
 	pmInDom		indom = INDOM(DRBD_PEER_DEVICE_INDOM);
f529f7
+	pmInDom		indom_all = INDOM(DRBD_PEER_DEVICE_ALL_INDOM);
f529f7
 
f529f7
 	int found_node = 0, found_peer_node = 0, nesting = 0;
f529f7
 	
f529f7
@@ -945,6 +1035,7 @@ hacluster_drbd_peer_device_instance_refresh(void)
f529f7
 	 * the json output from drbdsetup
f529f7
 	 */
f529f7
 	pmdaCacheOp(indom, PMDA_CACHE_INACTIVE);
f529f7
+	pmdaCacheOp(indom_all, PMDA_CACHE_INACTIVE);
f529f7
 
f529f7
 	pmsprintf(buffer, sizeof(buffer), "%s 2>&1", drbdsetup_command);
f529f7
 
f529f7
@@ -987,6 +1078,7 @@ hacluster_drbd_peer_device_instance_refresh(void)
f529f7
 			struct  drbd_peer_device *peer_device;
f529f7
 
f529f7
 			sts = pmdaCacheLookupName(indom, peer_name, NULL, (void **)&peer_device);
f529f7
+			pmdaCacheLookupName(indom_all, peer_name, NULL, NULL);
f529f7
 			if (sts == PM_ERR_INST || (sts >=0 && peer_device == NULL)) {
f529f7
 				peer_device = calloc(1, sizeof(struct drbd_peer_device));
f529f7
 				if (peer_device == NULL) {
f529f7
@@ -998,6 +1090,7 @@ hacluster_drbd_peer_device_instance_refresh(void)
f529f7
 				continue;
f529f7
 
f529f7
 			pmdaCacheStore(indom, PMDA_CACHE_ADD, peer_name, (void *)peer_device);
f529f7
+			pmdaCacheStore(indom_all, PMDA_CACHE_ADD, peer_name, NULL);
f529f7
 			found_peer_node = 0;
f529f7
 		}
f529f7
 	}
f529f7
@@ -1088,7 +1181,8 @@ hacluster_fetch_refresh(pmdaExt *pmda, int *need_refresh)
f529f7
 		if (!pmdaCacheLookup(INDOM(PACEMAKER_CONSTRAINTS_INDOM), i, &constraint_name, (void **)&constraints) || !constraints)
f529f7
 			continue;
f529f7
 
f529f7
-		if (need_refresh[CLUSTER_PACEMAKER_CONSTRAINTS])
f529f7
+		if (need_refresh[CLUSTER_PACEMAKER_CONSTRAINTS] ||
f529f7
+			need_refresh[CLUSTER_PACEMAKER_CONSTRAINTS_ALL])
f529f7
 			hacluster_refresh_pacemaker_constraints(constraint_name, &constraints->location_constraints);
f529f7
 	}
f529f7
 	
f529f7
@@ -1108,7 +1202,8 @@ hacluster_fetch_refresh(pmdaExt *pmda, int *need_refresh)
f529f7
 		if (!pmdaCacheLookup(INDOM(PACEMAKER_NODE_ATTRIB_INDOM), i, &attrib_name, (void **)&node_attribs) || !node_attribs)
f529f7
 			continue;
f529f7
 
f529f7
-		if (need_refresh[CLUSTER_PACEMAKER_NODE_ATTRIB])
f529f7
+		if (need_refresh[CLUSTER_PACEMAKER_NODE_ATTRIB] ||
f529f7
+			need_refresh[CLUSTER_PACEMAKER_NODE_ATTRIB_ALL])
f529f7
 			hacluster_refresh_pacemaker_node_attribs(attrib_name, &node_attribs->attributes);
f529f7
 	}
f529f7
 	
f529f7
@@ -1118,7 +1213,8 @@ hacluster_fetch_refresh(pmdaExt *pmda, int *need_refresh)
f529f7
 		if (!pmdaCacheLookup(INDOM(PACEMAKER_RESOURCES_INDOM), i, &pace_resource_name, (void **)&pace_resources) || !pace_resources)
f529f7
 			continue;
f529f7
 
f529f7
-		if (need_refresh[CLUSTER_PACEMAKER_RESOURCES])
f529f7
+		if (need_refresh[CLUSTER_PACEMAKER_RESOURCES] ||
f529f7
+			need_refresh[CLUSTER_PACEMAKER_RESOURCES_ALL])
f529f7
 			hacluster_refresh_pacemaker_resources(pace_resource_name, &pace_resources->resources);
f529f7
 	}
f529f7
 
f529f7
@@ -1141,7 +1237,8 @@ hacluster_fetch_refresh(pmdaExt *pmda, int *need_refresh)
f529f7
 		if (!pmdaCacheLookup(INDOM(COROSYNC_RING_INDOM), i, &ring_name, (void **)&ring) || !ring)
f529f7
 			continue;
f529f7
 
f529f7
-		if (need_refresh[CLUSTER_COROSYNC_RING])
f529f7
+		if (need_refresh[CLUSTER_COROSYNC_RING] ||
f529f7
+			need_refresh[CLUSTER_COROSYNC_RING_ALL])
f529f7
 			hacluster_refresh_corosync_ring(ring_name, &ring->rings);
f529f7
 	}
f529f7
 	
f529f7
@@ -1151,7 +1248,8 @@ hacluster_fetch_refresh(pmdaExt *pmda, int *need_refresh)
f529f7
 		if (!pmdaCacheLookup(INDOM(SBD_DEVICE_INDOM), i, &sbd_dev, (void **)&sbd) || !sbd)
f529f7
 			continue;
f529f7
 
f529f7
-		if (need_refresh[CLUSTER_SBD_DEVICE])
f529f7
+		if (need_refresh[CLUSTER_SBD_DEVICE] ||
f529f7
+			need_refresh[CLUSTER_SBD_DEVICE_ALL])
f529f7
 			hacluster_refresh_sbd_device(sbd_dev, &sbd->sbd);
f529f7
 	}
f529f7
 	
f529f7
@@ -1161,7 +1259,8 @@ hacluster_fetch_refresh(pmdaExt *pmda, int *need_refresh)
f529f7
 		if (!pmdaCacheLookup(INDOM(DRBD_RESOURCE_INDOM), i, &resource_name, (void **)&resource) || !resource)
f529f7
 			continue;
f529f7
 
f529f7
-		if (need_refresh[CLUSTER_DRBD_RESOURCE])
f529f7
+		if (need_refresh[CLUSTER_DRBD_RESOURCE] ||
f529f7
+			need_refresh[CLUSTER_DRBD_RESOURCE_ALL])
f529f7
 			hacluster_refresh_drbd_resource(resource_name, &resource->resource);
f529f7
 	}
f529f7
 	
f529f7
@@ -1171,7 +1270,8 @@ hacluster_fetch_refresh(pmdaExt *pmda, int *need_refresh)
f529f7
 		if (!pmdaCacheLookup(INDOM(DRBD_PEER_DEVICE_INDOM), i, &peer_device, (void **)&peer) || !peer)
f529f7
 			continue;
f529f7
 
f529f7
-		if (need_refresh[CLUSTER_DRBD_PEER_DEVICE])
f529f7
+		if (need_refresh[CLUSTER_DRBD_PEER_DEVICE] ||
f529f7
+			need_refresh[CLUSTER_DRBD_PEER_DEVICE_ALL])
f529f7
 			hacluster_refresh_drbd_peer_device(peer_device, &peer->peer_device);
f529f7
 	}
f529f7
 	
f529f7
@@ -1228,6 +1328,9 @@ hacluster_fetchCallBack(pmdaMetric *mdesc, unsigned int inst, pmAtomValue *atom)
f529f7
 				return sts;
f529f7
 			return hacluster_pacemaker_constraints_fetch(item, &constraints->location_constraints, atom);
f529f7
 			
f529f7
+		case CLUSTER_PACEMAKER_CONSTRAINTS_ALL:
f529f7
+			return hacluster_pacemaker_constraints_all_fetch(item, atom);			
f529f7
+			
f529f7
 		case CLUSTER_PACEMAKER_NODES:
f529f7
 			sts = pmdaCacheLookup(INDOM(PACEMAKER_NODES_INDOM), inst, NULL, (void **)&pace_nodes);
f529f7
 			if (sts < 0)
f529f7
@@ -1239,6 +1342,9 @@ hacluster_fetchCallBack(pmdaMetric *mdesc, unsigned int inst, pmAtomValue *atom)
f529f7
 			if (sts < 0)
f529f7
 				return sts;
f529f7
 			return hacluster_pacemaker_node_attribs_fetch(item, &pace_attribs->attributes, atom);
f529f7
+
f529f7
+		case CLUSTER_PACEMAKER_NODE_ATTRIB_ALL:
f529f7
+			return hacluster_pacemaker_node_attribs_all_fetch(item, atom);
f529f7
 			
f529f7
 		case CLUSTER_PACEMAKER_RESOURCES:
f529f7
 			sts = pmdaCacheLookup(INDOM(PACEMAKER_RESOURCES_INDOM), inst, NULL, (void **)&pace_resources);
f529f7
@@ -1246,6 +1352,9 @@ hacluster_fetchCallBack(pmdaMetric *mdesc, unsigned int inst, pmAtomValue *atom)
f529f7
 				return sts;
f529f7
 			return hacluster_pacemaker_resources_fetch(item, &pace_resources->resources, atom);
f529f7
 
f529f7
+		case CLUSTER_PACEMAKER_RESOURCES_ALL:
f529f7
+			return hacluster_pacemaker_resources_all_fetch(item, atom);
f529f7
+
f529f7
 		case CLUSTER_COROSYNC_NODE:
f529f7
 			sts = pmdaCacheLookup(INDOM(COROSYNC_NODE_INDOM), inst, NULL, (void **)&node);
f529f7
 			if (sts < 0)
f529f7
@@ -1260,18 +1369,27 @@ hacluster_fetchCallBack(pmdaMetric *mdesc, unsigned int inst, pmAtomValue *atom)
f529f7
 			if (sts < 0)
f529f7
 				return sts;
f529f7
 			return hacluster_corosync_ring_fetch(item, &ring->rings, atom);
f529f7
+
f529f7
+		case CLUSTER_COROSYNC_RING_ALL:
f529f7
+			return hacluster_corosync_ring_all_fetch(item, atom);
f529f7
 			
f529f7
 		case CLUSTER_SBD_DEVICE:
f529f7
 			sts = pmdaCacheLookup(INDOM(SBD_DEVICE_INDOM), inst, NULL, (void **)&sbd;;
f529f7
 			if (sts < 0)
f529f7
 				return sts;
f529f7
 			return hacluster_sbd_device_fetch(item, &sbd->sbd, atom);
f529f7
+
f529f7
+		case CLUSTER_SBD_DEVICE_ALL:
f529f7
+			return hacluster_sbd_device_all_fetch(item, atom);
f529f7
 			
f529f7
 		case CLUSTER_DRBD_RESOURCE:
f529f7
 			sts = pmdaCacheLookup(INDOM(DRBD_RESOURCE_INDOM), inst, NULL, (void **)&resource);
f529f7
 			if (sts < 0)
f529f7
 				return sts;
f529f7
-			return hacluster_drbd_resource_fetch(item, &resource->resource, atom);		
f529f7
+			return hacluster_drbd_resource_fetch(item, &resource->resource, atom);	
f529f7
+
f529f7
+		case CLUSTER_DRBD_RESOURCE_ALL:
f529f7
+			return hacluster_drbd_resource_all_fetch(item, atom);	
f529f7
 		
f529f7
 		case CLUSTER_DRBD_PEER_DEVICE:
f529f7
 			sts = pmdaCacheLookup(INDOM(DRBD_PEER_DEVICE_INDOM), inst, NULL, (void **)&peer);
f529f7
@@ -1279,6 +1397,9 @@ hacluster_fetchCallBack(pmdaMetric *mdesc, unsigned int inst, pmAtomValue *atom)
f529f7
 				return sts;
f529f7
 			return hacluster_drbd_peer_device_fetch(item, &peer->peer_device, atom);
f529f7
 
f529f7
+		case CLUSTER_DRBD_PEER_DEVICE_ALL:
f529f7
+			return hacluster_drbd_peer_device_all_fetch(item, atom);
f529f7
+
f529f7
 		default:
f529f7
 			return PM_ERR_PMID;
f529f7
 	}
f529f7
@@ -1286,6 +1407,220 @@ hacluster_fetchCallBack(pmdaMetric *mdesc, unsigned int inst, pmAtomValue *atom)
f529f7
 	return PMDA_FETCH_STATIC;
f529f7
 }
f529f7
 
f529f7
+static int
f529f7
+hacluster_labelInDom(pmID pmid, pmLabelSet **lp)
f529f7
+{	
f529f7
+	unsigned int cluster = pmID_cluster(pmid);
f529f7
+
f529f7
+	switch (cluster) {
f529f7
+		case CLUSTER_PACEMAKER_CONSTRAINTS_ALL:
f529f7
+			pmdaAddLabels(lp, "{\"constraint\":\"constraint\"}");
f529f7
+			pmdaAddLabels(lp, "{\"node\":\"node name\"}");
f529f7
+			pmdaAddLabels(lp, "{\"resource\":\"resource name\"}");
f529f7
+			pmdaAddLabels(lp, "{\"role\":\"role of node\"}");
f529f7
+			pmdaAddLabels(lp, "{\"score\":\"score\"}");
f529f7
+			return 1;
f529f7
+
f529f7
+		case CLUSTER_PACEMAKER_NODE_ATTRIB_ALL:
f529f7
+			pmdaAddLabels(lp, "{\"name\":\"attribute name\"}");
f529f7
+			pmdaAddLabels(lp, "{\"node\":\"node name\"}");
f529f7
+			pmdaAddLabels(lp, "{\"value\":\"value\"}");
f529f7
+			return 1;
f529f7
+
f529f7
+		case CLUSTER_PACEMAKER_RESOURCES_ALL:
f529f7
+			pmdaAddLabels(lp, "{\"agent\":\"agent\"}");
f529f7
+			pmdaAddLabels(lp, "{\"clone\":\"clone\"}");
f529f7
+			pmdaAddLabels(lp, "{\"group\":\"group\"}");
f529f7
+			pmdaAddLabels(lp, "{\"managed\":\"managed\"}");
f529f7
+			pmdaAddLabels(lp, "{\"node\":\"node name\"}");
f529f7
+			pmdaAddLabels(lp, "{\"resource\":\"resource name\"}");
f529f7
+			pmdaAddLabels(lp, "{\"role\":\"role\"}");
f529f7
+			return 1;
f529f7
+
f529f7
+		case CLUSTER_COROSYNC_RING_ALL:
f529f7
+			pmdaAddLabels(lp, "{\"address\":\"ip address\"}");
f529f7
+			pmdaAddLabels(lp, "{\"node_id\":\"id of node\"}");
f529f7
+			pmdaAddLabels(lp, "{\"number\":\"ring number\"}");
f529f7
+			pmdaAddLabels(lp, "{\"ring_id\":\"id of ring\"}");
f529f7
+			return 1;
f529f7
+
f529f7
+		case CLUSTER_SBD_DEVICE_ALL:
f529f7
+			pmdaAddLabels(lp, "{\"device\":\"device\"}");
f529f7
+			pmdaAddLabels(lp, "{\"status\":\"status\"}");
f529f7
+			return 1;
f529f7
+
f529f7
+		case CLUSTER_DRBD_RESOURCE_ALL:
f529f7
+			pmdaAddLabels(lp, "{\"disk_state\":\"disk state\"}");
f529f7
+			pmdaAddLabels(lp, "{\"resource\":\"resource name\"}");
f529f7
+			pmdaAddLabels(lp, "{\"role\":\"role\"}");
f529f7
+			pmdaAddLabels(lp, "{\"volume\":\"volume\"}");
f529f7
+			return 1;
f529f7
+
f529f7
+		case CLUSTER_DRBD_PEER_DEVICE_ALL:
f529f7
+			pmdaAddLabels(lp, "{\"peer_disk_state\":\"peer disk state\"}");
f529f7
+			pmdaAddLabels(lp, "{\"peer_node_id\":\"peer node id\"}");
f529f7
+			pmdaAddLabels(lp, "{\"peer_role\":\"peer role\"}");
f529f7
+			pmdaAddLabels(lp, "{\"resource\":\"resource\"}");
f529f7
+			pmdaAddLabels(lp, "{\"volume\":\"volume\"}");
f529f7
+			return 1;
f529f7
+
f529f7
+		default:
f529f7
+			break;
f529f7
+	}
f529f7
+	return 0;
f529f7
+}
f529f7
+			
f529f7
+static int
f529f7
+hacluster_label(int ident, int type, pmLabelSet **lpp, pmdaExt *pmda)
f529f7
+{
f529f7
+	int sts;
f529f7
+
f529f7
+	switch (type) {
f529f7
+		case PM_LABEL_ITEM:
f529f7
+			if ((sts = hacluster_labelInDom((pmID)ident, lpp)) <0)
f529f7
+				return sts;
f529f7
+			break;
f529f7
+
f529f7
+		default:
f529f7
+			break;
f529f7
+	}
f529f7
+	return pmdaLabel(ident, type, lpp, pmda);
f529f7
+}
f529f7
+
f529f7
+static int
f529f7
+hacluster_labelCallBack(pmInDom indom, unsigned int inst, pmLabelSet **lp)
f529f7
+{
f529f7
+	struct location_constraints		*constraints;
f529f7
+	struct attributes 				*attributes;
f529f7
+	struct resources 				*resources;
f529f7
+	struct rings					*ring;
f529f7
+	struct sbd						*sbd;
f529f7
+	struct resource					*resource;
f529f7
+	struct peer_device				*peer_device;
f529f7
+
f529f7
+	int 							sts;
f529f7
+	int								no_node_attachment = 0;
f529f7
+	char 							*name;
f529f7
+	char 							*node_name, *attribute_name, *node, *resource_id, *tofree, *str;
f529f7
+
f529f7
+	if (indom == PM_INDOM_NULL)
f529f7
+		return 0;
f529f7
+
f529f7
+	switch (pmInDom_serial(indom)) {
f529f7
+		case PACEMAKER_CONSTRAINTS_ALL_INDOM:
f529f7
+			sts = pmdaCacheLookup(INDOM(PACEMAKER_CONSTRAINTS_INDOM), inst, &name, (void **)&constraints);
f529f7
+			if (sts < 0 || sts == PMDA_CACHE_INACTIVE)
f529f7
+				return 0;
f529f7
+			return pmdaAddLabels(lp, "{\"constraint\":\"%s\", \"node\":\"%s\", \"resource\":\"%s\", \"role\":\"%s\", \"score\":\"%s\"}",
f529f7
+				name,
f529f7
+				constraints->node,
f529f7
+				constraints->resource,
f529f7
+				constraints->role,
f529f7
+				constraints->score
f529f7
+			);
f529f7
+
f529f7
+		case PACEMAKER_NODE_ATTRIB_ALL_INDOM:
f529f7
+			sts = pmdaCacheLookup(INDOM(PACEMAKER_NODE_ATTRIB_INDOM), inst, &name, (void **)&attributes);
f529f7
+			if (sts < 0 || sts == PMDA_CACHE_INACTIVE)
f529f7
+				return 0;
f529f7
+			/* 
f529f7
+	 		 * We need to split our combined NODE:ATTRIBUTE_NAME instance names into their
f529f7
+	 		 * separated NODE and ATTRIBUTE_NAME fields
f529f7
+	 		 */
f529f7
+			tofree = str = strdup(name);
f529f7
+			attribute_name = strsep(&str, ":");
f529f7
+			node_name = strsep(&str, ":");
f529f7
+
f529f7
+			sts = pmdaAddLabels(lp, "{\"name\":\"%s\", \"node\":\"%s\", \"value\":\"%s\"}",
f529f7
+				node_name,
f529f7
+				attribute_name,
f529f7
+				attributes->value
f529f7
+			);
f529f7
+			free(tofree);
f529f7
+			return sts;
f529f7
+			
f529f7
+		case PACEMAKER_RESOURCES_ALL_INDOM:
f529f7
+			sts = pmdaCacheLookup(INDOM(PACEMAKER_RESOURCES_INDOM), inst, &name, (void **)&resources);
f529f7
+			if (sts < 0 || sts == PMDA_CACHE_INACTIVE)
f529f7
+				return 0;
f529f7
+				
f529f7
+			if (strchr(name, ':') == NULL) {
f529f7
+				node = (char*)name;
f529f7
+				no_node_attachment = 1;
f529f7
+				resource_id = "";
f529f7
+			} else {
f529f7
+				tofree = str = strdup(name);
f529f7
+				node = strsep(&str, ":");
f529f7
+				resource_id = strsep(&str, ":");
f529f7
+			}
f529f7
+				
f529f7
+			sts = pmdaAddLabels(lp, "{\"agent\":\"%s\", \"clone\":\"%s\", \"group\":\"%s\", \"managed\":%u, \"node\":\"%s\", \"resource\":\"%s\", \"role\":\"%s\"}",
f529f7
+				resources->agent,
f529f7
+				resources->clone,
f529f7
+				resources->group,
f529f7
+				resources->managed,
f529f7
+				resource_id,
f529f7
+				node, 
f529f7
+				resources->role
f529f7
+			);
f529f7
+			
f529f7
+			if (!no_node_attachment)
f529f7
+				free(tofree);
f529f7
+			return sts;
f529f7
+			
f529f7
+		case COROSYNC_RING_ALL_INDOM:
f529f7
+			sts = pmdaCacheLookup(INDOM(COROSYNC_RING_INDOM), inst, &name, (void **)&ring);
f529f7
+			if (sts <0 || sts == PMDA_CACHE_INACTIVE)
f529f7
+				return 0;
f529f7
+				
f529f7
+			return pmdaAddLabels(lp, "{\"address\":\"%s\", \"node_id\":%"PRIu64", \"number\":%u, \"ring_id\":\"%s\"}",
f529f7
+				ring->address,
f529f7
+				ring->node_id,
f529f7
+				ring->number,
f529f7
+				ring->ring_id
f529f7
+			);
f529f7
+
f529f7
+		case SBD_DEVICE_ALL_INDOM:
f529f7
+			sts = pmdaCacheLookup(INDOM(SBD_DEVICE_INDOM), inst, &name, (void**)&sbd;;
f529f7
+			if (sts <0 || sts == PMDA_CACHE_INACTIVE)
f529f7
+				return 0;
f529f7
+				
f529f7
+			return pmdaAddLabels(lp, "{\"device\":\"%s\", \"status\":\"%s\"}",
f529f7
+				sbd->path,
f529f7
+				sbd->status
f529f7
+			);
f529f7
+
f529f7
+		case DRBD_RESOURCE_ALL_INDOM:
f529f7
+			sts = pmdaCacheLookup(INDOM(DRBD_RESOURCE_INDOM), inst, &name, (void**)&resource);
f529f7
+			if (sts <0 || sts == PMDA_CACHE_INACTIVE)
f529f7
+				return 0;
f529f7
+				
f529f7
+			return pmdaAddLabels(lp, "{\"disk_state\":\"%s\", \"resource\":\"%s\", \"role\":\"%s\", \"volume\":\"%s\"}",
f529f7
+				resource->disk_state,
f529f7
+				resource->resource,
f529f7
+				resource->role,
f529f7
+				resource->volume
f529f7
+			);
f529f7
+			
f529f7
+		case DRBD_PEER_DEVICE_ALL_INDOM:
f529f7
+			sts = pmdaCacheLookup(INDOM(DRBD_PEER_DEVICE_INDOM), inst, &name, (void**)&peer_device);
f529f7
+			if (sts <0 || sts == PMDA_CACHE_INACTIVE)
f529f7
+				return 0;
f529f7
+				
f529f7
+			return pmdaAddLabels(lp, "{\"peer_disk_state\":\"%s\", \"peer_node_id\":\"%s\", \"peer_role\":\"%s\", \"resource\":\"%s\", \"volume\":%"PRIu32"}",
f529f7
+				peer_device->peer_disk_state,
f529f7
+				peer_device->peer_node_id,
f529f7
+				peer_device->peer_role,
f529f7
+				peer_device->resource,
f529f7
+				peer_device->volume
f529f7
+			);
f529f7
+
f529f7
+		default:
f529f7
+			break;
f529f7
+	}
f529f7
+	return 0;
f529f7
+}
f529f7
+
f529f7
 void
f529f7
 hacluster_inst_setup(void)
f529f7
 {
f529f7
@@ -1378,7 +1713,7 @@ hacluster_init(pmdaInterface *dp)
f529f7
 		int sep = pmPathSeparator();
f529f7
 		pmsprintf(helppath, sizeof(helppath), "%s%c" "hacluster" "%c" "help",
f529f7
 			pmGetConfig("PCP_PMDAS_DIR"), sep, sep);
f529f7
-		pmdaDSO(dp, PMDA_INTERFACE_4, "HACLUSTER DSO", helppath);
f529f7
+		pmdaDSO(dp, PMDA_INTERFACE_7, "HACLUSTER DSO", helppath);
f529f7
 	}
f529f7
 
f529f7
 	if (dp->status != 0)
f529f7
@@ -1391,13 +1726,15 @@ hacluster_init(pmdaInterface *dp)
f529f7
 	sbd_stats_setup();
f529f7
 	drbd_stats_setup();
f529f7
 
f529f7
-	dp->version.four.instance = hacluster_instance;
f529f7
-	dp->version.four.fetch = hacluster_fetch;
f529f7
-	dp->version.four.text = hacluster_text;
f529f7
-	dp->version.four.pmid = hacluster_pmid;
f529f7
-	dp->version.four.name = hacluster_name;
f529f7
-	dp->version.four.children = hacluster_children;
f529f7
+	dp->version.seven.instance = hacluster_instance;
f529f7
+	dp->version.seven.fetch = hacluster_fetch;
f529f7
+	dp->version.seven.text = hacluster_text;
f529f7
+	dp->version.seven.pmid = hacluster_pmid;
f529f7
+	dp->version.seven.name = hacluster_name;
f529f7
+	dp->version.seven.children = hacluster_children;
f529f7
+	dp->version.seven.label = hacluster_label;
f529f7
 	pmdaSetFetchCallBack(dp, hacluster_fetchCallBack);
f529f7
+	pmdaSetLabelCallBack(dp, hacluster_labelCallBack);
f529f7
 
f529f7
 	pmdaSetFlags(dp, PMDA_EXT_FLAG_HASHED);
f529f7
 	pmdaInit(dp, indomtable, nindoms, metrictable, nmetrics);
f529f7
@@ -1428,7 +1765,7 @@ main(int argc, char **argv)
f529f7
 	pmSetProgname(argv[0]);
f529f7
 	pmsprintf(helppath, sizeof(helppath), "%s%c" "hacluster" "%c" "help",
f529f7
 		pmGetConfig("PCP_PMDAS_DIR"), sep, sep);
f529f7
-	pmdaDaemon(&dispatch, PMDA_INTERFACE_4, pmGetProgname(), HACLUSTER, "hacluster.log", helppath);
f529f7
+	pmdaDaemon(&dispatch, PMDA_INTERFACE_7, pmGetProgname(), HACLUSTER, "hacluster.log", helppath);
f529f7
 
f529f7
 	pmdaGetOptions(argc, argv, &opts, &dispatch);
f529f7
 	if (opts.errors) {
f529f7
diff --git a/src/pmdas/hacluster/pmdahacluster.h b/src/pmdas/hacluster/pmdahacluster.h
f529f7
index 9d3c243a4..a813ccb02 100644
f529f7
--- a/src/pmdas/hacluster/pmdahacluster.h
f529f7
+++ b/src/pmdas/hacluster/pmdahacluster.h
f529f7
@@ -23,32 +23,46 @@
f529f7
 #include "drbd.h"
f529f7
 
f529f7
 enum {
f529f7
-	CLUSTER_PACEMAKER_GLOBAL = 0,	/* 0  -- NULL INDOM */
f529f7
-	CLUSTER_PACEMAKER_FAIL,			/* 1  -- PACEMAKER_FAIL_INDOM */
f529f7
-	CLUSTER_PACEMAKER_CONSTRAINTS,	/* 2  -- PACEMAKER_CONSTRAINTS_INDOM */
f529f7
-	CLUSTER_PACEMAKER_NODES,		/* 3  -- PACEMAKER_NODES_IDOM*/
f529f7
-	CLUSTER_PACEMAKER_NODE_ATTRIB,	/* 4  -- PACEMAKER_NODE_ATRRIB_INDOM */
f529f7
-	CLUSTER_PACEMAKER_RESOURCES,	/* 5  -- PACEMAKER_RESOURCES_INDOM */
f529f7
-	CLUSTER_COROSYNC_NODE,			/* 6  -- COROSYNC_NODE_INDOM */
f529f7
-	CLUSTER_COROSYNC_GLOBAL,		/* 7  -- NULL INDOM */
f529f7
-	CLUSTER_COROSYNC_RING,			/* 8  -- COROSYNC_RING INDOM */
f529f7
-	CLUSTER_SBD_DEVICE,				/* 9  -- SBD_DEVICES_INDOM */
f529f7
-	CLUSTER_DRBD_RESOURCE,			/* 10 -- DRBD_RESOURCE_INDOM */
f529f7
-	CLUSTER_DRBD_PEER_DEVICE,		/* 11 -- DRBD_PEER_DEVICE_INDOM */
f529f7
+	CLUSTER_PACEMAKER_GLOBAL = 0,		/* 0  -- NULL INDOM */
f529f7
+	CLUSTER_PACEMAKER_FAIL,				/* 1  -- PACEMAKER_FAIL_INDOM */
f529f7
+	CLUSTER_PACEMAKER_CONSTRAINTS,		/* 2  -- PACEMAKER_CONSTRAINTS_INDOM */
f529f7
+	CLUSTER_PACEMAKER_NODES,			/* 3  -- PACEMAKER_NODES_IDOM*/
f529f7
+	CLUSTER_PACEMAKER_NODE_ATTRIB,		/* 4  -- PACEMAKER_NODE_ATRRIB_INDOM */
f529f7
+	CLUSTER_PACEMAKER_RESOURCES,		/* 5  -- PACEMAKER_RESOURCES_INDOM */
f529f7
+	CLUSTER_COROSYNC_NODE,				/* 6  -- COROSYNC_NODE_INDOM */
f529f7
+	CLUSTER_COROSYNC_GLOBAL,			/* 7  -- NULL INDOM */
f529f7
+	CLUSTER_COROSYNC_RING,				/* 8  -- COROSYNC_RING INDOM */
f529f7
+	CLUSTER_SBD_DEVICE,					/* 9  -- SBD_DEVICES_INDOM */
f529f7
+	CLUSTER_DRBD_RESOURCE,				/* 10 -- DRBD_RESOURCE_INDOM */
f529f7
+	CLUSTER_DRBD_PEER_DEVICE,			/* 11 -- DRBD_PEER_DEVICE_INDOM */
f529f7
+	CLUSTER_PACEMAKER_CONSTRAINTS_ALL, 	/* 12 -- PACEMAKER_CONSTRAINTS_ALL_INDOM */
f529f7
+	CLUSTER_PACEMAKER_NODE_ATTRIB_ALL,	/* 13 -- PACEMAKER_NODE_ATTRIB_ALL_INDOM */
f529f7
+	CLUSTER_PACEMAKER_RESOURCES_ALL,	/* 14 -- PACEMAKER_RESOURCES_ALL_INDOM */
f529f7
+	CLUSTER_COROSYNC_RING_ALL,			/* 15 -- COROSYNC_RING_ALL_INDOM */
f529f7
+	CLUSTER_SBD_DEVICE_ALL,				/* 16 -- SBD_DEVICES_ALL_INDOM */
f529f7
+	CLUSTER_DRBD_RESOURCE_ALL,			/* 17 -- DRBD_RESOURCE_ALL_INDOM */
f529f7
+	CLUSTER_DRBD_PEER_DEVICE_ALL,		/* 18 -- DRBD_PEER_DEVICE_ALL_INDOM */
f529f7
 	NUM_CLUSTERS
f529f7
 };
f529f7
 
f529f7
 enum {
f529f7
-	PACEMAKER_FAIL_INDOM = 0,		/* 0 -- Pacemaker failure/migrations */
f529f7
-	PACEMAKER_CONSTRAINTS_INDOM,	/* 1 -- Pacemaker location constraints */
f529f7
-	PACEMAKER_NODES_INDOM,			/* 2 -- Pacemaker nodes data */
f529f7
-	PACEMAKER_NODE_ATTRIB_INDOM,	/* 3 -- Pacemaker node attributes */
f529f7
-	PACEMAKER_RESOURCES_INDOM,		/* 4 -- Pacemaker resources */
f529f7
-	COROSYNC_NODE_INDOM, 			/* 5 -- Corosync available nodes  */
f529f7
-	COROSYNC_RING_INDOM,			/* 6 -- Corosync available rings */
f529f7
-	SBD_DEVICE_INDOM,		 		/* 7 -- SBD available devices */
f529f7
-	DRBD_RESOURCE_INDOM,	 		/* 8 -- DRBD Resources */
f529f7
-	DRBD_PEER_DEVICE_INDOM,	 		/* 9 -- DRBD Peer Devices */
f529f7
+	PACEMAKER_FAIL_INDOM = 0,			/* 0  -- Pacemaker failure/migrations */
f529f7
+	PACEMAKER_CONSTRAINTS_INDOM,		/* 1  -- Pacemaker location constraints */
f529f7
+	PACEMAKER_NODES_INDOM,				/* 2  -- Pacemaker nodes data */
f529f7
+	PACEMAKER_NODE_ATTRIB_INDOM,		/* 3  -- Pacemaker node attributes */
f529f7
+	PACEMAKER_RESOURCES_INDOM,			/* 4  -- Pacemaker resources */
f529f7
+	COROSYNC_NODE_INDOM, 				/* 5  -- Corosync available nodes  */
f529f7
+	COROSYNC_RING_INDOM,				/* 6  -- Corosync available rings */
f529f7
+	SBD_DEVICE_INDOM,		 			/* 7  -- SBD available devices */
f529f7
+	DRBD_RESOURCE_INDOM,	 			/* 8  -- DRBD Resources */
f529f7
+	DRBD_PEER_DEVICE_INDOM,	 			/* 9  -- DRBD Peer Devices */
f529f7
+	PACEMAKER_CONSTRAINTS_ALL_INDOM,	/* 10 -- Pacemaker location constraints all (labels) */
f529f7
+	PACEMAKER_NODE_ATTRIB_ALL_INDOM,	/* 11 -- Pacemaker node attributes all(labels) */
f529f7
+	PACEMAKER_RESOURCES_ALL_INDOM,		/* 12 -- Pacemaker resources all (labels) */
f529f7
+	COROSYNC_RING_ALL_INDOM,			/* 13 -- Corosync available rings all (labels) */
f529f7
+	SBD_DEVICE_ALL_INDOM,				/* 14 -- SBD available devices all (labels) */
f529f7
+	DRBD_RESOURCE_ALL_INDOM,			/* 15 -- DRBD Resources all (labels) */
f529f7
+	DRBD_PEER_DEVICE_ALL_INDOM,			/* 16 -- DRBD Peer Devicesall (labels) */
f529f7
 	NUM_INDOMS
f529f7
 };
f529f7
 
f529f7
diff --git a/src/pmdas/hacluster/pmns b/src/pmdas/hacluster/pmns
f529f7
index 75fc1ea4c..274d5f2ac 100644
f529f7
--- a/src/pmdas/hacluster/pmns
f529f7
+++ b/src/pmdas/hacluster/pmns
f529f7
@@ -21,131 +21,138 @@ ha_cluster {
f529f7
 
f529f7
 ha_cluster.pacemaker {
f529f7
 	config_last_change		HACLUSTER:0:0
f529f7
-	fail_count			HACLUSTER:1:0
f529f7
+	fail_count				HACLUSTER:1:0
f529f7
 	location_constraints
f529f7
 	migration_threshold		HACLUSTER:1:1
f529f7
 	nodes
f529f7
 	node_attributes			HACLUSTER:4:0
f529f7
+	node_attributes_all		HACLUSTER:13:0
f529f7
 	resources
f529f7
 	stonith_enabled			HACLUSTER:0:1
f529f7
 }
f529f7
 
f529f7
 ha_cluster.pacemaker.location_constraints {
f529f7
-	node				HACLUSTER:2:0
f529f7
-	resource			HACLUSTER:2:1
f529f7
-	role				HACLUSTER:2:2
f529f7
-	score				HACLUSTER:2:3
f529f7
+	node					HACLUSTER:2:0
f529f7
+	resource				HACLUSTER:2:1
f529f7
+	role					HACLUSTER:2:2
f529f7
+	score					HACLUSTER:2:3
f529f7
+	all						HACLUSTER:12:0
f529f7
 }
f529f7
 
f529f7
 ha_cluster.pacemaker.nodes {
f529f7
 	status
f529f7
-	type				HACLUSTER:3:9
f529f7
+	type					HACLUSTER:3:9
f529f7
 }
f529f7
 
f529f7
 ha_cluster.pacemaker.nodes.status {
f529f7
-	online				HACLUSTER:3:0
f529f7
-	standby				HACLUSTER:3:1
f529f7
+	online					HACLUSTER:3:0
f529f7
+	standby					HACLUSTER:3:1
f529f7
 	standby_on_fail			HACLUSTER:3:2
f529f7
-	maintenance			HACLUSTER:3:3
f529f7
-	pending				HACLUSTER:3:4
f529f7
-	unclean				HACLUSTER:3:5
f529f7
-	shutdown			HACLUSTER:3:6
f529f7
-	expected_up			HACLUSTER:3:7
f529f7
-	dc				HACLUSTER:3:8
f529f7
+	maintenance				HACLUSTER:3:3
f529f7
+	pending					HACLUSTER:3:4
f529f7
+	unclean					HACLUSTER:3:5
f529f7
+	shutdown				HACLUSTER:3:6
f529f7
+	expected_up				HACLUSTER:3:7
f529f7
+	dc						HACLUSTER:3:8
f529f7
 }
f529f7
 
f529f7
 ha_cluster.pacemaker.resources {
f529f7
-	agent				HACLUSTER:5:0
f529f7
-	clone				HACLUSTER:5:1
f529f7
-	group				HACLUSTER:5:2
f529f7
-	managed				HACLUSTER:5:3
f529f7
-	role				HACLUSTER:5:4
f529f7
+	agent					HACLUSTER:5:0
f529f7
+	clone					HACLUSTER:5:1
f529f7
+	group					HACLUSTER:5:2
f529f7
+	managed					HACLUSTER:5:3
f529f7
+	role					HACLUSTER:5:4
f529f7
 	status
f529f7
+	all						HACLUSTER:14:0
f529f7
 }
f529f7
 
f529f7
 ha_cluster.pacemaker.resources.status {
f529f7
-	active				HACLUSTER:5:5
f529f7
-	orphaned			HACLUSTER:5:6
f529f7
-	blocked				HACLUSTER:5:7
f529f7
-	failed				HACLUSTER:5:8
f529f7
+	active					HACLUSTER:5:5
f529f7
+	orphaned				HACLUSTER:5:6
f529f7
+	blocked					HACLUSTER:5:7
f529f7
+	failed					HACLUSTER:5:8
f529f7
 	failure_ignored			HACLUSTER:5:9
f529f7
 }
f529f7
 
f529f7
 ha_cluster.corosync {
f529f7
 	member_votes
f529f7
-	quorate				HACLUSTER:7:0
f529f7
+	quorate					HACLUSTER:7:0
f529f7
 	quorum_votes
f529f7
-	ring_errors			HACLUSTER:7:5
f529f7
+	ring_errors				HACLUSTER:7:5
f529f7
 	rings
f529f7
 }
f529f7
 
f529f7
 ha_cluster.corosync.member_votes {
f529f7
-	votes				HACLUSTER:6:0
f529f7
-	local				HACLUSTER:6:1
f529f7
-	node_id				HACLUSTER:6:2
f529f7
+	votes					HACLUSTER:6:0
f529f7
+	local					HACLUSTER:6:1
f529f7
+	node_id					HACLUSTER:6:2
f529f7
 }
f529f7
 
f529f7
 ha_cluster.corosync.quorum_votes {
f529f7
 	expected_votes			HACLUSTER:7:1
f529f7
 	highest_expected		HACLUSTER:7:2
f529f7
-	total_votes			HACLUSTER:7:3
f529f7
-	quorum				HACLUSTER:7:4
f529f7
+	total_votes				HACLUSTER:7:3
f529f7
+	quorum					HACLUSTER:7:4
f529f7
 }
f529f7
 
f529f7
 ha_cluster.corosync.rings {
f529f7
-	status				HACLUSTER:8:0
f529f7
-	address				HACLUSTER:8:1
f529f7
-	node_id				HACLUSTER:8:2
f529f7
-	number				HACLUSTER:8:3
f529f7
-	ring_id				HACLUSTER:8:4
f529f7
+	status					HACLUSTER:8:0
f529f7
+	address					HACLUSTER:8:1
f529f7
+	node_id					HACLUSTER:8:2
f529f7
+	number					HACLUSTER:8:3
f529f7
+	ring_id					HACLUSTER:8:4
f529f7
+	all						HACLUSTER:15:0
f529f7
 }
f529f7
 
f529f7
 ha_cluster.sbd {
f529f7
 	devices
f529f7
 	timeouts
f529f7
+	all						HACLUSTER:16:0
f529f7
 }
f529f7
 
f529f7
 ha_cluster.sbd.devices {
f529f7
-	path				HACLUSTER:9:0
f529f7
-	status				HACLUSTER:9:1
f529f7
+	path					HACLUSTER:9:0
f529f7
+	status					HACLUSTER:9:1
f529f7
 }
f529f7
 
f529f7
 ha_cluster.sbd.timeouts {
f529f7
-	mgswait				HACLUSTER:9:2
f529f7
-	allocate			HACLUSTER:9:3
f529f7
-	loop				HACLUSTER:9:4
f529f7
-	watchdog			HACLUSTER:9:5
f529f7
+	mgswait					HACLUSTER:9:2
f529f7
+	allocate				HACLUSTER:9:3
f529f7
+	loop					HACLUSTER:9:4
f529f7
+	watchdog				HACLUSTER:9:5
f529f7
 }
f529f7
 
f529f7
 ha_cluster.drbd {
f529f7
-	resources			
f529f7
-	written				HACLUSTER:10:4
f529f7
-	read				HACLUSTER:10:5
f529f7
-	al_writes			HACLUSTER:10:6
f529f7
-	bm_writes			HACLUSTER:10:7
f529f7
+	resources
f529f7
+	written					HACLUSTER:10:4
f529f7
+	read					HACLUSTER:10:5
f529f7
+	al_writes				HACLUSTER:10:6
f529f7
+	bm_writes				HACLUSTER:10:7
f529f7
 	upper_pending			HACLUSTER:10:8
f529f7
 	lower_pending			HACLUSTER:10:9
f529f7
-	quorum				HACLUSTER:10:10
f529f7
+	quorum					HACLUSTER:10:10
f529f7
 	connections
f529f7
 	connections_sync		HACLUSTER:11:5
f529f7
-	connections_received		HACLUSTER:11:6
f529f7
+	connections_received	HACLUSTER:11:6
f529f7
 	connections_sent		HACLUSTER:11:7
f529f7
 	connections_pending		HACLUSTER:11:8
f529f7
 	connections_unacked		HACLUSTER:11:9
f529f7
-	split_brain			HACLUSTER:10:11
f529f7
+	split_brain				HACLUSTER:10:11
f529f7
 }
f529f7
 
f529f7
 ha_cluster.drbd.resources {
f529f7
-	resource			HACLUSTER:10:0
f529f7
-	role				HACLUSTER:10:1
f529f7
-	volume				HACLUSTER:10:2
f529f7
-	disk_state			HACLUSTER:10:3
f529f7
+	resource				HACLUSTER:10:0
f529f7
+	role					HACLUSTER:10:1
f529f7
+	volume					HACLUSTER:10:2
f529f7
+	disk_state				HACLUSTER:10:3
f529f7
+	all						HACLUSTER:17:0
f529f7
 }
f529f7
 
f529f7
 ha_cluster.drbd.connections {
f529f7
-	resource			HACLUSTER:11:0
f529f7
+	resource				HACLUSTER:11:0
f529f7
 	peer_node_id			HACLUSTER:11:1
f529f7
-	peer_role			HACLUSTER:11:2
f529f7
-	volume				HACLUSTER:11:3
f529f7
+	peer_role				HACLUSTER:11:2
f529f7
+	volume					HACLUSTER:11:3
f529f7
 	peer_disk_state			HACLUSTER:11:4
f529f7
+	all						HACLUSTER:18:0
f529f7
 }
f529f7
diff --git a/src/pmdas/hacluster/sbd.c b/src/pmdas/hacluster/sbd.c
f529f7
index 2824f6589..05f55ad52 100644
f529f7
--- a/src/pmdas/hacluster/sbd.c
f529f7
+++ b/src/pmdas/hacluster/sbd.c
f529f7
@@ -68,6 +68,13 @@ hacluster_sbd_device_fetch(int item, struct sbd *sbd, pmAtomValue *atom)
f529f7
 	return PMDA_FETCH_NOVALUES;
f529f7
 }
f529f7
 
f529f7
+int 
f529f7
+hacluster_sbd_device_all_fetch(int item, pmAtomValue *atom)
f529f7
+{
f529f7
+	atom->ul = 1; /* Assign default exists value 1 */
f529f7
+	return PMDA_FETCH_STATIC;
f529f7
+}
f529f7
+
f529f7
 int
f529f7
 hacluster_refresh_sbd_device(const char *sbd_dev, struct sbd *sbd)
f529f7
 {
f529f7
diff --git a/src/pmdas/hacluster/sbd.h b/src/pmdas/hacluster/sbd.h
f529f7
index 0db22e7a0..0a6971d0e 100644
f529f7
--- a/src/pmdas/hacluster/sbd.h
f529f7
+++ b/src/pmdas/hacluster/sbd.h
f529f7
@@ -37,6 +37,7 @@ struct sbd {
f529f7
 };
f529f7
 
f529f7
 extern int hacluster_sbd_device_fetch(int, struct sbd *, pmAtomValue *);
f529f7
+extern int hacluster_sbd_device_all_fetch(int, pmAtomValue *);
f529f7
 extern int hacluster_refresh_sbd_device(const char *, struct sbd *);
f529f7
 
f529f7
 extern void sbd_stats_setup(void);
f529f7
-- 
f529f7
2.31.1
f529f7
f529f7
f529f7
From 96e746ac389999ee5a67f1b1d5621f62cff70bcb Mon Sep 17 00:00:00 2001
f529f7
From: Nathan Scott <nathans@redhat.com>
f529f7
Date: Sat, 19 Jun 2021 16:32:38 +1000
f529f7
Subject: [PATCH 6/7] docs: typo fixes in hacluster help text
f529f7
f529f7
---
f529f7
 qa/1897.out              | 22 +++++++++++-----------
f529f7
 src/pmdas/hacluster/help | 22 +++++++++++-----------
f529f7
 2 files changed, 22 insertions(+), 22 deletions(-)
f529f7
f529f7
diff --git a/qa/1897.out b/qa/1897.out
f529f7
index b757e857a..a0b53a998 100644
f529f7
--- a/qa/1897.out
f529f7
+++ b/qa/1897.out
f529f7
@@ -41,7 +41,7 @@ Help:
f529f7
 The number of expected quorum votes for the cluster.
f529f7
     value 2
f529f7
 
f529f7
-ha_cluster.corosync.quorum_votes.highest_expected PMID: 155.7.2 [Hightest expected vote count]
f529f7
+ha_cluster.corosync.quorum_votes.highest_expected PMID: 155.7.2 [Highest expected vote count]
f529f7
     Data Type: 32-bit unsigned int  InDom: PM_INDOM_NULL 0xffffffff
f529f7
     Semantics: instant  Units: count
f529f7
 Help:
f529f7
@@ -80,7 +80,7 @@ ha_cluster.corosync.rings.all PMID: 155.15.0 [Corosync rings information]
f529f7
     Data Type: 32-bit unsigned int  InDom: 155.13 0x26c0000d
f529f7
     Semantics: instant  Units: count
f529f7
 Help:
f529f7
-Value is 1 if a ring exists. The details of the corrosponding ring
f529f7
+Value is 1 if a ring exists. The details of the corresponding ring
f529f7
 is given as label metadata values for this metric.
f529f7
     inst [0 or "0"] value 1
f529f7
 
f529f7
@@ -132,7 +132,7 @@ ha_cluster.drbd.connections.all PMID: 155.18.0 [DRBD Peer disk information]
f529f7
     Data Type: 32-bit unsigned int  InDom: 155.16 0x26c00010
f529f7
     Semantics: instant  Units: count
f529f7
 Help:
f529f7
-Value is 1 if a drbd peer connection exists. The details of the corrosponding DRBD peer
f529f7
+Value is 1 if a drbd peer connection exists. The details of the corresponding DRBD peer
f529f7
 connection is given as label metadata values for this metric.
f529f7
     inst [0 or "drbd1:1"] value 1
f529f7
 
f529f7
@@ -219,7 +219,7 @@ The number of open requests to the local I/O subsystem by DRBD for the
f529f7
 resource:volume.
f529f7
     inst [0 or "drbd1:0"] value 0
f529f7
 
f529f7
-ha_cluster.drbd.quorum PMID: 155.10.10 [Quorum satus of DRBD resource:volume]
f529f7
+ha_cluster.drbd.quorum PMID: 155.10.10 [Quorum status of DRBD resource:volume]
f529f7
     Data Type: 32-bit unsigned int  InDom: 155.8 0x26c00008
f529f7
     Semantics: instant  Units: count
f529f7
 Help:
f529f7
@@ -238,7 +238,7 @@ ha_cluster.drbd.resources.all PMID: 155.17.0 [DRBD resource information]
f529f7
     Data Type: 32-bit unsigned int  InDom: 155.15 0x26c0000f
f529f7
     Semantics: instant  Units: count
f529f7
 Help:
f529f7
-Value is 1 if a drbd resource exists. The details of the corrosponding drbd resource
f529f7
+Value is 1 if a drbd resource exists. The details of the corresponding drbd resource
f529f7
 is given as label metadata values for this metric.
f529f7
     inst [0 or "drbd1:0"] value 1
f529f7
 
f529f7
@@ -260,21 +260,21 @@ ha_cluster.drbd.resources.role PMID: 155.10.1 [Role of the resource]
f529f7
     Data Type: string  InDom: 155.8 0x26c00008
f529f7
     Semantics: instant  Units: count
f529f7
 Help:
f529f7
-The resported role for ther DRBD resource for each resource:volume.
f529f7
+The reported role for the DRBD resource for each resource:volume.
f529f7
     inst [0 or "drbd1:0"] value "Primary"
f529f7
 
f529f7
 ha_cluster.drbd.resources.volume PMID: 155.10.2 [Volume of the resource]
f529f7
     Data Type: string  InDom: 155.8 0x26c00008
f529f7
     Semantics: instant  Units: count
f529f7
 Help:
f529f7
-The volume number of ther resource for each resource:volume.
f529f7
+The volume number of the resource for each resource:volume.
f529f7
     inst [0 or "drbd1:0"] value "0"
f529f7
 
f529f7
 ha_cluster.drbd.split_brain PMID: 155.10.11 [Signal for split brain detection.]
f529f7
     Data Type: 32-bit unsigned int  InDom: 155.8 0x26c00008
f529f7
     Semantics: instant  Units: count
f529f7
 Help:
f529f7
-This metric signals if there has been a split brain occuring in DRBD for the
f529f7
+This metric signals if there has been a split brain occurring in DRBD for the
f529f7
 resource:volume, value is 1 is a split brain has been detected.
f529f7
     inst [0 or "drbd1:0"] value 1
f529f7
 
f529f7
@@ -293,7 +293,7 @@ Help:
f529f7
 Amount in KiB written to the DRBD resource:volume.
f529f7
     inst [0 or "drbd1:0"] value 0
f529f7
 
f529f7
-ha_cluster.pacemaker.config_last_change PMID: 155.0.0 [Unix timestamp corresponding to last Pacmaker configuration change]
f529f7
+ha_cluster.pacemaker.config_last_change PMID: 155.0.0 [Unix timestamp corresponding to last Pacemaker configuration change]
f529f7
     Data Type: 64-bit unsigned int  InDom: PM_INDOM_NULL 0xffffffff
f529f7
     Semantics: instant  Units: count
f529f7
 Help:
f529f7
@@ -335,7 +335,7 @@ ha_cluster.pacemaker.location_constraints.role PMID: 155.2.2 [Resource role of t
f529f7
     Data Type: string  InDom: 155.1 0x26c00001
f529f7
     Semantics: instant  Units: count
f529f7
 Help:
f529f7
-The resource role that the location contraint applies to, if any.
f529f7
+The resource role that the location constraint applies to, if any.
f529f7
     inst [0 or "test"] value "Started"
f529f7
 
f529f7
 ha_cluster.pacemaker.location_constraints.score PMID: 155.2.3 [Score of the location constraint]
f529f7
@@ -617,7 +617,7 @@ ha_cluster.sbd.all PMID: 155.16.0 [SBD device information]
f529f7
     Data Type: 32-bit unsigned int  InDom: 155.14 0x26c0000e
f529f7
     Semantics: instant  Units: count
f529f7
 Help:
f529f7
-Value is 1 if a sbd device exists. The details of the corrosponding SBD device
f529f7
+Value is 1 if a sbd device exists. The details of the corresponding SBD device
f529f7
 is given as label metadata values for this metric.
f529f7
     inst [0 or "/dev/vdb"] value 1
f529f7
 
f529f7
diff --git a/src/pmdas/hacluster/help b/src/pmdas/hacluster/help
f529f7
index bdcd68e5f..417bfd4cf 100644
f529f7
--- a/src/pmdas/hacluster/help
f529f7
+++ b/src/pmdas/hacluster/help
f529f7
@@ -28,7 +28,7 @@
f529f7
 #
f529f7
 @ HACLUSTER.0 Instance domain for High Availability Cluster component metrics
f529f7
 
f529f7
-@ ha_cluster.pacemaker.config_last_change Unix timestamp corresponding to last Pacmaker configuration change
f529f7
+@ ha_cluster.pacemaker.config_last_change Unix timestamp corresponding to last Pacemaker configuration change
f529f7
 Unix timestamp in seconds corresponding to the last time that the Pacemaker
f529f7
 configuration was changed on the system.
f529f7
 
f529f7
@@ -58,7 +58,7 @@ The node that the location constraint applies to in the cluster.
f529f7
 The resource that the location constraint applies to in the cluster.
f529f7
 
f529f7
 @ ha_cluster.pacemaker.location_constraints.role Resource role of the location constraint
f529f7
-The resource role that the location contraint applies to, if any.
f529f7
+The resource role that the location constraint applies to, if any.
f529f7
 
f529f7
 @ ha_cluster.pacemaker.location_constraints.score Score of the location constraint
f529f7
 The score given to the location constraint by Pacemaker, the value depends on
f529f7
@@ -167,7 +167,7 @@ The full corosync ID for the nodes in the cluster.
f529f7
 @ ha_cluster.corosync.quorum_votes.expected_votes Expected vote count
f529f7
 The number of expected quorum votes for the cluster.
f529f7
 
f529f7
-@ ha_cluster.corosync.quorum_votes.highest_expected Hightest expected vote count
f529f7
+@ ha_cluster.corosync.quorum_votes.highest_expected Highest expected vote count
f529f7
 The highest number of expected quorum votes for the cluster. 
f529f7
 
f529f7
 @ ha_cluster.corosync.quorum_votes.total_votes Total number of votes
f529f7
@@ -193,7 +193,7 @@ The number for the Corosync ring.
f529f7
 The internal Corosync ring ID, corresponds to the first node to join.
f529f7
 
f529f7
 @ ha_cluster.corosync.rings.all Corosync rings information
f529f7
-Value is 1 if a ring exists. The details of the corrosponding ring
f529f7
+Value is 1 if a ring exists. The details of the corresponding ring
f529f7
 is given as label metadata values for this metric.
f529f7
 
f529f7
 @ ha_cluster.sbd.devices.path Path of SBD device
f529f7
@@ -204,7 +204,7 @@ The current status given for each of the SBD devices, the value is one of
f529f7
 healthy or unhealthy.
f529f7
 
f529f7
 @ ha_cluster.sbd.all SBD device information
f529f7
-Value is 1 if a sbd device exists. The details of the corrosponding SBD device
f529f7
+Value is 1 if a sbd device exists. The details of the corresponding SBD device
f529f7
 is given as label metadata values for this metric.
f529f7
 
f529f7
 @ ha_cluster.sbd.timeouts.mgswait mgswait timeout value
f529f7
@@ -240,7 +240,7 @@ for the resource:volume.
f529f7
 The number of open requests to the local I/O subsystem by DRBD for the
f529f7
 resource:volume.
f529f7
 
f529f7
-@ ha_cluster.drbd.quorum Quorum satus of DRBD resource:volume
f529f7
+@ ha_cluster.drbd.quorum Quorum status of DRBD resource:volume
f529f7
 The Quorum status of the DRBD resource according to resource:volume, 1 is
f529f7
 quorate and 0 is non-quorate.
f529f7
 
f529f7
@@ -265,23 +265,23 @@ The number of requests sent which have not yet been acknowledged by DRBD for
f529f7
 the resource:volume.
f529f7
 
f529f7
 @ ha_cluster.drbd.split_brain Signal for split brain detection.
f529f7
-This metric signals if there has been a split brain occuring in DRBD for the
f529f7
+This metric signals if there has been a split brain occurring in DRBD for the
f529f7
 resource:volume, value is 1 is a split brain has been detected.
f529f7
 
f529f7
 @ ha_cluster.drbd.resources.resource Name of the resource
f529f7
 The name given for the DRBD resource for each resource:volume.
f529f7
 
f529f7
 @ ha_cluster.drbd.resources.role Role of the resource
f529f7
-The resported role for ther DRBD resource for each resource:volume.
f529f7
+The reported role for the DRBD resource for each resource:volume.
f529f7
 
f529f7
 @ ha_cluster.drbd.resources.volume Volume of the resource
f529f7
-The volume number of ther resource for each resource:volume.
f529f7
+The volume number of the resource for each resource:volume.
f529f7
 
f529f7
 @ ha_cluster.drbd.resources.disk_state Disk state
f529f7
 The current reported disk state of for the resource:volume.
f529f7
 
f529f7
 @ ha_cluster.drbd.resources.all DRBD resource information
f529f7
-Value is 1 if a drbd resource exists. The details of the corrosponding drbd resource
f529f7
+Value is 1 if a drbd resource exists. The details of the corresponding drbd resource
f529f7
 is given as label metadata values for this metric.
f529f7
 
f529f7
 @ ha_cluster.drbd.connections.resource Resource that the connection is for
f529f7
@@ -300,5 +300,5 @@ The reported volume for the connection.
f529f7
 The reported peer disk state for the connection.
f529f7
 
f529f7
 @ ha_cluster.drbd.connections.all DRBD Peer disk information
f529f7
-Value is 1 if a drbd peer connection exists. The details of the corrosponding DRBD peer
f529f7
+Value is 1 if a drbd peer connection exists. The details of the corresponding DRBD peer
f529f7
 connection is given as label metadata values for this metric.
f529f7
-- 
f529f7
2.31.1
f529f7
f529f7
f529f7
From b17119354e2b044a7ba5c9cd36cb6da59ab9ed05 Mon Sep 17 00:00:00 2001
f529f7
From: Paul Evans <pevans@redhat.com>
f529f7
Date: Mon, 21 Jun 2021 18:46:32 +0100
f529f7
Subject: [PATCH 7/7] pmdahacluster: Remove un-needed pmdaCacheLookupName()
f529f7
 calls
f529f7
f529f7
Update instance refresh code for the label supported metrics to remove the
f529f7
superfluous pmdaCacheLookupName() calls.
f529f7
f529f7
We update the label supported indoms in mirror to the non-label indoms
f529f7
and in turn don't require re-checking instance updates immediately again
f529f7
(after doing so for the non-label indoms).
f529f7
f529f7
This also fixes the Coverity defects reported by Nathan for unchecked returns
f529f7
on these calls.
f529f7
---
f529f7
 src/pmdas/hacluster/pmda.c | 9 ++-------
f529f7
 1 file changed, 2 insertions(+), 7 deletions(-)
f529f7
f529f7
diff --git a/src/pmdas/hacluster/pmda.c b/src/pmdas/hacluster/pmda.c
f529f7
index 6c9163b25..5be6d3668 100644
f529f7
--- a/src/pmdas/hacluster/pmda.c
f529f7
+++ b/src/pmdas/hacluster/pmda.c
f529f7
@@ -495,7 +495,6 @@ hacluster_pacemaker_constraints_instance_refresh(void)
f529f7
 			struct  pacemaker_constraints *constraints;
f529f7
 
f529f7
 			sts = pmdaCacheLookupName(indom, constraint_name, NULL, (void **)&constraints);
f529f7
-			pmdaCacheLookupName(indom_all, constraint_name, NULL, NULL);
f529f7
 			if (sts == PM_ERR_INST || (sts >=0 && constraints == NULL)) {
f529f7
 				constraints = calloc(1, sizeof(struct pacemaker_constraints));
f529f7
 				if (constraints == NULL) {
f529f7
@@ -636,7 +635,6 @@ hacluster_pacemaker_node_attrib_instance_refresh(void)
f529f7
 				struct  pacemaker_node_attrib *node_attrib;
f529f7
 
f529f7
 				sts = pmdaCacheLookupName(indom, instance_name, NULL, (void **)&node_attrib);
f529f7
-				pmdaCacheLookupName(indom_all, instance_name, NULL, NULL);
f529f7
 				if (sts == PM_ERR_INST || (sts >=0 && node_attrib == NULL)) {
f529f7
 					node_attrib = calloc(1, sizeof(struct pacemaker_node_attrib));
f529f7
 					if (node_attrib == NULL) {
f529f7
@@ -716,7 +714,6 @@ hacluster_pacemaker_resources_instance_refresh(void)
f529f7
 				struct pacemaker_resources *pace_resources;
f529f7
 
f529f7
 				sts = pmdaCacheLookupName(indom, instance_name, NULL, (void **)&pace_resources);
f529f7
-				pmdaCacheLookupName(indom_all, instance_name, NULL, NULL);
f529f7
 				if (sts == PM_ERR_INST || (sts >=0 && pace_resources == NULL)) {
f529f7
 					pace_resources = calloc(1, sizeof(struct pacemaker_resources));
f529f7
 					if (pace_resources == NULL) {
f529f7
@@ -842,7 +839,6 @@ hacluster_corosync_ring_instance_refresh(void)
f529f7
 			struct  corosync_ring *ring;
f529f7
 
f529f7
 			sts = pmdaCacheLookupName(indom, ring_name, NULL, (void **)&ring);
f529f7
-			pmdaCacheLookupName(indom_all, ring_name, NULL, NULL);
f529f7
 			if (sts == PM_ERR_INST || (sts >=0 && ring == NULL)) {
f529f7
 				ring = calloc(1, sizeof(struct corosync_ring));
f529f7
 				if (ring == NULL) {
f529f7
@@ -914,7 +910,6 @@ hacluster_sbd_device_instance_refresh(void)
f529f7
 					struct  sbd_device *sbd;
f529f7
 
f529f7
 					sts = pmdaCacheLookupName(indom, dev_name, NULL, (void **)&sbd;;
f529f7
-					pmdaCacheLookupName(indom_all, dev_name, NULL, NULL);
f529f7
 					if (sts == PM_ERR_INST || (sts >=0 && sbd == NULL)) {
f529f7
 						sbd = calloc(1, sizeof(struct sbd_device));
f529f7
 						if (sbd == NULL) {
f529f7
@@ -997,7 +992,6 @@ hacluster_drbd_resource_instance_refresh(void)
f529f7
 			struct  drbd_resource *resource;
f529f7
 
f529f7
 			sts = pmdaCacheLookupName(indom, resource_name, NULL, (void **)&resource);
f529f7
-			pmdaCacheLookupName(indom_all, resource_name, NULL, NULL);
f529f7
 			if (sts == PM_ERR_INST || (sts >=0 && resource == NULL)) {
f529f7
 				resource = calloc(1, sizeof(struct drbd_resource));
f529f7
 				if (resource == NULL) {
f529f7
@@ -1010,6 +1004,7 @@ hacluster_drbd_resource_instance_refresh(void)
f529f7
 
f529f7
 			pmdaCacheStore(indom, PMDA_CACHE_ADD, resource_name, (void *)resource);
f529f7
 			pmdaCacheStore(indom_all, PMDA_CACHE_ADD, resource_name, NULL);
f529f7
+
f529f7
 			found_volume = 0;
f529f7
 		}
f529f7
 	}
f529f7
@@ -1078,7 +1073,6 @@ hacluster_drbd_peer_device_instance_refresh(void)
f529f7
 			struct  drbd_peer_device *peer_device;
f529f7
 
f529f7
 			sts = pmdaCacheLookupName(indom, peer_name, NULL, (void **)&peer_device);
f529f7
-			pmdaCacheLookupName(indom_all, peer_name, NULL, NULL);
f529f7
 			if (sts == PM_ERR_INST || (sts >=0 && peer_device == NULL)) {
f529f7
 				peer_device = calloc(1, sizeof(struct drbd_peer_device));
f529f7
 				if (peer_device == NULL) {
f529f7
@@ -1091,6 +1085,7 @@ hacluster_drbd_peer_device_instance_refresh(void)
f529f7
 
f529f7
 			pmdaCacheStore(indom, PMDA_CACHE_ADD, peer_name, (void *)peer_device);
f529f7
 			pmdaCacheStore(indom_all, PMDA_CACHE_ADD, peer_name, NULL);
f529f7
+
f529f7
 			found_peer_node = 0;
f529f7
 		}
f529f7
 	}
f529f7
-- 
f529f7
2.31.1
f529f7