Update to pcp-5.3.7-18 with pmproxy, pmcd.conf and pmdahacluster fixes

Resolves: rhbz#2211263
Resolves: rhbz#2219731
Resolves: rhbz#2159207
This commit is contained in:
Nathan Scott 2023-07-10 16:28:01 +10:00
parent 8ecfe8a1ba
commit 1c9cbf235b
4 changed files with 1191 additions and 39 deletions

View File

@ -1,6 +1,6 @@
Name: pcp
Version: 5.3.7
Release: 17%{?dist}
Release: 18%{?dist}
Summary: System-level performance monitoring and performance management
License: GPLv2+ and LGPLv2+ and CC-BY
URL: https://pcp.io
@ -22,7 +22,9 @@ Patch11: redhat-bugzilla-1981886-pcp-ss-fetchgroup.patch
Patch12: redhat-bugzilla-2159207-pmproxy-rollup-fixes.patch
Patch13: redhat-bugzilla-2139325-openmetrics-in-grafana.patch
Patch14: redhat-bugzilla-2150889-nfsclient-srcport.patch
Patch15: redhat-build-jsonsl.patch
Patch15: redhat-bugzilla-2219731-hacluster-metrics.patch
Patch16: redhat-bugzilla-2211263-pmcd-conf-rewrite.patch
Patch17: redhat-build-jsonsl.patch
# The additional linker flags break out-of-tree PMDAs.
# https://bugzilla.redhat.com/show_bug.cgi?id=2043092
@ -2306,6 +2308,8 @@ updated policy package.
%patch13 -p1
%patch14 -p1
%patch15 -p1
%patch16 -p1
%patch17 -p1
%build
# the buildsubdir macro gets defined in %setup and is apparently only available in the next step (i.e. the %build step)
@ -3377,10 +3381,14 @@ fi
%files zeroconf -f pcp-zeroconf-files.rpm
%changelog
* Wed Jul 05 2023 Nathan Scott <nathans@redhat.com> - 5.3.7-18
- Improve pmproxy handling large HTTP requests (BZ 2159207)
- Fix hacluster metrics with current Pacemaker (BZ 2219731)
- Ensure pmcd.conf not needlessly over written (BZ 2211263)
* Thu Mar 09 2023 Nathan Scott <nathans@redhat.com> - 5.3.7-17
- Harden pmdaopenmetrics metric name validator (BZ 2139325)
- Fix issues in pmdanfsclient srcport handling (BZ 2150889)
- Improve pmproxy handling large HTTP requests (BZ 2159207)
* Thu Nov 17 2022 Nathan Scott <nathans@redhat.com> - 5.3.7-16
- Ensure SNMP metrics config symlink installed (BZ 2139012)

View File

@ -1,6 +1,20 @@
diff -Naurp pcp-5.3.7.orig/man/man3/pmwebapi.3 pcp-5.3.7/man/man3/pmwebapi.3
--- pcp-5.3.7.orig/man/man3/pmwebapi.3 2022-04-05 09:05:43.000000000 +1000
+++ pcp-5.3.7/man/man3/pmwebapi.3 2023-07-05 13:43:00.404035611 +1000
@@ -175,6 +175,10 @@ parameter.
The value passed in the request will be sent back in the
response \- all responses will be in JSON object form in
this case, with top level "client" and "result" fields.
+.PP
+REST API clients can optionally submit an URL-encoded query string
+in the body of the HTTP request unless otherwise noted.
+In this case the POST method must be used instead of the GET method.
.SS GET \fI/series/query\fR \- \fBpmSeriesQuery\fR(3)
.TS
box;
diff -Naurp pcp-5.3.7.orig/qa/1604 pcp-5.3.7/qa/1604
--- pcp-5.3.7.orig/qa/1604 1970-01-01 10:00:00.000000000 +1000
+++ pcp-5.3.7/qa/1604 2023-03-09 11:30:01.448770018 +1100
+++ pcp-5.3.7/qa/1604 2023-07-05 13:42:53.394025688 +1000
@@ -0,0 +1,114 @@
+#!/bin/sh
+# PCP QA Test No. 1604
@ -118,7 +132,7 @@ diff -Naurp pcp-5.3.7.orig/qa/1604 pcp-5.3.7/qa/1604
+exit
diff -Naurp pcp-5.3.7.orig/qa/1604.out pcp-5.3.7/qa/1604.out
--- pcp-5.3.7.orig/qa/1604.out 1970-01-01 10:00:00.000000000 +1000
+++ pcp-5.3.7/qa/1604.out 2023-03-09 11:30:01.448770018 +1100
+++ pcp-5.3.7/qa/1604.out 2023-07-05 13:42:53.394025688 +1000
@@ -0,0 +1,204 @@
+QA output created by 1604
+Start test Redis server ...
@ -325,8 +339,8 @@ diff -Naurp pcp-5.3.7.orig/qa/1604.out pcp-5.3.7/qa/1604.out
+ }
+]
diff -Naurp pcp-5.3.7.orig/qa/1626 pcp-5.3.7/qa/1626
--- pcp-5.3.7.orig/qa/1626 2022-04-05 09:05:43.000000000 +1000
+++ pcp-5.3.7/qa/1626 2023-03-09 11:31:18.809008274 +1100
--- pcp-5.3.7.orig/qa/1626 2023-07-05 13:42:25.513986223 +1000
+++ pcp-5.3.7/qa/1626 2023-07-05 13:42:53.394025688 +1000
@@ -2,7 +2,7 @@
# PCP QA Test No. 1626
# pmproxy metrics
@ -376,8 +390,8 @@ diff -Naurp pcp-5.3.7.orig/qa/1626 pcp-5.3.7/qa/1626
done
diff -Naurp pcp-5.3.7.orig/qa/1626.out pcp-5.3.7/qa/1626.out
--- pcp-5.3.7.orig/qa/1626.out 2022-04-05 09:05:43.000000000 +1000
+++ pcp-5.3.7/qa/1626.out 2023-03-09 11:31:18.809008274 +1100
--- pcp-5.3.7.orig/qa/1626.out 2023-07-05 13:42:25.513986223 +1000
+++ pcp-5.3.7/qa/1626.out 2023-07-05 13:42:53.394025688 +1000
@@ -1,10 +1,10 @@
QA output created by 1626
== wait for pmproxy server metrics
@ -392,8 +406,8 @@ diff -Naurp pcp-5.3.7.orig/qa/1626.out pcp-5.3.7/qa/1626.out
=== check for discovery partial metadata reads
=== check maxrss and datasz values
diff -Naurp pcp-5.3.7.orig/qa/1689.out pcp-5.3.7/qa/1689.out
--- pcp-5.3.7.orig/qa/1689.out 2021-09-24 12:57:26.000000000 +1000
+++ pcp-5.3.7/qa/1689.out 2023-03-09 11:31:18.809008274 +1100
--- pcp-5.3.7.orig/qa/1689.out 2023-07-05 13:42:25.513986223 +1000
+++ pcp-5.3.7/qa/1689.out 2023-07-05 13:42:53.394025688 +1000
@@ -165,6 +165,30 @@ pmproxy.discover.throttled_changed_callb
Help:
Number of filesystem change callbacks that were ignored due to throttling
@ -458,7 +472,7 @@ diff -Naurp pcp-5.3.7.orig/qa/1689.out pcp-5.3.7/qa/1689.out
+Contexts scanned during most recent webgroup garbage collection
diff -Naurp pcp-5.3.7.orig/qa/1691 pcp-5.3.7/qa/1691
--- pcp-5.3.7.orig/qa/1691 1970-01-01 10:00:00.000000000 +1000
+++ pcp-5.3.7/qa/1691 2023-03-08 19:03:34.890046547 +1100
+++ pcp-5.3.7/qa/1691 2023-07-05 13:42:53.404025702 +1000
@@ -0,0 +1,74 @@
+#!/bin/sh
+# Exercise pmseries handling of loading archives and ignoring metrics thereof.
@ -536,7 +550,7 @@ diff -Naurp pcp-5.3.7.orig/qa/1691 pcp-5.3.7/qa/1691
+exit
diff -Naurp pcp-5.3.7.orig/qa/1691.out pcp-5.3.7/qa/1691.out
--- pcp-5.3.7.orig/qa/1691.out 1970-01-01 10:00:00.000000000 +1000
+++ pcp-5.3.7/qa/1691.out 2023-03-08 19:03:34.890046547 +1100
+++ pcp-5.3.7/qa/1691.out 2023-07-05 13:42:53.404025702 +1000
@@ -0,0 +1,44 @@
+QA output created by 1691
+Start test Redis server ...
@ -582,9 +596,244 @@ diff -Naurp pcp-5.3.7.orig/qa/1691.out pcp-5.3.7/qa/1691.out
+
+d38aff137f65367ce1aec169be675021a3ebb25c
+ Metric: kernel.all.cpu.nice
diff -Naurp pcp-5.3.7.orig/qa/1697 pcp-5.3.7/qa/1697
--- pcp-5.3.7.orig/qa/1697 1970-01-01 10:00:00.000000000 +1000
+++ pcp-5.3.7/qa/1697 2023-07-05 13:43:00.404035611 +1000
@@ -0,0 +1,134 @@
+#!/bin/sh
+# PCP QA Test No. 1697
+# Valgrind pmproxy REST API testing.
+# Based on 1601 and 1696
+
+# Copyright (c) 2022 Red Hat.
+#
+
+seq=`basename $0`
+echo "QA output created by $seq"
+
+# get standard environment, filters and checks
+. ./common.product
+. ./common.filter
+. ./common.check
+. ./common.python
+
+
+_check_valgrind
+_check_series
+_check_redis_server_version_offline
+
+_cleanup()
+{
+ cd $here
+ [ -n "$options" ] && redis-cli $options shutdown
+ $sudo rm -rf $tmp $tmp.*
+}
+
+status=1 # failure is the default!
+username=`id -u -n`
+$sudo rm -rf $tmp $tmp.* $seq.full
+trap "_cleanup; exit \$status" 0 1 2 3 15
+
+# create a pmproxy configuration
+cat <<EOF > $tmp.conf
+[pmproxy]
+pcp.enabled = true
+http.enabled = true
+[pmseries]
+enabled = true
+EOF
+
+_filter_source()
+{
+ sed \
+ -e "s,$here,PATH,g" \
+ -e "s,$hostname,QAHOST,g" \
+ #end
+}
+
+_filter_proxyport()
+{
+ sed \
+ -e "s/ FD $proxyport / FD PORT /g" \
+ -e '/PORT ipv6 /d' \
+ # end
+}
+
+# real QA test starts here
+echo "Start test Redis server ..."
+redisport=`_find_free_port`
+options="-p $redisport"
+redis-server --port $redisport --save "" > $tmp.redis 2>&1 &
+_check_redis_ping $redisport
+_check_redis_server $redisport
+echo
+
+_check_redis_server_version $redisport
+
+# import some well-known test data into Redis
+pmseries $options --load "$here/archives/proc" | _filter_source
+
+# start pmproxy
+mkdir -p $tmp.pmproxy/pmproxy
+export PCP_RUN_DIR=$tmp.pmproxy
+export PCP_TMP_DIR=$tmp.pmproxy
+proxyport=`_find_free_port`
+$_valgrind_clean_assert pmproxy -f -p $proxyport -r $redisport -U $username -l- -c $tmp.conf >$tmp.valout 2>$tmp.valerr &
+pid=$!
+
+# valgrind takes awhile to fire up
+i=0
+while [ $i -lt 40 ]
+do
+ $PCP_BINADM_DIR/telnet-probe -c localhost $proxyport && break
+ sleep 1
+ i=`expr $i + 1`
+done
+if $PCP_BINADM_DIR/telnet-probe -c localhost $proxyport
+then
+ echo "Startup took $i secs" >>$seq.full
+else
+ echo "Arrgh: valgrind failed start pmproxy and get port $proxyport ready after 30 secs"
+ exit
+fi
+
+series1=`pmseries $options disk.all.read`
+[ -z "$series1" ] && _fail "Cannot find any timeseries matching disk.all.read"
+echo "Using series $series1 for disk.all.read"
+
+series2=`pmseries $options disk.dev.read`
+[ -z "$series2" ] && _fail "Cannot find any timeseries matching disk.dev.read"
+echo "Using series $series2 for disk.dev.read"
+
+series3=`pmseries $options kernel.all.uptime`
+[ -z "$series3" ] && _fail "Cannot find any timeseries matching kernel.all.uptime"
+echo "Using series $series3 for kernel.all.uptime"
+
+
+echo "== verify metric descs" | tee -a $seq.full
+curl --silent "http://localhost:$proxyport/series/descs" -d "series=$series1,$series2,$series3" | tee -a $seq.full | pmjson
+
+echo "== verify metric names" | tee -a $seq.full
+curl --silent "http://localhost:$proxyport/series/metrics" -d "series=$series1,$series2,$series3" | tee -a $seq.full | pmjson
+
+echo "== verify metric labels" | tee -a $seq.full
+curl --silent "http://localhost:$proxyport/series/labels" -d "series=$series1,$series3" | tee -a $seq.full | pmjson
+
+echo "== verify metric insts" | tee -a $seq.full
+curl --silent "http://localhost:$proxyport/series/instances" -d "series=$series2" | tee -a $seq.full | pmjson
+
+# valgrind takes awhile to shutdown too
+pmsignal $pid
+pmsleep 3.5
+echo "=== valgrind stdout ===" | tee -a $seq.full
+cat $tmp.valout | _filter_valgrind
+
+echo "=== valgrind stderr ===" | tee -a $seq.full
+cat $tmp.valerr | _filter_pmproxy_log | grep -v "Cannot connect to Redis" | _filter_proxyport
+
+# success, all done
+status=0
+exit
diff -Naurp pcp-5.3.7.orig/qa/1697.out pcp-5.3.7/qa/1697.out
--- pcp-5.3.7.orig/qa/1697.out 1970-01-01 10:00:00.000000000 +1000
+++ pcp-5.3.7/qa/1697.out 2023-07-05 13:43:00.414035625 +1000
@@ -0,0 +1,93 @@
+QA output created by 1697
+Start test Redis server ...
+PING
+PONG
+
+pmseries: [Info] processed 5 archive records from PATH/archives/proc
+Using series 1440b8b8bfe69465340eb934e9086ae8212f3cff for disk.all.read
+Using series 605fc77742cd0317597291329561ac4e50c0dd12 for disk.dev.read
+Using series 01d8bc7fa75aaff98a08aa0b1c0f2394368d5183 for kernel.all.uptime
+== verify metric descs
+[
+ {
+ "series": "1440b8b8bfe69465340eb934e9086ae8212f3cff",
+ "source": "2cd6a38f9339f2dd1f0b4775bda89a9e7244def6",
+ "pmid": "60.0.24",
+ "indom": "none",
+ "semantics": "counter",
+ "type": "u64",
+ "units": "count"
+ },
+ {
+ "series": "605fc77742cd0317597291329561ac4e50c0dd12",
+ "source": "2cd6a38f9339f2dd1f0b4775bda89a9e7244def6",
+ "pmid": "60.0.4",
+ "indom": "60.1",
+ "semantics": "counter",
+ "type": "u32",
+ "units": "count"
+ },
+ {
+ "series": "01d8bc7fa75aaff98a08aa0b1c0f2394368d5183",
+ "source": "2cd6a38f9339f2dd1f0b4775bda89a9e7244def6",
+ "pmid": "60.26.0",
+ "indom": "none",
+ "semantics": "instant",
+ "type": "u32",
+ "units": "sec"
+ }
+]
+== verify metric names
+[
+ {
+ "series": "1440b8b8bfe69465340eb934e9086ae8212f3cff",
+ "name": "disk.all.read"
+ },
+ {
+ "series": "605fc77742cd0317597291329561ac4e50c0dd12",
+ "name": "disk.dev.read"
+ },
+ {
+ "series": "01d8bc7fa75aaff98a08aa0b1c0f2394368d5183",
+ "name": "kernel.all.uptime"
+ }
+]
+== verify metric labels
+[
+ {
+ "series": "1440b8b8bfe69465340eb934e9086ae8212f3cff",
+ "labels": {
+ "hostname": "bozo-laptop"
+ }
+ },
+ {
+ "series": "01d8bc7fa75aaff98a08aa0b1c0f2394368d5183",
+ "labels": {
+ "hostname": "bozo-laptop"
+ }
+ }
+]
+== verify metric insts
+[
+ {
+ "series": "605fc77742cd0317597291329561ac4e50c0dd12",
+ "source": "2cd6a38f9339f2dd1f0b4775bda89a9e7244def6",
+ "instance": "c3795d8b757506a2901c6b08b489ba56cae7f0d4",
+ "id": 0,
+ "name": "sda"
+ }
+]
+=== valgrind stdout ===
+=== valgrind stderr ===
+Log for pmproxy on HOST started DATE
+
+pmproxy: PID = PID
+pmproxy request port(s):
+ sts fd port family address
+ === ==== ===== ====== =======
+ok FD unix UNIX_DOMAIN_SOCKET
+ok FD PORT inet INADDR_ANY
+[DATE] pmproxy(PID) Info: pmproxy caught SIGTERM
+[DATE] pmproxy(PID) Info: pmproxy Shutdown
+
+Log finished DATE
diff -Naurp pcp-5.3.7.orig/qa/common.check pcp-5.3.7/qa/common.check
--- pcp-5.3.7.orig/qa/common.check 2022-04-05 09:05:43.000000000 +1000
+++ pcp-5.3.7/qa/common.check 2023-03-09 11:31:18.809008274 +1100
--- pcp-5.3.7.orig/qa/common.check 2023-07-05 13:42:25.513986223 +1000
+++ pcp-5.3.7/qa/common.check 2023-07-05 13:42:53.404025702 +1000
@@ -1226,7 +1226,7 @@ _wait_for_pmproxy_metrics()
{
_n=0
@ -595,8 +844,8 @@ diff -Naurp pcp-5.3.7.orig/qa/common.check pcp-5.3.7/qa/common.check
_n=`expr $_n + 1`
[ $_n -lt 20 ] && continue
diff -Naurp pcp-5.3.7.orig/qa/group pcp-5.3.7/qa/group
--- pcp-5.3.7.orig/qa/group 2023-03-09 10:07:59.413862563 +1100
+++ pcp-5.3.7/qa/group 2023-03-09 11:30:01.448770018 +1100
--- pcp-5.3.7.orig/qa/group 2023-07-05 13:42:25.523986237 +1000
+++ pcp-5.3.7/qa/group 2023-07-05 13:43:00.414035625 +1000
@@ -1869,6 +1869,7 @@ x11
1601 pmseries pmproxy local
1602 pmproxy local
@ -605,7 +854,7 @@ diff -Naurp pcp-5.3.7.orig/qa/group pcp-5.3.7/qa/group
1608 pmproxy local
1613 pmda.linux kernel local
1622:retired local
@@ -1890,6 +1891,7 @@ x11
@@ -1890,10 +1891,12 @@ x11
1688 pmieconf local
1689 pmproxy libpcp_web local
1690 pmseries local
@ -613,9 +862,14 @@ diff -Naurp pcp-5.3.7.orig/qa/group pcp-5.3.7/qa/group
1692 pmda.pmcd local
1694 pidstat local python pcp pmlogextract
1695 pmproxy valgrind local
1696 pmproxy valgrind local
+1697 pmproxy valgrind local
1700 pmda.bpftrace local python
1701 pmda.bpftrace local python
1702 pmda.bpftrace local python
diff -Naurp pcp-5.3.7.orig/src/libpcp_web/src/load.c pcp-5.3.7/src/libpcp_web/src/load.c
--- pcp-5.3.7.orig/src/libpcp_web/src/load.c 2023-03-09 10:07:59.413862563 +1100
+++ pcp-5.3.7/src/libpcp_web/src/load.c 2023-03-09 10:28:34.407315771 +1100
--- pcp-5.3.7.orig/src/libpcp_web/src/load.c 2023-07-05 13:42:25.523986237 +1000
+++ pcp-5.3.7/src/libpcp_web/src/load.c 2023-07-05 13:42:53.414025716 +1000
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2017-2021 Red Hat.
@ -889,8 +1143,8 @@ diff -Naurp pcp-5.3.7.orig/src/libpcp_web/src/load.c pcp-5.3.7/src/libpcp_web/sr
memset(baton, 0, sizeof(*baton));
diff -Naurp pcp-5.3.7.orig/src/libpcp_web/src/query.c pcp-5.3.7/src/libpcp_web/src/query.c
--- pcp-5.3.7.orig/src/libpcp_web/src/query.c 2022-04-05 10:35:25.000000000 +1000
+++ pcp-5.3.7/src/libpcp_web/src/query.c 2023-03-09 11:30:01.448770018 +1100
--- pcp-5.3.7.orig/src/libpcp_web/src/query.c 2023-07-05 13:42:25.523986237 +1000
+++ pcp-5.3.7/src/libpcp_web/src/query.c 2023-07-05 13:42:53.414025716 +1000
@@ -49,7 +49,7 @@ typedef struct seriesGetLookup {
} seriesGetLookup;
@ -1923,8 +2177,8 @@ diff -Naurp pcp-5.3.7.orig/src/libpcp_web/src/query.c pcp-5.3.7/src/libpcp_web/s
int
diff -Naurp pcp-5.3.7.orig/src/libpcp_web/src/schema.h pcp-5.3.7/src/libpcp_web/src/schema.h
--- pcp-5.3.7.orig/src/libpcp_web/src/schema.h 2023-03-09 10:07:59.413862563 +1100
+++ pcp-5.3.7/src/libpcp_web/src/schema.h 2023-03-09 10:28:34.407315771 +1100
--- pcp-5.3.7.orig/src/libpcp_web/src/schema.h 2023-07-05 13:42:25.533986251 +1000
+++ pcp-5.3.7/src/libpcp_web/src/schema.h 2023-07-05 13:42:53.414025716 +1000
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2017-2021 Red Hat.
@ -1951,8 +2205,8 @@ diff -Naurp pcp-5.3.7.orig/src/libpcp_web/src/schema.h pcp-5.3.7/src/libpcp_web/
int error;
void *arg;
diff -Naurp pcp-5.3.7.orig/src/libpcp_web/src/slots.c pcp-5.3.7/src/libpcp_web/src/slots.c
--- pcp-5.3.7.orig/src/libpcp_web/src/slots.c 2022-02-02 11:50:08.000000000 +1100
+++ pcp-5.3.7/src/libpcp_web/src/slots.c 2023-03-09 11:29:18.638638171 +1100
--- pcp-5.3.7.orig/src/libpcp_web/src/slots.c 2023-07-05 13:42:25.533986251 +1000
+++ pcp-5.3.7/src/libpcp_web/src/slots.c 2023-07-05 13:42:53.414025716 +1000
@@ -633,8 +633,10 @@ redisSlotsProxyConnect(redisSlots *slots
redisReader *reader = *readerp;
redisReply *reply = NULL;
@ -2024,8 +2278,8 @@ diff -Naurp pcp-5.3.7.orig/src/libpcp_web/src/slots.c pcp-5.3.7/src/libpcp_web/s
redisReply *errorReply = calloc(1, sizeof(redisReply));
errorReply->type = REDIS_REPLY_ERROR;
diff -Naurp pcp-5.3.7.orig/src/libpcp_web/src/timer.c pcp-5.3.7/src/libpcp_web/src/timer.c
--- pcp-5.3.7.orig/src/libpcp_web/src/timer.c 2021-09-24 09:33:06.000000000 +1000
+++ pcp-5.3.7/src/libpcp_web/src/timer.c 2023-03-09 11:32:07.949159617 +1100
--- pcp-5.3.7.orig/src/libpcp_web/src/timer.c 2023-07-05 13:42:25.533986251 +1000
+++ pcp-5.3.7/src/libpcp_web/src/timer.c 2023-07-05 13:42:53.414025716 +1000
@@ -13,6 +13,7 @@
*/
#include <sys/resource.h>
@ -2132,8 +2386,8 @@ diff -Naurp pcp-5.3.7.orig/src/libpcp_web/src/timer.c pcp-5.3.7/src/libpcp_web/s
/* PID doesn't change, set it once */
mmv_set(map, server.metrics[SERVER_PID], &pid);
diff -Naurp pcp-5.3.7.orig/src/libpcp_web/src/webgroup.c pcp-5.3.7/src/libpcp_web/src/webgroup.c
--- pcp-5.3.7.orig/src/libpcp_web/src/webgroup.c 2023-03-08 18:43:26.232977376 +1100
+++ pcp-5.3.7/src/libpcp_web/src/webgroup.c 2023-03-09 11:31:18.809008274 +1100
--- pcp-5.3.7.orig/src/libpcp_web/src/webgroup.c 2023-07-05 13:42:25.533986251 +1000
+++ pcp-5.3.7/src/libpcp_web/src/webgroup.c 2023-07-05 13:42:53.414025716 +1000
@@ -44,10 +44,8 @@ enum matches { MATCH_EXACT, MATCH_GLOB,
enum profile { PROFILE_ADD, PROFILE_DEL };
@ -2258,9 +2512,32 @@ diff -Naurp pcp-5.3.7.orig/src/libpcp_web/src/webgroup.c pcp-5.3.7/src/libpcp_we
}
diff -Naurp pcp-5.3.7.orig/src/pmproxy/src/http.c pcp-5.3.7/src/pmproxy/src/http.c
--- pcp-5.3.7.orig/src/pmproxy/src/http.c 2022-04-05 09:05:43.000000000 +1000
+++ pcp-5.3.7/src/pmproxy/src/http.c 2023-07-05 13:43:00.414035625 +1000
@@ -581,7 +581,7 @@ http_add_parameter(dict *parameters,
return 0;
}
-static int
+int
http_parameters(const char *url, size_t length, dict **parameters)
{
const char *end = url + length;
diff -Naurp pcp-5.3.7.orig/src/pmproxy/src/http.h pcp-5.3.7/src/pmproxy/src/http.h
--- pcp-5.3.7.orig/src/pmproxy/src/http.h 2022-04-05 09:05:43.000000000 +1000
+++ pcp-5.3.7/src/pmproxy/src/http.h 2023-07-05 13:43:00.414035625 +1000
@@ -64,6 +64,7 @@ extern void http_transfer(struct client
extern void http_reply(struct client *, sds, http_code_t, http_flags_t, http_options_t);
extern void http_error(struct client *, http_code_t, const char *);
+extern int http_parameters(const char *, size_t, dict **);
extern int http_decode(const char *, size_t, sds);
extern const char *http_status_mapping(http_code_t);
extern const char *http_content_type(http_flags_t);
diff -Naurp pcp-5.3.7.orig/src/pmproxy/src/search.c pcp-5.3.7/src/pmproxy/src/search.c
--- pcp-5.3.7.orig/src/pmproxy/src/search.c 2021-09-24 09:33:06.000000000 +1000
+++ pcp-5.3.7/src/pmproxy/src/search.c 2023-03-09 11:33:09.619349551 +1100
--- pcp-5.3.7.orig/src/pmproxy/src/search.c 2023-07-05 13:42:25.533986251 +1000
+++ pcp-5.3.7/src/pmproxy/src/search.c 2023-07-05 13:42:53.414025716 +1000
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2020 Red Hat.
@ -2289,8 +2566,8 @@ diff -Naurp pcp-5.3.7.orig/src/pmproxy/src/search.c pcp-5.3.7/src/pmproxy/src/se
on_pmsearch_done(-EINVAL, baton);
return 1;
diff -Naurp pcp-5.3.7.orig/src/pmproxy/src/series.c pcp-5.3.7/src/pmproxy/src/series.c
--- pcp-5.3.7.orig/src/pmproxy/src/series.c 2022-04-05 09:05:43.000000000 +1000
+++ pcp-5.3.7/src/pmproxy/src/series.c 2023-03-09 11:33:09.619349551 +1100
--- pcp-5.3.7.orig/src/pmproxy/src/series.c 2023-07-05 13:42:25.533986251 +1000
+++ pcp-5.3.7/src/pmproxy/src/series.c 2023-07-05 13:43:00.414035625 +1000
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2019-2020 Red Hat.
@ -2298,7 +2575,15 @@ diff -Naurp pcp-5.3.7.orig/src/pmproxy/src/series.c pcp-5.3.7/src/pmproxy/src/se
*
* This program is free software; you can redistribute it and/or modify it
* under the terms of the GNU Lesser General Public License as published
@@ -592,6 +592,9 @@ on_pmseries_done(int status, void *arg)
@@ -12,6 +12,7 @@
* License for more details.
*/
#include "server.h"
+#include "util.h"
#include <assert.h>
typedef enum pmSeriesRestKey {
@@ -592,6 +593,9 @@ on_pmseries_done(int status, void *arg)
flags |= HTTP_FLAG_JSON;
}
http_reply(client, msg, code, flags, options);
@ -2308,7 +2593,43 @@ diff -Naurp pcp-5.3.7.orig/src/pmproxy/src/series.c pcp-5.3.7/src/pmproxy/src/se
}
static void
@@ -890,10 +893,16 @@ pmseries_request_load(struct client *cli
@@ -824,30 +828,26 @@ static int
pmseries_request_body(struct client *client, const char *content, size_t length)
{
pmSeriesBaton *baton = (pmSeriesBaton *)client->u.http.data;
- sds series;
if (pmDebugOptions.http)
fprintf(stderr, "series servlet body (client=%p)\n", client);
- if (client->u.http.parser.method != HTTP_POST)
+ if (client->u.http.parser.method != HTTP_POST || client->u.http.parameters != NULL)
return 0;
switch (baton->restkey) {
case RESTKEY_LOAD:
case RESTKEY_QUERY:
- sdsfree(baton->query);
- baton->query = sdsnewlen(content, length);
- break;
-
case RESTKEY_DESC:
case RESTKEY_INSTS:
case RESTKEY_LABELS:
case RESTKEY_METRIC:
case RESTKEY_SOURCE:
case RESTKEY_VALUES:
- series = sdsnewlen(content, length);
- baton->sids = sdssplitlen(series, length, "\n", 1, &baton->nsids);
- sdsfree(series);
+ /* parse URL encoded parameters in the request body */
+ /* in the same way as the URL query string */
+ http_parameters(content, length, &client->u.http.parameters);
+ pmseries_setup_request_parameters(client, baton, client->u.http.parameters);
break;
default:
@@ -890,10 +890,16 @@ pmseries_request_load(struct client *cli
message = sdsnewlen(failed, sizeof(failed) - 1);
http_reply(client, message, HTTP_STATUS_BAD_REQUEST,
HTTP_FLAG_JSON, baton->options);
@ -2325,7 +2646,7 @@ diff -Naurp pcp-5.3.7.orig/src/pmproxy/src/series.c pcp-5.3.7/src/pmproxy/src/se
} else {
baton->loading.data = baton;
uv_queue_work(client->proxy->events, &baton->loading,
@@ -907,6 +916,9 @@ pmseries_request_done(struct client *cli
@@ -907,6 +913,9 @@ pmseries_request_done(struct client *cli
pmSeriesBaton *baton = (pmSeriesBaton *)client->u.http.data;
int sts;
@ -2336,8 +2657,8 @@ diff -Naurp pcp-5.3.7.orig/src/pmproxy/src/series.c pcp-5.3.7/src/pmproxy/src/se
on_pmseries_done(-EINVAL, baton);
return 1;
diff -Naurp pcp-5.3.7.orig/src/pmproxy/src/server.c pcp-5.3.7/src/pmproxy/src/server.c
--- pcp-5.3.7.orig/src/pmproxy/src/server.c 2023-03-08 18:43:26.232977376 +1100
+++ pcp-5.3.7/src/pmproxy/src/server.c 2023-03-09 11:33:09.619349551 +1100
--- pcp-5.3.7.orig/src/pmproxy/src/server.c 2023-07-05 13:42:25.533986251 +1000
+++ pcp-5.3.7/src/pmproxy/src/server.c 2023-07-05 13:42:53.424025730 +1000
@@ -180,7 +180,9 @@ signal_init(struct proxy *proxy)
{
uv_loop_t *loop = proxy->events;

View File

@ -0,0 +1,94 @@
diff -Naurp pcp-5.3.7.orig/src/pmdas/bcc/Upgrade pcp-5.3.7/src/pmdas/bcc/Upgrade
--- pcp-5.3.7.orig/src/pmdas/bcc/Upgrade 2021-08-16 14:12:25.000000000 +1000
+++ pcp-5.3.7/src/pmdas/bcc/Upgrade 2023-07-10 16:25:31.904767032 +1000
@@ -26,8 +26,11 @@ then
else
sed -i -e "s,^\(bcc.*binary\),\1 notready,g" $PCP_PMCDCONF_PATH
fi
- sed -i \
- -e "s,python $PCP_PMDAS_DIR/bcc/,$PCP_PYTHON_PROG $PCP_PMDAS_DIR/bcc/,g" \
- $PCP_PMCDCONF_PATH 2>/dev/null
+ if grep -q '^bcc.*python ' "$PCP_PMCDCONF_PATH" 2>/dev/null
+ then
+ sed -i \
+ -e "s,python $PCP_PMDAS_DIR/bcc/,$PCP_PYTHON_PROG $PCP_PMDAS_DIR/bcc/,g" \
+ $PCP_PMCDCONF_PATH 2>/dev/null
+ fi
fi
exit 0
diff -Naurp pcp-5.3.7.orig/src/pmdas/kvm/Upgrade pcp-5.3.7/src/pmdas/kvm/Upgrade
--- pcp-5.3.7.orig/src/pmdas/kvm/Upgrade 2019-02-06 17:16:29.000000000 +1100
+++ pcp-5.3.7/src/pmdas/kvm/Upgrade 2023-07-10 16:25:31.904767032 +1000
@@ -17,7 +17,7 @@
. $PCP_DIR/etc/pcp.env
-if grep -q ^kvm "$PCP_PMCDCONF_PATH" 2>/dev/null
+if grep -q '^kvm.*perl.*' "$PCP_PMCDCONF_PATH" 2>/dev/null
then
sed -i -e "s,perl $PCP_PMDAS_DIR/kvm/pmdakvm.pl,$PCP_PMDAS_DIR/kvm/pmdakvm -d 95,g" $PCP_PMCDCONF_PATH 2>/dev/null
fi
diff -Naurp pcp-5.3.7.orig/src/pmdas/mssql/Upgrade pcp-5.3.7/src/pmdas/mssql/Upgrade
--- pcp-5.3.7.orig/src/pmdas/mssql/Upgrade 2021-08-16 14:12:25.000000000 +1000
+++ pcp-5.3.7/src/pmdas/mssql/Upgrade 2023-07-10 16:25:31.904767032 +1000
@@ -17,14 +17,20 @@
. $PCP_DIR/etc/pcp.env
-if grep -q ^mssql "$PCP_PMCDCONF_PATH" 2>/dev/null
+if grep -q '^mssql.*perl ' "$PCP_PMCDCONF_PATH" 2>/dev/null
then
sed -i \
- -e "s,python $PCP_PMDAS_DIR/mssql/,$PCP_PYTHON_PROG $PCP_PMDAS_DIR/mssql/,g" \
-e "s,perl $PCP_PMDAS_DIR/mssql/pmdamssql.pl,$PCP_PYTHON_PROG $PCP_PMDAS_DIR/mssql/pmdamssql.python,g" \
$PCP_PMCDCONF_PATH 2>/dev/null
fi
+if grep -q '^mssql.*python ' "$PCP_PMCDCONF_PATH" 2>/dev/null
+then
+ sed -i \
+ -e "s,python $PCP_PMDAS_DIR/mssql/,$PCP_PYTHON_PROG $PCP_PMDAS_DIR/mssql/,g" \
+ $PCP_PMCDCONF_PATH 2>/dev/null
+fi
+
perlpath=`which $PCP_PERL_PROG`
original="$PCP_PMDAS_DIR/mssql/mssql.conf"
upgraded="$PCP_PMDAS_DIR/mssql/mssql.conf.tmp"
diff -Naurp pcp-5.3.7.orig/src/pmdas/openmetrics/Upgrade pcp-5.3.7/src/pmdas/openmetrics/Upgrade
--- pcp-5.3.7.orig/src/pmdas/openmetrics/Upgrade 2021-08-16 14:12:25.000000000 +1000
+++ pcp-5.3.7/src/pmdas/openmetrics/Upgrade 2023-07-10 16:25:31.904767032 +1000
@@ -36,7 +36,7 @@ then
rm -f "$PCP_VAR_DIR/pmns/prometheus" 2>/dev/null
fi
-if grep -q ^openmetrics "$PCP_PMCDCONF_PATH" 2>/dev/null
+if grep -q '^openmetrics.*python ' "$PCP_PMCDCONF_PATH" 2>/dev/null
then
sed -i -e "s,python $PCP_PMDAS_DIR/openmetrics/,$PCP_PYTHON_PROG $PCP_PMDAS_DIR/openmetrics/,g" $PCP_PMCDCONF_PATH 2>/dev/null
fi
diff -Naurp pcp-5.3.7.orig/src/pmdas/postgresql/Upgrade pcp-5.3.7/src/pmdas/postgresql/Upgrade
--- pcp-5.3.7.orig/src/pmdas/postgresql/Upgrade 2021-08-16 14:12:25.000000000 +1000
+++ pcp-5.3.7/src/pmdas/postgresql/Upgrade 2023-07-10 16:25:31.914767070 +1000
@@ -17,14 +17,20 @@
. $PCP_DIR/etc/pcp.env
-if grep -q ^postgresql "$PCP_PMCDCONF_PATH" 2>/dev/null
+if grep -q '^postgresql.*perl ' "$PCP_PMCDCONF_PATH" 2>/dev/null
then
sed -i \
- -e "s,python $PCP_PMDAS_DIR/postgresql/,$PCP_PYTHON_PROG $PCP_PMDAS_DIR/postgresql/,g" \
-e "s,perl $PCP_PMDAS_DIR/postgresql/pmdapostgresql.pl,$PCP_PYTHON_PROG $PCP_PMDAS_DIR/postgresql/pmdapostgresql.python,g" \
$PCP_PMCDCONF_PATH 2>/dev/null
fi
+if grep -q '^postgresql.*python ' "$PCP_PMCDCONF_PATH" 2>/dev/null
+then
+ sed -i \
+ -e "s,python $PCP_PMDAS_DIR/postgresql/,$PCP_PYTHON_PROG $PCP_PMDAS_DIR/postgresql/,g" \
+ $PCP_PMCDCONF_PATH 2>/dev/null
+fi
+
perlpath=`which $PCP_PERL_PROG`
original="$PCP_PMDAS_DIR/postgresql/postgresql.conf"
upgraded="$PCP_PMDAS_DIR/postgresql/pmdapostgresql.conf"

View File

@ -0,0 +1,729 @@
diff -Naurp pcp-5.3.7.orig/qa/1897.out pcp-5.3.7/qa/1897.out
--- pcp-5.3.7.orig/qa/1897.out 2021-09-30 12:56:49.000000000 +1000
+++ pcp-5.3.7/qa/1897.out 2023-07-05 14:08:48.576224340 +1000
@@ -376,12 +376,12 @@ is given as label metadata values for th
inst [2 or "node-2:test_clone_state"] value 1
inst [3 or "node-2:test_site"] value 1
-ha_cluster.pacemaker.nodes.status.dc PMID: 155.3.8 [Whether the node status is given as disconnected]
+ha_cluster.pacemaker.nodes.status.dc PMID: 155.3.8 [Whether the node status is given as the DC]
Data Type: 32-bit unsigned int InDom: 155.2 0x26c00002
Semantics: instant Units: count
Help:
-Whether the disconnected status is reported by the node in the cluster, a
-value of 1 confirms the node status as disconnected.
+Whether the DC status is reported by the node in the cluster, a
+value of 1 confirms the node status as the designated coordinator.
inst [0 or "node-1"] value 0
inst [1 or "node-2"] value 1
@@ -680,6 +680,632 @@ ha_cluster.drbd.split_brain
=== std err ===
=== filtered valgrind report ===
Memcheck, a memory error detector
+Command: pminfo -L -K clear -K add,155,PCP_PMDAS_DIR/hacluster/pmda_hacluster.so,hacluster_init -f ha_cluster.pacemaker.config_last_change ha_cluster.corosync.quorate ha_cluster.sbd.devices.path ha_cluster.drbd.split_brain
+LEAK SUMMARY:
+definitely lost: 0 bytes in 0 blocks
+indirectly lost: 0 bytes in 0 blocks
+ERROR SUMMARY: 0 errors from 0 contexts ...
+
+== done
+
+== Checking metric descriptors and values - hacluster-root-002.tgz
+
+ha_cluster.corosync.member_votes.local PMID: 155.6.1 [Votes that are local to this node]
+ Data Type: 32-bit unsigned int InDom: 155.5 0x26c00005
+ Semantics: instant Units: count
+Help:
+The quorum votes which are local to this node in the cluster.
+ inst [0 or "rhel9-node1"] value 1
+ inst [1 or "rhel9-node2"] value 0
+
+ha_cluster.corosync.member_votes.node_id PMID: 155.6.2 [Node ID]
+ Data Type: 64-bit unsigned int InDom: 155.5 0x26c00005
+ Semantics: instant Units: count
+Help:
+The full corosync ID for the nodes in the cluster.
+ inst [0 or "rhel9-node1"] value 1
+ inst [1 or "rhel9-node2"] value 2
+
+ha_cluster.corosync.member_votes.votes PMID: 155.6.0 [Quorum votes per node]
+ Data Type: 32-bit unsigned int InDom: 155.5 0x26c00005
+ Semantics: instant Units: count
+Help:
+The number of quorum votes allocated to each node in the cluster.
+ inst [0 or "rhel9-node1"] value 1
+ inst [1 or "rhel9-node2"] value 1
+
+ha_cluster.corosync.quorate PMID: 155.7.0 [Value given for quorate]
+ Data Type: 32-bit unsigned int InDom: PM_INDOM_NULL 0xffffffff
+ Semantics: instant Units: count
+Help:
+The value represents whether or not the cluster is quorate.
+ value 1
+
+ha_cluster.corosync.quorum_votes.expected_votes PMID: 155.7.1 [Expected vote count]
+ Data Type: 32-bit unsigned int InDom: PM_INDOM_NULL 0xffffffff
+ Semantics: instant Units: count
+Help:
+The number of expected quorum votes for the cluster.
+ value 2
+
+ha_cluster.corosync.quorum_votes.highest_expected PMID: 155.7.2 [Highest expected vote count]
+ Data Type: 32-bit unsigned int InDom: PM_INDOM_NULL 0xffffffff
+ Semantics: instant Units: count
+Help:
+The highest number of expected quorum votes for the cluster.
+ value 2
+
+ha_cluster.corosync.quorum_votes.quorum PMID: 155.7.4 [Whether cluster is quorate]
+ Data Type: 32-bit unsigned int InDom: PM_INDOM_NULL 0xffffffff
+ Semantics: instant Units: count
+Help:
+The value reported for the quorate for the cluster.
+ value 1
+
+ha_cluster.corosync.quorum_votes.total_votes PMID: 155.7.3 [Total number of votes]
+ Data Type: 32-bit unsigned int InDom: PM_INDOM_NULL 0xffffffff
+ Semantics: instant Units: count
+Help:
+The total number of quorum votes for the cluster.
+ value 2
+
+ha_cluster.corosync.ring_errors PMID: 155.7.5 [Number of faulty rings]
+ Data Type: 32-bit unsigned int InDom: PM_INDOM_NULL 0xffffffff
+ Semantics: instant Units: count
+Help:
+The total number of Corosync rings which are faulty.
+ value 0
+
+ha_cluster.corosync.rings.address PMID: 155.8.1 [IP Address for ring]
+ Data Type: string InDom: 155.6 0x26c00006
+ Semantics: instant Units: count
+Help:
+The IP address locally linked to this ring.
+ inst [0 or "0"] value "192.168.122.148"
+
+ha_cluster.corosync.rings.all PMID: 155.15.0 [Corosync rings information]
+ Data Type: 32-bit unsigned int InDom: 155.13 0x26c0000d
+ Semantics: instant Units: count
+Help:
+Value is 1 if a ring exists. The details of the corresponding ring
+is given as label metadata values for this metric.
+ inst [0 or "0"] value 1
+
+ha_cluster.corosync.rings.node_id PMID: 155.8.2 [ID of the local node]
+ Data Type: 64-bit unsigned int InDom: 155.6 0x26c00006
+ Semantics: instant Units: count
+Help:
+The internal Corosync node ID to the node matched to the ring.
+ inst [0 or "0"] value 1
+
+ha_cluster.corosync.rings.number PMID: 155.8.3 [Ring number]
+ Data Type: 32-bit unsigned int InDom: 155.6 0x26c00006
+ Semantics: instant Units: count
+Help:
+The number for the Corosync ring.
+ inst [0 or "0"] value 0
+
+ha_cluster.corosync.rings.ring_id PMID: 155.8.4 [Ring ID]
+ Data Type: string InDom: 155.6 0x26c00006
+ Semantics: instant Units: count
+Help:
+The internal Corosync ring ID, corresponds to the first node to join.
+ inst [0 or "0"] value "1.9"
+
+ha_cluster.corosync.rings.status PMID: 155.8.0 [Corosync ring status]
+ Data Type: 32-bit unsigned int InDom: 155.6 0x26c00006
+ Semantics: instant Units: count
+Help:
+The status for each Corosync ring in the cluster, a value of 1 is faulty and
+0 is healthy.
+ inst [0 or "0"] value 0
+
+ha_cluster.drbd.al_writes PMID: 155.10.6 [Writes to the activity log]
+ Data Type: 64-bit unsigned int InDom: 155.8 0x26c00008
+ Semantics: instant Units: count
+Help:
+Amount of writes to the activity log area of metadata by the DRBD
+resource:volume.
+No value(s) available!
+
+ha_cluster.drbd.bm_writes PMID: 155.10.7 [Writes to bitmap area]
+ Data Type: 64-bit unsigned int InDom: 155.8 0x26c00008
+ Semantics: instant Units: count
+Help:
+Amount of writes to the bitmap area of metadata by the DRBD resource:volume.
+No value(s) available!
+
+ha_cluster.drbd.connections.all PMID: 155.18.0 [DRBD Peer disk information]
+ Data Type: 32-bit unsigned int InDom: 155.16 0x26c00010
+ Semantics: instant Units: count
+Help:
+Value is 1 if a drbd peer connection exists. The details of the corresponding DRBD peer
+connection is given as label metadata values for this metric.
+No value(s) available!
+
+ha_cluster.drbd.connections.peer_disk_state PMID: 155.11.4 [Peer disk state]
+ Data Type: string InDom: 155.9 0x26c00009
+ Semantics: instant Units: count
+Help:
+The reported peer disk state for the connection.
+No value(s) available!
+
+ha_cluster.drbd.connections.peer_node_id PMID: 155.11.1 [The ID the connection is for]
+ Data Type: string InDom: 155.9 0x26c00009
+ Semantics: instant Units: count
+Help:
+The given peer node ID for which the connection is for.
+No value(s) available!
+
+ha_cluster.drbd.connections.peer_role PMID: 155.11.2 [Role of the connection]
+ Data Type: string InDom: 155.9 0x26c00009
+ Semantics: instant Units: count
+Help:
+The reported role type for the connection.
+No value(s) available!
+
+ha_cluster.drbd.connections.resource PMID: 155.11.0 [Resource that the connection is for]
+ Data Type: string InDom: 155.9 0x26c00009
+ Semantics: instant Units: count
+Help:
+The given resource that the DRBD connection is for each resource:volume.
+No value(s) available!
+
+ha_cluster.drbd.connections.volume PMID: 155.11.3 [Volume number]
+ Data Type: 32-bit unsigned int InDom: 155.9 0x26c00009
+ Semantics: instant Units: count
+Help:
+The reported volume for the connection.
+No value(s) available!
+
+ha_cluster.drbd.connections_pending PMID: 155.11.8 [Number of connections pending]
+ Data Type: 32-bit unsigned int InDom: 155.9 0x26c00009
+ Semantics: instant Units: count
+Help:
+The number of requests sent which have not yet been received by DRBD for the
+resource:volume.
+No value(s) available!
+
+ha_cluster.drbd.connections_received PMID: 155.11.6 [Volume of data received]
+ Data Type: 64-bit unsigned int InDom: 155.9 0x26c00009
+ Semantics: instant Units: count
+Help:
+The volume of data received via the network connection in KiB by DRBD for the
+resource:volume.
+No value(s) available!
+
+ha_cluster.drbd.connections_sent PMID: 155.11.7 [Volume of data sent]
+ Data Type: 64-bit unsigned int InDom: 155.9 0x26c00009
+ Semantics: instant Units: count
+Help:
+The volume of data sent via the network connection in KiB by DRBD for the
+resource:volume.
+No value(s) available!
+
+ha_cluster.drbd.connections_sync PMID: 155.11.5 [Connections in sync]
+ Data Type: float InDom: 155.9 0x26c00009
+ Semantics: instant Units: count
+Help:
+The number of DRBD connections in sync for each resource:volume, this value is
+between 0 to 100.
+No value(s) available!
+
+ha_cluster.drbd.connections_unacked PMID: 155.11.9 [Number of connection not acknowledged]
+ Data Type: 32-bit unsigned int InDom: 155.9 0x26c00009
+ Semantics: instant Units: count
+Help:
+The number of requests sent which have not yet been acknowledged by DRBD for
+the resource:volume.
+No value(s) available!
+
+ha_cluster.drbd.lower_pending PMID: 155.10.9 [Number of open requests]
+ Data Type: 64-bit unsigned int InDom: 155.8 0x26c00008
+ Semantics: instant Units: count
+Help:
+The number of open requests to the local I/O subsystem by DRBD for the
+resource:volume.
+No value(s) available!
+
+ha_cluster.drbd.quorum PMID: 155.10.10 [Quorum status of DRBD resource:volume]
+ Data Type: 32-bit unsigned int InDom: 155.8 0x26c00008
+ Semantics: instant Units: count
+Help:
+The Quorum status of the DRBD resource according to resource:volume, 1 is
+quorate and 0 is non-quorate.
+No value(s) available!
+
+ha_cluster.drbd.read PMID: 155.10.5 [Amount read by DRBD resource]
+ Data Type: 32-bit unsigned int InDom: 155.8 0x26c00008
+ Semantics: instant Units: count
+Help:
+Amount in KiB read by the DRBD resource:volume.
+No value(s) available!
+
+ha_cluster.drbd.resources.all PMID: 155.17.0 [DRBD resource information]
+ Data Type: 32-bit unsigned int InDom: 155.15 0x26c0000f
+ Semantics: instant Units: count
+Help:
+Value is 1 if a drbd resource exists. The details of the corresponding drbd resource
+is given as label metadata values for this metric.
+No value(s) available!
+
+ha_cluster.drbd.resources.disk_state PMID: 155.10.3 [Disk state]
+ Data Type: string InDom: 155.8 0x26c00008
+ Semantics: instant Units: count
+Help:
+The current reported disk state of for the resource:volume.
+No value(s) available!
+
+ha_cluster.drbd.resources.resource PMID: 155.10.0 [Name of the resource]
+ Data Type: string InDom: 155.8 0x26c00008
+ Semantics: instant Units: count
+Help:
+The name given for the DRBD resource for each resource:volume.
+No value(s) available!
+
+ha_cluster.drbd.resources.role PMID: 155.10.1 [Role of the resource]
+ Data Type: string InDom: 155.8 0x26c00008
+ Semantics: instant Units: count
+Help:
+The reported role for the DRBD resource for each resource:volume.
+No value(s) available!
+
+ha_cluster.drbd.resources.volume PMID: 155.10.2 [Volume of the resource]
+ Data Type: string InDom: 155.8 0x26c00008
+ Semantics: instant Units: count
+Help:
+The volume number of the resource for each resource:volume.
+No value(s) available!
+
+ha_cluster.drbd.split_brain PMID: 155.10.11 [Signal for split brain detection.]
+ Data Type: 32-bit unsigned int InDom: 155.8 0x26c00008
+ Semantics: instant Units: count
+Help:
+This metric signals if there has been a split brain occurring in DRBD for the
+resource:volume, value is 1 is a split brain has been detected.
+No value(s) available!
+
+ha_cluster.drbd.upper_pending PMID: 155.10.8 [Block I/O requests pending]
+ Data Type: 64-bit unsigned int InDom: 155.8 0x26c00008
+ Semantics: instant Units: count
+Help:
+The number of the block I/O requests forwarded but not yet answered by DRBD
+for the resource:volume.
+No value(s) available!
+
+ha_cluster.drbd.written PMID: 155.10.4 [Amount written to DRBD resource]
+ Data Type: 32-bit unsigned int InDom: 155.8 0x26c00008
+ Semantics: instant Units: count
+Help:
+Amount in KiB written to the DRBD resource:volume.
+No value(s) available!
+
+ha_cluster.pacemaker.config_last_change PMID: 155.0.0 [Unix timestamp corresponding to last Pacemaker configuration change]
+ Data Type: 64-bit unsigned int InDom: PM_INDOM_NULL 0xffffffff
+ Semantics: instant Units: count
+Help:
+Unix timestamp in seconds corresponding to the last time that the Pacemaker
+configuration was changed on the system.
+ value 1687428694
+
+ha_cluster.pacemaker.fail_count PMID: 155.1.0 [The number of fail count recorded]
+ Data Type: 64-bit unsigned int InDom: 155.0 0x26c00000
+ Semantics: instant Units: count
+Help:
+The number of fail count per node and resource ID, the actual maximum value
+depends on Pacemaker internals.
+No value(s) available!
+
+ha_cluster.pacemaker.location_constraints.all PMID: 155.12.0 [Location constraint information]
+ Data Type: 32-bit unsigned int InDom: 155.10 0x26c0000a
+ Semantics: instant Units: count
+Help:
+Value is 1 if a location constraint exists. The details of the location constraint
+is given as label metadata values for this metric.
+No value(s) available!
+
+ha_cluster.pacemaker.location_constraints.node PMID: 155.2.0 [Node of the location constraint]
+ Data Type: string InDom: 155.1 0x26c00001
+ Semantics: instant Units: count
+Help:
+The node that the location constraint applies to in the cluster.
+No value(s) available!
+
+ha_cluster.pacemaker.location_constraints.resource PMID: 155.2.1 [Resource of the location constraint]
+ Data Type: string InDom: 155.1 0x26c00001
+ Semantics: instant Units: count
+Help:
+The resource that the location constraint applies to in the cluster.
+No value(s) available!
+
+ha_cluster.pacemaker.location_constraints.role PMID: 155.2.2 [Resource role of the location constraint]
+ Data Type: string InDom: 155.1 0x26c00001
+ Semantics: instant Units: count
+Help:
+The resource role that the location constraint applies to, if any.
+No value(s) available!
+
+ha_cluster.pacemaker.location_constraints.score PMID: 155.2.3 [Score of the location constraint]
+ Data Type: string InDom: 155.1 0x26c00001
+ Semantics: instant Units: count
+Help:
+The score given to the location constraint by Pacemaker, the value depends on
+Pacemaker internals.
+No value(s) available!
+
+ha_cluster.pacemaker.migration_threshold PMID: 155.1.1 [Migration threshold per node and resource ID]
+ Data Type: 64-bit unsigned int InDom: 155.0 0x26c00000
+ Semantics: instant Units: count
+Help:
+The value for the migration threshold per node and resource ID set by the
+Pacemaker cluster.
+No value(s) available!
+
+ha_cluster.pacemaker.node_attributes PMID: 155.4.0 [Metadata used by Resource Agents]
+ Data Type: string InDom: 155.3 0x26c00003
+ Semantics: instant Units: count
+Help:
+The raw values for the cluster metadata attributes and their value per node as
+used by the Resource Agents.
+No value(s) available!
+
+ha_cluster.pacemaker.node_attributes_all PMID: 155.13.0 [Metadata information]
+ Data Type: 32-bit unsigned int InDom: 155.11 0x26c0000b
+ Semantics: instant Units: count
+Help:
+Value is 1 if a node metadata exists. The details of the node metadata
+is given as label metadata values for this metric.
+No value(s) available!
+
+ha_cluster.pacemaker.nodes.status.dc PMID: 155.3.8 [Whether the node status is given as the DC]
+ Data Type: 32-bit unsigned int InDom: 155.2 0x26c00002
+ Semantics: instant Units: count
+Help:
+Whether the DC status is reported by the node in the cluster, a
+value of 1 confirms the node status as the designated coordinator.
+ inst [0 or "rhel9-node1"] value 0
+ inst [1 or "rhel9-node2"] value 1
+
+ha_cluster.pacemaker.nodes.status.expected_up PMID: 155.3.7 [Whether the node status is given as expected_up]
+ Data Type: 32-bit unsigned int InDom: 155.2 0x26c00002
+ Semantics: instant Units: count
+Help:
+Whether the expected_up status is reported by the node in the cluster, a
+value of 1 confirms the node status as expected_up.
+ inst [0 or "rhel9-node1"] value 1
+ inst [1 or "rhel9-node2"] value 1
+
+ha_cluster.pacemaker.nodes.status.maintenance PMID: 155.3.3 [Whether the node status is given as maintenance]
+ Data Type: 32-bit unsigned int InDom: 155.2 0x26c00002
+ Semantics: instant Units: count
+Help:
+Whether the maintenance status is reported by the node in the cluster, a
+value of 1 confirms the node status as online.
+ inst [0 or "rhel9-node1"] value 0
+ inst [1 or "rhel9-node2"] value 0
+
+ha_cluster.pacemaker.nodes.status.online PMID: 155.3.0 [Whether the node status is given as online]
+ Data Type: 32-bit unsigned int InDom: 155.2 0x26c00002
+ Semantics: instant Units: count
+Help:
+Whether the online status is reported by the node in the cluster, a value of
+1 confirms the node status as online.
+ inst [0 or "rhel9-node1"] value 1
+ inst [1 or "rhel9-node2"] value 1
+
+ha_cluster.pacemaker.nodes.status.pending PMID: 155.3.4 [Whether the node status is given as pending]
+ Data Type: 32-bit unsigned int InDom: 155.2 0x26c00002
+ Semantics: instant Units: count
+Help:
+Whether the pending status is reported by the node in the cluster, a value of
+1 confirms the node status as pending.
+ inst [0 or "rhel9-node1"] value 0
+ inst [1 or "rhel9-node2"] value 0
+
+ha_cluster.pacemaker.nodes.status.shutdown PMID: 155.3.6 [Whether the node status is given as shutdown]
+ Data Type: 32-bit unsigned int InDom: 155.2 0x26c00002
+ Semantics: instant Units: count
+Help:
+Whether the shutdown status is reported by the node in the cluster, a value
+of 1 confirms the node status as shutdown.
+ inst [0 or "rhel9-node1"] value 0
+ inst [1 or "rhel9-node2"] value 0
+
+ha_cluster.pacemaker.nodes.status.standby PMID: 155.3.1 [Whether the node status is given as standby]
+ Data Type: 32-bit unsigned int InDom: 155.2 0x26c00002
+ Semantics: instant Units: count
+Help:
+Whether the standby status is reported by the node in the cluster, a value of
+1 confirms the node status as standby.
+ inst [0 or "rhel9-node1"] value 0
+ inst [1 or "rhel9-node2"] value 0
+
+ha_cluster.pacemaker.nodes.status.standby_on_fail PMID: 155.3.2 [Whether the node status is given as standby_on_fail]
+ Data Type: 32-bit unsigned int InDom: 155.2 0x26c00002
+ Semantics: instant Units: count
+Help:
+Whether the standby_on_fail status is reported by the node in the cluster,
+a value of 1 confirms the node status as standby_on_fail.
+ inst [0 or "rhel9-node1"] value 0
+ inst [1 or "rhel9-node2"] value 0
+
+ha_cluster.pacemaker.nodes.status.unclean PMID: 155.3.5 [Whether the node status is given as unclean]
+ Data Type: 32-bit unsigned int InDom: 155.2 0x26c00002
+ Semantics: instant Units: count
+Help:
+Whether the unclean status is reported by the node in the cluster, a value of
+1 confirms the node status as unclean.
+ inst [0 or "rhel9-node1"] value 0
+ inst [1 or "rhel9-node2"] value 0
+
+ha_cluster.pacemaker.nodes.type PMID: 155.3.9 [The type given to the node]
+ Data Type: string InDom: 155.2 0x26c00002
+ Semantics: instant Units: count
+Help:
+The membership type given to the node in the Pacemaker cluster.
+ inst [0 or "rhel9-node1"] value "member"
+ inst [1 or "rhel9-node2"] value "member"
+
+ha_cluster.pacemaker.resources.agent PMID: 155.5.0 [The name of the resource agent for this resource]
+ Data Type: string InDom: 155.4 0x26c00004
+ Semantics: instant Units: count
+Help:
+The name given for the resource agent for the given resource instance in the
+cluster.
+No value(s) available!
+
+ha_cluster.pacemaker.resources.all PMID: 155.14.0 [Pacemaker resources information]
+ Data Type: 32-bit unsigned int InDom: 155.12 0x26c0000c
+ Semantics: instant Units: count
+Help:
+Value is 1 if a resources exists. The details of the resource
+is given as label metadata values for this metric.
+No value(s) available!
+
+ha_cluster.pacemaker.resources.clone PMID: 155.5.1 [The name of the clone given for this resource]
+ Data Type: string InDom: 155.4 0x26c00004
+ Semantics: instant Units: count
+Help:
+The name given for the clone for the given resource instance in the cluster,
+if any.
+No value(s) available!
+
+ha_cluster.pacemaker.resources.group PMID: 155.5.2 [The name of the group given for this resource]
+ Data Type: string InDom: 155.4 0x26c00004
+ Semantics: instant Units: count
+Help:
+The name given for the group for the given resource instance in the cluster,
+if any.
+No value(s) available!
+
+ha_cluster.pacemaker.resources.managed PMID: 155.5.3 [Value is either true or false]
+ Data Type: 32-bit unsigned int InDom: 155.4 0x26c00004
+ Semantics: instant Units: count
+Help:
+The value of whether the resource instance in the cluster is managed or not.
+No value(s) available!
+
+ha_cluster.pacemaker.resources.role PMID: 155.5.4 [The given role state]
+ Data Type: string InDom: 155.4 0x26c00004
+ Semantics: instant Units: count
+Help:
+The value of the given role state for the resource instance in the cluster.
+No value(s) available!
+
+ha_cluster.pacemaker.resources.status.active PMID: 155.5.5 [Whether the resources status is given as active]
+ Data Type: 32-bit unsigned int InDom: 155.4 0x26c00004
+ Semantics: instant Units: count
+Help:
+Whether the active status is reported by the resource in the cluster, a
+value of 1 confirms the resource status as active.
+No value(s) available!
+
+ha_cluster.pacemaker.resources.status.blocked PMID: 155.5.7 [Whether the resources status is given as blocked]
+ Data Type: 32-bit unsigned int InDom: 155.4 0x26c00004
+ Semantics: instant Units: count
+Help:
+Whether the blocked status is reported by the resource in the cluster, a
+value of 1 confirms the resource status as blocked.
+No value(s) available!
+
+ha_cluster.pacemaker.resources.status.failed PMID: 155.5.8 [Whether the resources status is given as failed]
+ Data Type: 32-bit unsigned int InDom: 155.4 0x26c00004
+ Semantics: instant Units: count
+Help:
+Whether the failed status is reported by the resource in the cluster, a
+value of 1 confirms the resource status as failed.
+No value(s) available!
+
+ha_cluster.pacemaker.resources.status.failure_ignored PMID: 155.5.9 [Whether the resources status is given as failure_ignored]
+ Data Type: 32-bit unsigned int InDom: 155.4 0x26c00004
+ Semantics: instant Units: count
+Help:
+Whether the failure_ignored status is reported by the resource in the
+cluster, a value of 1 confirms the resource status as failure_ignored.
+No value(s) available!
+
+ha_cluster.pacemaker.resources.status.orphaned PMID: 155.5.6 [Whether the resources status is given as orphaned]
+ Data Type: 32-bit unsigned int InDom: 155.4 0x26c00004
+ Semantics: instant Units: count
+Help:
+Whether the orphaned status is reported by the resource in the cluster, a
+value of 1 confirms the resource status as orphaned.
+No value(s) available!
+
+ha_cluster.pacemaker.stonith_enabled PMID: 155.0.1 [Whether stonith is enabled in the cluster]
+ Data Type: 32-bit unsigned int InDom: PM_INDOM_NULL 0xffffffff
+ Semantics: instant Units: count
+Help:
+Value returns as to whether stonith is enabled or disabled for the cluster.
+ value 0
+
+ha_cluster.sbd.all PMID: 155.16.0 [SBD device information]
+ Data Type: 32-bit unsigned int InDom: 155.14 0x26c0000e
+ Semantics: instant Units: count
+Help:
+Value is 1 if a sbd device exists. The details of the corresponding SBD device
+is given as label metadata values for this metric.
+No value(s) available!
+
+ha_cluster.sbd.devices.path PMID: 155.9.0 [Path of SBD device]
+ Data Type: string InDom: 155.7 0x26c00007
+ Semantics: instant Units: count
+Help:
+The full path given to each SBD device.
+No value(s) available!
+
+ha_cluster.sbd.devices.status PMID: 155.9.1 [Status of the SBD device]
+ Data Type: string InDom: 155.7 0x26c00007
+ Semantics: instant Units: count
+Help:
+The current status given for each of the SBD devices, the value is one of
+healthy or unhealthy.
+No value(s) available!
+
+ha_cluster.sbd.timeouts.allocate PMID: 155.9.3 [allocate timeout value]
+ Data Type: 32-bit unsigned int InDom: 155.7 0x26c00007
+ Semantics: instant Units: count
+Help:
+The value threshold for allocate timeouts for the given SBD device.
+No value(s) available!
+
+ha_cluster.sbd.timeouts.loop PMID: 155.9.4 [loop timeout value]
+ Data Type: 32-bit unsigned int InDom: 155.7 0x26c00007
+ Semantics: instant Units: count
+Help:
+The value threshold for loop timeouts for the given SBD device.
+No value(s) available!
+
+ha_cluster.sbd.timeouts.mgswait PMID: 155.9.2 [mgswait timeout value]
+ Data Type: 32-bit unsigned int InDom: 155.7 0x26c00007
+ Semantics: instant Units: count
+Help:
+The value threshold for msgwait timeouts for the given SBD device.
+No value(s) available!
+
+ha_cluster.sbd.timeouts.watchdog PMID: 155.9.5 [watchdog timeout value]
+ Data Type: 32-bit unsigned int InDom: 155.7 0x26c00007
+ Semantics: instant Units: count
+Help:
+The value threshold for watchdog timeouts for the given SBD device.
+No value(s) available!
+== Checking with valgrind - hacluster-root-002.tgz
+=== std out ===
+
+ha_cluster.pacemaker.config_last_change
+ value 1687428694
+
+ha_cluster.corosync.quorate
+ value 1
+
+ha_cluster.sbd.devices.path
+No value(s) available!
+
+ha_cluster.drbd.split_brain
+No value(s) available!
+=== std err ===
+=== filtered valgrind report ===
+Memcheck, a memory error detector
Command: pminfo -L -K clear -K add,155,PCP_PMDAS_DIR/hacluster/pmda_hacluster.so,hacluster_init -f ha_cluster.pacemaker.config_last_change ha_cluster.corosync.quorate ha_cluster.sbd.devices.path ha_cluster.drbd.split_brain
LEAK SUMMARY:
definitely lost: 0 bytes in 0 blocks
diff -Naurp pcp-5.3.7.orig/qa/hacluster/GNUmakefile pcp-5.3.7/qa/hacluster/GNUmakefile
--- pcp-5.3.7.orig/qa/hacluster/GNUmakefile 2021-02-17 15:27:41.000000000 +1100
+++ pcp-5.3.7/qa/hacluster/GNUmakefile 2023-07-05 14:08:41.096213777 +1000
@@ -8,7 +8,7 @@ default setup default_pcp:
install install_pcp: $(ROOTFILES)
$(INSTALL) -m 755 -d $(TESTDIR)
- $(INSTALL) -m 755 -f $(ROOTFILES) $(TESTDIR)/$(ROOTFILES)
+ $(INSTALL) -m 644 -f $(ROOTFILES) $(TESTDIR)
$(INSTALL) -m 644 -f GNUmakefile.install $(TESTDIR)/GNUmakefile
include $(BUILDRULES)
diff -Naurp pcp-5.3.7.orig/src/pmdas/hacluster/help pcp-5.3.7/src/pmdas/hacluster/help
--- pcp-5.3.7.orig/src/pmdas/hacluster/help 2021-07-13 09:34:38.000000000 +1000
+++ pcp-5.3.7/src/pmdas/hacluster/help 2023-07-05 14:05:16.565924954 +1000
@@ -103,9 +103,9 @@ of 1 confirms the node status as shutdow
Whether the expected_up status is reported by the node in the cluster, a
value of 1 confirms the node status as expected_up.
-@ ha_cluster.pacemaker.nodes.status.dc Whether the node status is given as disconnected
-Whether the disconnected status is reported by the node in the cluster, a
-value of 1 confirms the node status as disconnected.
+@ ha_cluster.pacemaker.nodes.status.dc Whether the node status is given as the DC
+Whether the DC status is reported by the node in the cluster, a
+value of 1 confirms the node status as the designated coordinator.
@ ha_cluster.pacemaker.resources.agent The name of the resource agent for this resource
The name given for the resource agent for the given resource instance in the
diff -Naurp pcp-5.3.7.orig/src/pmdas/hacluster/pacemaker.c pcp-5.3.7/src/pmdas/hacluster/pacemaker.c
--- pcp-5.3.7.orig/src/pmdas/hacluster/pacemaker.c 2021-07-13 09:34:38.000000000 +1000
+++ pcp-5.3.7/src/pmdas/hacluster/pacemaker.c 2023-07-05 14:08:35.526205912 +1000
@@ -534,18 +534,33 @@ hacluster_refresh_pacemaker_nodes(const
/* Collect our node names */
if (found_nodes && strstr(buffer, node_name)) {
- 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[^\"]\"",
- online,
- standby,
- standby_on_fail,
- maintenance,
- pending,
- unclean,
- shutdown,
- expected_up,
- dc,
- nodes->type
- );
+ if(strstr(buffer, "feature_set")) {
+ sscanf(buffer, "%*s %*s %*s online=\"%9[^\"]\" standby=\"%9[^\"]\" standby_onfail=\"%9[^\"]\" maintenance=\"%9[^\"]\" pending=\"%9[^\"]\" unclean=\"%9[^\"]\" %*s %*s shutdown=\"%9[^\"]\" expected_up=\"%9[^\"]\" is_dc =\"%9[^\"]\" %*s type=\"%9[^\"]\"",
+ online,
+ standby,
+ standby_on_fail,
+ maintenance,
+ pending,
+ unclean,
+ shutdown,
+ expected_up,
+ dc,
+ nodes->type
+ );
+ } else {
+ 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[^\"]\"",
+ online,
+ standby,
+ standby_on_fail,
+ maintenance,
+ pending,
+ unclean,
+ shutdown,
+ expected_up,
+ dc,
+ nodes->type
+ );
+ }
nodes->online = bool_convert(online);
nodes->standby = bool_convert(standby);