Rebase to pcp-6.3.1-1 with latest upstream fixes and features

Resolves: RHEL-30590
Resolves: RHEL-40631
Resolves: RHEL-45715
Resolves: RHEL-50941
Resolves: RHEL-58914
Resolves: RHEL-59366
Resolves: RHEL-58953
This commit is contained in:
Nathan Scott 2024-10-02 09:24:31 +10:00
parent e27c1f0e2b
commit 2a32e6eb7a
7 changed files with 79 additions and 1307 deletions

View File

@ -1,6 +1,6 @@
Name: pcp
Version: 6.2.2
Release: 6%{?dist}
Version: 6.3.1
Release: 1%{?dist}
Summary: System-level performance monitoring and performance management
License: GPL-2.0-or-later AND LGPL-2.1-or-later AND CC-BY-3.0
URL: https://pcp.io
@ -9,11 +9,6 @@ Source0: https://github.com/performancecopilot/pcp/releases/pcp-%{version}.src.t
# Keep xx-default-archive-version.patch for the life of RHEL9
Patch1: redhat-issues-RHEL-2317-default-archive-version.patch
Patch2: redhat-issues-RHEL-30198-pmcd-logdir-tmpfiles.patch
Patch3: revert-time64_t-i386.patch
Patch4: redhat-issues-39159-39132-32983-39293.patch
Patch5: redhat-issues-RHEL-40718-java-bytecode-update.patch
Patch6: redhat-issues-RHEL-50693-hacluster-metrics-update.patch
%if 0%{?fedora} >= 40 || 0%{?rhel} >= 10
ExcludeArch: %{ix86}
@ -73,6 +68,13 @@ ExcludeArch: %{ix86}
%global disable_statsd 1
%endif
# GFS2 filesystem no longer supported here
%if 0%{?rhel} >= 10
%global disable_gfs2 1
%else
%global disable_gfs2 0
%endif
%if 0%{?fedora} >= 30 || 0%{?rhel} > 7
%global _with_python2 --with-python=no
%global disable_python2 1
@ -227,6 +229,12 @@ ExcludeArch: %{ix86}
%global disable_xlsx 1
%endif
%if 0%{?fedora} >= 40 || 0%{?rhel} >= 10
%global disable_amdgpu 0
%else
%global disable_amdgpu 1
%endif
# prevent conflicting binary and man page install for pcp(1)
Conflicts: librapi < 0.16
@ -387,6 +395,12 @@ Requires: pcp-selinux = %{version}-%{release}
%global _with_perfevent --with-perfevent=yes
%endif
%if %{disable_gfs2}
%global _with_gfs2 --with-pmdagfs2=no
%else
%global _with_gfs2 --with-pmdagfs2=yes
%endif
%if %{disable_statsd}
%global _with_statsd --with-pmdastatsd=no
%else
@ -466,11 +480,12 @@ fi
}
%global run_pmieconf() %{expand:
if [ -w "%1" ]
if [ -d "%1" -a -w "%1" -a -w "%1/%2" ]
then
pmieconf -c enable "%2"
pmieconf -f "%1/%2" -c enable "%3"
chown pcp:pcp "%1/%2" 2>/dev/null
else
echo "WARNING: Cannot write to %1, skipping pmieconf enable of %2." >&2
echo "WARNING: Cannot write to %1/%2, skipping pmieconf enable of %3." >&2
fi
}
@ -560,10 +575,13 @@ Requires: pcp-pmda-memcache pcp-pmda-mysql pcp-pmda-named pcp-pmda-netfilter pcp
Requires: pcp-pmda-nginx pcp-pmda-nfsclient pcp-pmda-pdns pcp-pmda-postfix pcp-pmda-postgresql pcp-pmda-oracle
Requires: pcp-pmda-samba pcp-pmda-slurm pcp-pmda-zimbra
Requires: pcp-pmda-dm pcp-pmda-apache
Requires: pcp-pmda-bash pcp-pmda-cisco pcp-pmda-gfs2 pcp-pmda-mailq pcp-pmda-mounts
Requires: pcp-pmda-bash pcp-pmda-cisco pcp-pmda-mailq pcp-pmda-mounts
Requires: pcp-pmda-nvidia-gpu pcp-pmda-roomtemp pcp-pmda-sendmail pcp-pmda-shping pcp-pmda-smart pcp-pmda-farm
Requires: pcp-pmda-hacluster pcp-pmda-lustrecomm pcp-pmda-logger pcp-pmda-denki pcp-pmda-docker pcp-pmda-bind2
Requires: pcp-pmda-sockets pcp-pmda-podman
%if !%{disable_gfs2}
Requires: pcp-pmda-gfs2
%endif
%if !%{disable_statsd}
Requires: pcp-pmda-statsd
%endif
@ -603,6 +621,9 @@ Requires: pcp-pmda-json
Requires: pcp-pmda-resctrl
%endif
Requires: pcp-pmda-summary pcp-pmda-trace pcp-pmda-weblog
%if !%{disable_amdgpu}
Requires: pcp-pmda-amdgpu
%endif
Requires: pcp-system-tools
%if !%{disable_qt}
Requires: pcp-gui
@ -2063,6 +2084,7 @@ Reliability Metrics (FARM) Log making use of data from the smartmontools
package.
#end pcp-pmda-farm
%if !%{disable_gfs2}
#
# pcp-pmda-gfs2
#
@ -2075,6 +2097,7 @@ Requires: pcp = %{version}-%{release} pcp-libs = %{version}-%{release}
This package contains the PCP Performance Metrics Domain Agent (PMDA) for
collecting metrics about the Global Filesystem v2.
# end pcp-pmda-gfs2
%endif
#
# pcp-pmda-hacluster
@ -2281,6 +2304,23 @@ collecting metrics about web server logs.
# end pcp-pmda-weblog
# end C pmdas
%if !%{disable_amdgpu}
#
# pcp-pmda-amdgpu
#
%package pmda-amdgpu
License: GPL-2.0-or-later
Summary: Performance Co-Pilot (PCP) metrics from AMD GPU devices
URL: https://pcp.io
Requires: pcp = %{version}-%{release} pcp-libs = %{version}-%{release}
Requires: libdrm
BuildRequires: libdrm-devel
%description pmda-amdgpu
This package contains the PCP Performance Metrics Domain Agent (PMDA) for
extracting performance metrics from AMDGPU devices.
# end pcp-pmda-amdgpu
%endif
%package zeroconf
License: GPL-2.0-or-later
Summary: Performance Co-Pilot (PCP) Zeroconf Package
@ -2448,7 +2488,7 @@ sed -i "/PACKAGE_BUILD/s/=[0-9]*/=$_build/" VERSION.pcp
%if !%{disable_python2} && 0%{?default_python} != 3
export PYTHON=python%{?default_python}
%endif
%configure %{?_with_initd} %{?_with_doc} %{?_with_dstat} %{?_with_ib} %{?_with_statsd} %{?_with_perfevent} %{?_with_bcc} %{?_with_bpf} %{?_with_bpftrace} %{?_with_json} %{?_with_mongodb} %{?_with_snmp} %{?_with_nutcracker} %{?_with_python2}
%configure %{?_with_initd} %{?_with_doc} %{?_with_dstat} %{?_with_ib} %{?_with_gfs2} %{?_with_statsd} %{?_with_perfevent} %{?_with_bcc} %{?_with_bpf} %{?_with_bpftrace} %{?_with_json} %{?_with_mongodb} %{?_with_snmp} %{?_with_nutcracker} %{?_with_python2}
make %{?_smp_mflags} default_pcp
%install
@ -2589,7 +2629,7 @@ basic_manifest | grep -E -e 'pmiostat|pmrep|dstat|htop|pcp2csv' \
-e 'pcp-atop|pcp-dmcache|pcp-dstat|pcp-free' \
-e 'pcp-htop|pcp-ipcs|pcp-iostat|pcp-lvmcache|pcp-mpstat' \
-e 'pcp-numastat|pcp-pidstat|pcp-shping|pcp-ss' \
-e 'pcp-tapestat|pcp-uptime|pcp-verify' | \
-e 'pcp-tapestat|pcp-uptime|pcp-verify|pcp-xsos' | \
cull 'selinux|pmlogconf|pmieconf|pmrepconf' >pcp-system-tools-files
basic_manifest | keep 'geolocate' >pcp-geolocate-files
basic_manifest | keep 'sar2pcp' >pcp-import-sar2pcp-files
@ -2610,6 +2650,7 @@ basic_manifest | keep 'pcp2xml' >pcp-export-pcp2xml-files
basic_manifest | keep 'pcp2zabbix' >pcp-export-pcp2zabbix-files
basic_manifest | keep 'zabbix|zbxpcp' | cull pcp2zabbix >pcp-export-zabbix-agent-files
basic_manifest | keep '(etc/pcp|pmdas)/activemq(/|$)' >pcp-pmda-activemq-files
basic_manifest | keep '(etc/pcp|pmdas)/amdgpu(/|$)' >pcp-pmda-amdgpu-files
basic_manifest | keep '(etc/pcp|pmdas)/apache(/|$)' >pcp-pmda-apache-files
basic_manifest | keep '(etc/pcp|pmdas)/bash(/|$)' >pcp-pmda-bash-files
basic_manifest | keep '(etc/pcp|pmdas)/bcc(/|$)' >pcp-pmda-bcc-files
@ -2689,7 +2730,7 @@ basic_manifest | keep '(etc/pcp|pmdas)/zswap(/|$)' >pcp-pmda-zswap-files
rm -f packages.list
for pmda_package in \
activemq apache \
activemq amdgpu apache \
bash bcc bind2 bonding bpf bpftrace \
cifs cisco \
dbping denki docker dm ds389 ds389log \
@ -3095,8 +3136,10 @@ exit 0
%preun pmda-farm
%{pmda_remove "$1" "farm"}
%if !%{disable_gfs2}
%preun pmda-gfs2
%{pmda_remove "$1" "gfs2"}
%endif
%preun pmda-hacluster
%{pmda_remove "$1" "hacluster"}
@ -3142,6 +3185,11 @@ exit 0
%preun pmda-weblog
%{pmda_remove "$1" "weblog"}
%if !%{disable_amdgpu}
%preun pmda-amdgpu
%{pmda_remove "$1" "amdgpu"}
%endif
%preun
if [ "$1" -eq 0 ]
then
@ -3180,7 +3228,7 @@ for PMDA in dm nfsclient openmetrics ; do
fi
done
# auto-enable these usually optional pmie rules
%{run_pmieconf "$PCP_PMIECONFIG_DIR" dmthin}
%{run_pmieconf "$PCP_PMIECONFIG_DIR" config.default dmthin}
%if 0%{?rhel} <= 9
%if !%{disable_systemd}
systemctl restart pcp-reboot-init pmcd pmlogger pmie >/dev/null 2>&1
@ -3460,6 +3508,10 @@ fi
%files pmda-openmetrics -f pcp-pmda-openmetrics-files.rpm
%endif
%if !%{disable_amdgpu}
%files pmda-amdgpu -f pcp-pmda-amdgpu-files.rpm
%endif
%files pmda-apache -f pcp-pmda-apache-files.rpm
%files pmda-bash -f pcp-pmda-bash-files.rpm
@ -3470,7 +3522,9 @@ fi
%files pmda-farm -f pcp-pmda-farm-files.rpm
%if !%{disable_gfs2}
%files pmda-gfs2 -f pcp-pmda-gfs2-files.rpm
%endif
%files pmda-hacluster -f pcp-pmda-hacluster-files.rpm
@ -3544,6 +3598,15 @@ fi
%files zeroconf -f pcp-zeroconf-files.rpm
%changelog
* Wed Oct 2 2024 Nathan Scott <nathans@redhat.com> - 6.3.1-1
- New pcp-xsos utility for rapid system summaries (RHEL-30590)
- Fix Upgrade scripts to not rewrite pmcd.conf (RHEL-40631)
- Add new Hyper-V balloon usage metrics (RHEL-45715)
- Auto-load pmdaproc in local context (RHEL-50941)
- Fix a benign potential libpcp buffer overflow (RHEL-58914)
- Fix pcp-zeroconf pmie.config write permission (RHEL-59366)
- Rebase to latest stable version of PCP (RHEL-58953)
* Wed Aug 7 2024 Nathan Scott <nathans@redhat.com> - 6.2.2-6
- Update hacluster PMDA for pacemaker 2.1.6 crm_mon (RHEL-50693)

View File

@ -1,372 +0,0 @@
commit 6cefac3c6560487abad80498240545e6835e503f
Author: lmchilton <lauren.chilton26@gmail.com>
Date: Wed Jun 19 10:19:04 2024 +0200
Updated pcp2openmetrics tool to fix issues: RHEL-39159, RHEL-39132, RHEL-32983, RHEL-39293.
Added command line option to exclude # PCP 5 comment line
Updated output to follow openmetrics format to include _total metric name ending
Omitted blank line after each metric output to adhere to prometheus openmetrics parser
Added # EOF line to end of text dump to adhere to prometheus openmetrics
parser
Updated relevent qa for pcp2openmetric changes (1131 & 1827)
Updated pcp2openmetrics man page and fixed style errors(2)
diff --git a/qa/1131 b/qa/1131
index 413da6fe3..aa1e554fe 100755
--- a/qa/1131
+++ b/qa/1131
@@ -62,9 +62,10 @@ pcp2json -a $A -H -I -Z UTC+0 -x "" | _archive_filter
echo "---"
pcp2json -a $A -H -I -z -X -b GB -P 2 -F $tmp.outfile ""
echo "---"
-pcp2openmetrics -s1 -H -z hinv.ncpu | _filter_pcp2openmetrics
+pcp2openmetrics -s1 -z hinv.ncpu | _filter_pcp2openmetrics
+echo "---"
+pcp2openmetrics -s2 -x hinv.ncpu | _filter_pcp2openmetrics
echo "---"
-
cat $tmp.outfile | _archive_filter
which json_verify > /dev/null 2>&1
diff --git a/qa/1131.out b/qa/1131.out
index 098d698a6..90cb9eaa2 100644
--- a/qa/1131.out
+++ b/qa/1131.out
@@ -2267,13 +2267,18 @@ QA output created by 1131
}
---
---
-
-
+# EOF
# HELP hinv_ncpu number of CPUs in the system
# PCP5 hinv_ncpu 60.0.32 u32 PM_INDOM_NULL discrete
# TYPE hinv_ncpu gauge
hinv_ncpu{domainname="DOMAINID",groupid="GROUPID",hostname="HOST",machineid="MACHINEID",userid="USERID",agent="linux"} NCPU
---
+# EOF
+# HELP hinv_ncpu number of CPUs in the system
+# TYPE hinv_ncpu gauge
+hinv_ncpu{domainname="DOMAINID",groupid="GROUPID",hostname="HOST",machineid="MACHINEID",userid="USERID",agent="linux"} NCPU
+hinv_ncpu{domainname="DOMAINID",groupid="GROUPID",hostname="HOST",machineid="MACHINEID",userid="USERID",agent="linux"} NCPU
+---
{
"@pcp": {
"@hosts": [
diff --git a/qa/1827 b/qa/1827
index 47ee66d54..ebeaad460 100755
--- a/qa/1827
+++ b/qa/1827
@@ -63,12 +63,20 @@ $PCP_PYTHON_PROG $here/src/pythonserver.py $port >$tmp.python.out 2>&1 &
pid=$!
sleep 2 # let server start up
+echo "---"
echo "pcp2openmetrics invocation" | tee -a $here/$seq.full
pcp2openmetrics -s1 -u http://localhost:$port hinv.ncpu >$tmp.openmetrics.out 2>$tmp.openmetrics.err
echo "pcp2openmetrics HTTP POST (sorted):"
_filter_pcp2openmetrics_http <$tmp.python.out
+cat /dev/null > $tmp.python.out
+
+echo "---"
+echo "testing -x option" | tee -a $here/$seq.full
+pcp2openmetrics -s1 -x -u http://localhost:$port hinv.ncpu >$tmp.openmetrics2.out 2>$tmp.openmetrics2.err
+_filter_pcp2openmetrics_http <$tmp.python.out
+
# terminate pythonserver.py now
pmsignal $pid >/dev/null 2>&1
diff --git a/qa/1827.out b/qa/1827.out
index e786d8607..191ebcfa8 100644
--- a/qa/1827.out
+++ b/qa/1827.out
@@ -1,4 +1,5 @@
QA output created by 1827
+---
pcp2openmetrics invocation
pcp2openmetrics HTTP POST (sorted):
@@ -21,3 +22,22 @@ INFO:root:Starting httpd...
Path: /
User-Agent: python-requests VERSION
hinv_ncpu{domainname="DOMAINID",groupid="GROUPID",hostname="HOST",machineid="MACHINEID",userid="USERID",agent="linux"} N (cpus)
+---
+testing -x option
+
+
+
+
+
+# HELP hinv_ncpu number of CPUs in the system
+# TYPE hinv_ncpu gauge
+Accept: */*
+Body:
+Content-Length: SIZE
+Content-Type: application/openmetrics-text
+Headers:
+Host: localhost:PORT
+INFO:root:POST request,
+Path: /
+User-Agent: python-requests VERSION
+hinv_ncpu{domainname="DOMAINID",groupid="GROUPID",hostname="HOST",machineid="MACHINEID",userid="USERID",agent="linux"} N (cpus)
diff --git a/src/pcp2openmetrics/pcp2openmetrics.1 b/src/pcp2openmetrics/pcp2openmetrics.1
index 84e81e7af..41e4e2f9c 100644
--- a/src/pcp2openmetrics/pcp2openmetrics.1
+++ b/src/pcp2openmetrics/pcp2openmetrics.1
@@ -181,6 +181,13 @@ Maximum time (in seconds) when sending a HTTP POST.
Corresponding command line option is \fB\-o\fP.
Defaults to \fB2.5\fP seconds.
.RE
+.PP
+no-comment (boolean)
+.RS 4
+Omit # PCP5 comment line. Omits header for some metric
+data such as type, instance domain, and semantics.
+Corresponding command line option is \fB\-x\fP.
+Defaults to \fBno\fP.
.SH OPTIONS
The available command line options are:
.TP 5
@@ -343,9 +350,6 @@ on
.IR host ,
rather than from the default localhost.
.TP
-\fB\-H\fR, \fB\-\-no\-header\fR
-Do not print any headers.
-.TP
\fB\-i\fR \fIinstances\fR, \fB\-\-instances\fR=\fIinstances\fR
Retrieve and report only the specified metric
.IR instances .
@@ -605,8 +609,8 @@ and
\fB\-V\fR, \fB\-\-version\fR
Display version number and exit.
.TP
-\fB\-x\fR, \fB\-\-with\-extended\fR
-Write extended information.
+\fB\-x\fR, \fB\-no\-comment\fR
+Omit # PCP5 comment line
.TP
\fB\-X\fR, \fB\-\-with\-everything\fR
Write everything known about metrics, including PCP internal IDs.
diff --git a/src/pcp2openmetrics/pcp2openmetrics.py b/src/pcp2openmetrics/pcp2openmetrics.py
index 51b3326d7..d5a3346fe 100755
--- a/src/pcp2openmetrics/pcp2openmetrics.py
+++ b/src/pcp2openmetrics/pcp2openmetrics.py
@@ -50,24 +50,24 @@ class PCP2OPENMETRICS(object):
self.opts = self.options()
# Configuration directives
- self.keys = ('source', 'output', 'derived', 'header', 'globals',
- 'samples', 'interval', 'type', 'precision', 'daemonize',
+ self.keys = ('source', 'output', 'derived', 'globals',
+ 'samples', 'interval', 'precision', 'daemonize',
'timefmt', 'everything',
'count_scale', 'space_scale', 'time_scale', 'version',
'count_scale_force', 'space_scale_force', 'time_scale_force',
- 'type_prefer', 'precision_force', 'limit_filter', 'limit_filter_force',
+ 'precision_force', 'limit_filter', 'limit_filter_force',
'live_filter', 'rank', 'invert_filter', 'predicate', 'names_change',
'speclocal', 'instances', 'ignore_incompat', 'ignore_unknown',
'omit_flat', 'include_labels', 'url', 'http_user', 'http_pass',
- 'http_timeout')
+ 'http_timeout', 'no_comment')
# Ignored for pmrep(1) compatibility
self.keys_ignore = (
- 'timestamp', 'unitinfo', 'colxrow', 'separate_header', 'fixed_header',
+ 'timestamp','header', 'unitinfo', 'colxrow', 'separate_header', 'fixed_header',
'delay', 'width', 'delimiter', 'extcsv', 'width_force',
'extheader', 'repeat_header', 'interpol',
'dynamic_header', 'overall_rank', 'overall_rank_alt', 'sort_metric',
- 'instinfo', 'include_texts')
+ 'instinfo', 'include_texts', 'type', 'type_prefer')
# The order of preference for options (as present):
# 1 - command line options
@@ -79,13 +79,12 @@ class PCP2OPENMETRICS(object):
self.output = None # For pmrep conf file compat only
self.speclocal = None
self.derived = None
- self.header = 1
self.globals = 1
self.samples = None # forever
self.interval = pmapi.timeval(10) # 10 sec
self.opts.pmSetOptionInterval(str(10)) # 10 sec
self.delay = 0
- self.type = 0
+ self.type = 1
self.type_prefer = self.type
self.ignore_incompat = 0
self.ignore_unknown = 0
@@ -118,6 +117,8 @@ class PCP2OPENMETRICS(object):
self.http_user = None
self.http_pass = None
self.http_timeout = TIMEOUT
+ self.no_comment = False
+ self.header_flag = True
# Internal
self.runtime = -1
@@ -146,7 +147,7 @@ class PCP2OPENMETRICS(object):
opts = pmapi.pmOptions()
opts.pmSetOptionCallback(self.option)
opts.pmSetOverrideCallback(self.option_override)
- opts.pmSetShortOptions("a:h:LK:c:Ce:D:V?HGA:S:T:O:s:t:rRIi:jJ:4:58:9:nN:vmP:0:q:b:y:Q:B:Y:F:f:Z:zXo:p:U:u:")
+ opts.pmSetShortOptions("a:h:LK:c:Ce:D:V?GA:S:T:O:s:t:Ii:jJ:4:58:9:nN:vmP:0:q:b:y:Q:B:Y:F:f:Z:zXo:p:U:u:x")
opts.pmSetShortUsage("[option...] metricspec [...]")
opts.pmSetLongOptionHeader("General options")
@@ -166,7 +167,6 @@ class PCP2OPENMETRICS(object):
opts.pmSetLongOptionHelp() # -?/--help
opts.pmSetLongOptionHeader("Reporting options")
- opts.pmSetLongOption("no-header", 0, "H", "", "omit headers")
opts.pmSetLongOption("no-globals", 0, "G", "", "omit global metrics")
opts.pmSetLongOptionAlign() # -A/--align
opts.pmSetLongOptionStart() # -S/--start
@@ -176,8 +176,6 @@ class PCP2OPENMETRICS(object):
opts.pmSetLongOptionInterval() # -t/--interval
opts.pmSetLongOptionTimeZone() # -Z/--timezone
opts.pmSetLongOptionHostZone() # -z/--hostzone
- opts.pmSetLongOption("raw", 0, "r", "", "output raw counter values (no rate conversion)")
- opts.pmSetLongOption("raw-prefer", 0, "R", "", "prefer output raw counter values (no rate conversion)")
opts.pmSetLongOption("ignore-incompat", 0, "I", "", "ignore incompatible instances (default: abort)")
opts.pmSetLongOption("ignore-unknown", 0, "5", "", "ignore unknown metrics (default: abort)")
opts.pmSetLongOption("names-change", 1, "4", "ACTION", "update/ignore/abort on PMNS change (default: ignore)")
@@ -201,6 +199,7 @@ class PCP2OPENMETRICS(object):
opts.pmSetLongOption("time-scale-force", 1, "Y", "SCALE", "forced time unit")
opts.pmSetLongOption("with-everything", 0, "X", "", "write everything, incl. internal IDs")
+ opts.pmSetLongOption("no-comment", 0, "x", "", "omit comment lines")
opts.pmSetLongOption("url", 1, "u", "URL", "URL of endpoint to receive HTTP POST")
opts.pmSetLongOption("http-timeout", 1, "o", "SECONDS", "timeout when sending HTTP POST")
@@ -238,14 +237,8 @@ class PCP2OPENMETRICS(object):
self.derived = ";" + optarg
else:
self.derived = self.derived + ";" + optarg
- elif opt == 'H':
- self.header = 0
elif opt == 'G':
self.globals = 0
- elif opt == 'r':
- self.type = 1
- elif opt == 'R':
- self.type_prefer = 1
elif opt == 'I':
self.ignore_incompat = 1
elif opt == '5':
@@ -298,6 +291,8 @@ class PCP2OPENMETRICS(object):
self.time_scale_force = optarg
elif opt == 'X':
self.everything = 1
+ elif opt == 'x':
+ self.no_comment = True
elif opt == 'u':
self.url = optarg
elif opt == 'o':
@@ -319,6 +314,7 @@ class PCP2OPENMETRICS(object):
if pmapi.c_api.pmSetContextOptions(self.context.ctx, self.opts.mode, self.opts.delta):
raise pmapi.pmUsageErr()
+ self.context.pmNewZone("UTC")
def validate_config(self):
""" Validate configuration options """
@@ -346,11 +342,6 @@ class PCP2OPENMETRICS(object):
# Common preparations
self.context.prepare_execute(self.opts, False, self.interpol, self.interval)
- # Headers
- if self.header == 1:
- self.header = 0
- self.write_header()
-
# Just checking
if self.check == 1:
return
@@ -394,29 +385,12 @@ class PCP2OPENMETRICS(object):
self.write_openmetrics(tstamp)
- def write_header(self):
- """ Write info header """
- output = self.outfile if self.outfile else "stdout"
- if self.context.type == PM_CONTEXT_ARCHIVE:
- sys.stdout.write('"# Writing %d archived metrics to %s..." }\n{ "//": "(Ctrl-C to stop)" }\n' % (len(self.metrics), output))
- return
-
- sys.stdout.write('# "Waiting for %d metrics to be written to %s' % (len(self.metrics), output))
- if self.runtime != -1:
- sys.stdout.write('\n # "%s samples(s) with %.1f sec interval ~ %d sec runtime." }\n' % (self.samples, float(self.interval), self.runtime))
- elif self.samples:
- duration = (self.samples - 1) * float(self.interval)
- sys.stdout.write('\n # "%s samples(s) with %.1f sec interval ~ %d sec runtime." }\n' % (self.samples, float(self.interval), duration))
- else:
- sys.stdout.write('...\n# "(Ctrl-C to stop)" }\n')
-
def write_openmetrics(self, timestamp):
""" Write results in openmetrics format """
if timestamp is None:
# Silent goodbye, close in finalize()
return
- self.context.pmNewZone("UTC")
ts = self.context.datetime_to_secs(self.pmfg_ts(), PM_TIME_SEC)
if self.prev_ts is None:
@@ -500,11 +474,12 @@ class PCP2OPENMETRICS(object):
help_dict = {}
help_dict[metric] = context.pmLookupText(pmid[0])
- if self.context.type == PM_CONTEXT_ARCHIVE:
- body += "\nMetric %s details (last fetch: %d)\n:" % (metric, ts)
- body += '# PCP5 %s %s %s %s %s %s\n' % (openmetrics_name(metric), pmIDStr, get_type_string(desc), pmIndomStr, semantics, units)
- body += '# HELP %s %s\n' % (openmetrics_name(metric), help_dict[metric])
- body += '# TYPE %s %s\n' % (openmetrics_name(metric), openmetrics_type(desc))
+ if self.header_flag is True:
+ if self.no_comment is False:
+ body += '# PCP5 %s %s %s %s %s %s\n' % (openmetrics_name(metric), pmIDStr, get_type_string(desc), pmIndomStr, semantics, units)
+ body += '# TYPE %s %s\n' % (openmetrics_name(metric), openmetrics_type(desc))
+ body += '# HELP %s %s\n' % (openmetrics_name(metric), help_dict[metric])
+ self.header_flag = False
for inst, name, value in results[metric]:
if isinstance(value, float):
@@ -515,10 +490,16 @@ class PCP2OPENMETRICS(object):
value = format(value, fmt)
else:
str(value)
+
+ if openmetrics_type(desc) == "counter":
+ openmetrics_name_end = openmetrics_name(metric) + "_total"
+ else:
+ openmetrics_name_end = openmetrics_name(metric)
+
if self.context.type == PM_CONTEXT_ARCHIVE:
- body += '%s%s %s %s\n' % (openmetrics_name(metric), openmetrics_labels(inst, name, desc, labels), value, ts)
+ body += '%s%s %s %s\n' % (openmetrics_name_end, openmetrics_labels(inst, name, desc, labels), value, ts)
else:
- body += '%s%s %s\n' % (openmetrics_name(metric), openmetrics_labels(inst, name, desc, labels), value)
+ body += '%s%s %s\n' % (openmetrics_name_end, openmetrics_labels(inst, name, desc, labels), value)
if self.url:
auth = None
@@ -537,13 +518,13 @@ class PCP2OPENMETRICS(object):
elif self.outfile:
self.writer.write(body)
else:
- print(body)
+ sys.stdout.write(body)
def finalize(self):
""" Finalize and clean up """
if self.writer:
try:
- self.writer.write("\n")
+ self.writer.write("# EOF\n")
self.writer.flush()
except IOError as write_error:
if write_error.errno != errno.EPIPE:

View File

@ -1,12 +0,0 @@
diff -Naurp pcp-6.2.2.orig/tmpfiles.init.setup.in pcp-6.2.2/tmpfiles.init.setup.in
--- pcp-6.2.2.orig/tmpfiles.init.setup.in 2024-05-07 10:37:04.000000000 +1000
+++ pcp-6.2.2/tmpfiles.init.setup.in 2024-05-16 09:18:49.200282601 +1000
@@ -3,7 +3,7 @@
# Type Path Mode User Group Age Argument
D PCP_RUN_DIR 0775 PCP_USER PCP_GROUP - -
d PCP_LOG_DIR 0775 PCP_USER PCP_GROUP - -
-d PCP_LOG_DIR/pmcd 0775 root root - -
+d PCP_LOG_DIR/pmcd 0755 root root - -
d PCP_LOG_DIR/pmfind 0775 PCP_USER PCP_GROUP - -
d PCP_LOG_DIR/pmie 0775 PCP_USER PCP_GROUP - -
d PCP_LOG_DIR/pmlogger 0775 PCP_USER PCP_GROUP - -

View File

@ -1,721 +0,0 @@
commit 23c6a7f872446b6c92a1e899e2763827e9728d5d
Author: Paul Evans <pevans@redhat.com>
Date: Mon Aug 5 14:27:51 2024 +0100
pmdahacluster: handle pacemaker 2.1.6 crm_mon output changes
Update the handling of crm_mon output for pacemaker 2.1.6 to handle the
additional fields included in this release.
Additional test root hacluster-root-003.tgz added to exercise these changes
while the original hacluster root tests exercises older crm_mon output
formats.
This patch satisfies RHEL-50693
diff -Naurp pcp-6.2.2.orig/qa/1897.out pcp-6.2.2/qa/1897.out
--- pcp-6.2.2.orig/qa/1897.out 2023-11-16 17:51:39.000000000 +1100
+++ pcp-6.2.2/qa/1897.out 2024-08-07 15:49:16.196678155 +1000
@@ -1314,3 +1314,629 @@ ERROR SUMMARY: 0 errors from 0 contexts
== done
+== Checking metric descriptors and values - hacluster-root-003.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.
+ inst [0 or "rhel9-node1:VirtualIP"] value 0
+
+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.
+ inst [0 or "rhel9-node1:VirtualIP"] value 1000000
+
+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 1
+ inst [1 or "rhel9-node2"] value 0
+
+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.
+ inst [0 or "VirtualIP:rhel9-node1"] value "ocf:heartbeat:IPaddr2"
+
+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.
+ inst [0 or "VirtualIP:rhel9-node1"] value 1
+
+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.
+ inst [0 or "VirtualIP:rhel9-node1"] value ""
+
+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.
+ inst [0 or "VirtualIP:rhel9-node1"] value ""
+
+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.
+ inst [0 or "VirtualIP:rhel9-node1"] value 1
+
+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.
+ inst [0 or "VirtualIP:rhel9-node1"] value "Started"
+
+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.
+ inst [0 or "VirtualIP:rhel9-node1"] value 1
+
+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.
+ inst [0 or "VirtualIP:rhel9-node1"] value 0
+
+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.
+ inst [0 or "VirtualIP:rhel9-node1"] value 0
+
+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.
+ inst [0 or "VirtualIP:rhel9-node1"] value 0
+
+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.
+ inst [0 or "VirtualIP:rhel9-node1"] value 0
+
+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-003.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
+indirectly lost: 0 bytes in 0 blocks
+ERROR SUMMARY: 0 errors from 0 contexts ...
+
+== done
+
diff -Naurp pcp-6.2.2.orig/qa/hacluster/hacluster-root-003.tgz pcp-6.2.2/qa/hacluster/hacluster-root-003.tgz
--- pcp-6.2.2.orig/qa/hacluster/hacluster-root-003.tgz 1970-01-01 10:00:00.000000000 +1000
+++ pcp-6.2.2/qa/hacluster/hacluster-root-003.tgz 2024-08-07 15:51:27.795737748 +1000
@@ -0,0 +1,13 @@
+í[[sÛ6Ϋõ+°ôC“YSJ²bÕꌻ[oKco;}Ò@$(!& ¥h¦?~Ïe»é&î¦!&c pîçÃ…'Ýn¿óä·.´Ñpˆ¿{£a·þ»lOzƒÁ`Øí½Æõº£~÷ ~jÁ°JSIÈ“œ-i¦î÷ÐûÏ´uÁÿ &`&?Q$ü1ÿð£ôÁÿÁ¨?hüÿmÛÿ!ŸÑ(åY[->*<2A>{ý?ôzUþ»èÿa7=!Ý<><>í ÷ÿá?:…<E280A6>Ï:,[UV+¤šœž^¼þ®u
+AB™NcFu!ÙT1=ñúíÞq;ðÈ’&<¢šù+®/§!Ké “~¿}âzGÉŠtZä8RM¼®GLŒMÝ{x&~B•öWkͲ‰w½(È¿‹Œéuǽ޸? A7è{ÄÒñ…äså‚%'~&"Ö«Þ… gˆYFsõ¢PLÂ!´GtÉüß
+!tâÁÜ(ôG/ð¾irŠ,æóBRÍE†=؆°ý¶»læLs)r&õ D<EFBFBD> ê4NJKšû"G2Ê+çÁÌl™S.ïë WT‡HÌÁˆ4e<P@oLż·P}—L*ø»$]ïqtƒv¯=ôOÚ`ãiàÓ~<ŒNñÉàÃx9#ù<%¸Y!ÆRÉ÷®·N†PH¡ÖYøçX"]F¶Ï˜Ôåè´È î}ÑY¢˭î?ï£L¸õsðp]²¸Ýïxðy&d<>Éig_|ºhîì†ó)¦‘ªæâ“3Ë2®g[çöÀ`ÏÀ xÚ©?•L‰B†L•oATžgºê*œF,¦E¢7R¥LÓ)ÕZòY¾3|gO"¿$é—sîȶ<C388>ÑJóð†gL©Ò¼{_9 ×õîìÈRê¹+7XzLNaÕÑ…ªÙ}Š=÷™‘d†!€d„/8†Š,ų̀=+æ0FÂRœQ3ŵIëw_¥,<2C>ö>g¡fQÕSifçˆîZ:¨Û”ƒÇh²ÝAV7¿>vÛå¿í–¢²´þáVŸ3»[qêÙÓÙÃ~ãš}To™ÞÖ:§»Q‰” ¿ÀÖªû·?Qþ/×ûÇõr\ï¯v\ïrÜi§Ì¾SÜñ~ÓÂ<C393>Î_½û‹ÚÎþß­µ~ϵÉÇ9<tþ ŽƒÍþ¿ ûÿãáq¯Ùÿ?F{`ÿÿ£iBÌyNzGĤg.¤&7Ó­/_ý€oº¤ˆòÖ<01>"y0!½Ø8?o÷ø=xÞ:°ù6n )<1E>7ðÒ$Èd!”Þ÷>À꙼û’õµ;òßn/?<<3C>ÿ=“Mþñü?ê†Mþ?F{ ÿ2q;˜XÈÔì^[þ­Ö:‡…µ²Ð¶ÏïA0î=7ç÷ G<bf•17]
+Ílܵ^áIab`újêÐÑz˳ùN_ûÄðØèW¦Z­Ÿ+úèctºp{,bYÖ÷|¾€ãbµÿCߵЀ<C390>Õ 3Î*Y—¿GH뻄Îw”2:9qÉ/”ëï„<KÒj½4;µàù‰½2Èi £ª
+ÿø)bK
+vh­º4·ÿ|õÔv­ä©AågIÁƒ“Ÿ?»¶<C2BB>ÿj}Ýîñ`pþ°6”ø?:þ÷ƒ ÁÿÇh‡‡äz<C3A4>V*8leó<ŸÛ«1ñ¼Öaë<61>\}{>=¿øùòÅQ€{<æ€-zÁˆÅø[<5B>B1(È.h6GX†X")SŠÎ| Í"˜âå˜<C3A5>mr;jkœ
+É€&͈ÈÉ©^šÞס8]±œJÂL”i#Ò„lUJ¬™ÊÄkdóY0öbÎhPÝXÈj6·÷3ȼ9{qñò쇷$²ap¥ŸÒdE×ê(LÍžmq´o¬å¬†™=#k(°N\1­Q{½àÆŠž!瑇5@dÉí–$beŒ ,®ÉŠ*ؘkXJÁ ¢PÉšÄ NÕ†®UÏ¿"ö*èðÌt¥`â\R*yu}ööúåë󋉓{ǘ¤cMÃähåm«F,¡kBc€+f"#x³i´öR5_Á2ç<32>?aW)ö
+ }
+“gŒÀ>CF®QÉ5鉃&sQD2CK SXˆ!bðbGQ‰öF#"3Äio Dhx“‰U¢9KY\PÅ*Ià†a
+‡µ<E280A1>+U0Ÿ8ÈK]@WJÃÞ š`´ÓB˜D ´pW¿d†:;0<>6¢e…Î\æ’ä¤3n-B®DÊ4OQˆ LïFü°‰gÜp´±'ÐÀ,ÉXtäR¦9ĹSÔŠ+0té¯@`1Y µ¢±q%ÐAš%oä:†¾rŸ#nÐ E¡É? !©BÕúò0½™©§)}NPc¯oÁ+j^Ûä@³à6
+íAð-…DPăô¤å ï”g­þÂÉo©@¬<>¶gÚ|Ø1ÆŽh®7©Wä~) A—üb ­fS°cöXƒ—ðªMž^ÛyWH抅6וiôl6ÓÊ@¶7ñÑÀ‹#8<17>IG<49>ax@©(1©mê͘,Sôüâdz_m¢N ïZ÷Av0¹S~²)êZ;°¶øk£ÒÌÉŠ$9ô!«<>ñˆE@TiQ)Ó/g×/¾?ý/DáÉ6Ó<36>|û€ch„ú à C¿ ü#ㆊýªL_`ãê<C3A3>ÓÌÜÆÏ]ÂÛ¯1üöqÍÀ«úï1u-)#3 °«4à#¸Ç`Šu0Ðø% ×_;d|'$×0*.W6 “ú˜ä(BD¦Ì´¢‘“[Ü>x.Qz<>tÎvŠ%±o ÇŠvé  ÑÑrzªžQ g”×Ds\ÑGEŽ”ùÕ«Ë#ÃI.DD(2Cö0ÿ·»lŽ˜
+24bÊ“B:æÛÉW™»Ì óùÒ"†Èüˆ«_9"ª)Ñ°ÈVXfJ}¶ÂáúòåÅëÿ\O†÷‡©ª/Ž,šÛ]ÆYh¾y9,bïYXàé œˆH$0AQ^ã s“L¢Ï"t5 1Ñch;Œï<>1&R Úžt`U ·1ˆkui$ŸYk(Ò”únsâÂ3¥Í68š(5ªþn~~º5ì÷PÂY;*ÒüwÇmï0Úœ´3XÑp1šó¥3<C2A5>ÍÖŠ8¡jÕC^0ƒ`4ŽM8³&ü©ÆG¤â{T®¦pœMì´<C3AC>CpÖ|nV…%§åŽ¨Dh³XŸÁ6r¹ÀÆŒ¬X˜]Hù…ˤ3­¥3Æë†|À@J˜<ÕvmÂ] ™³ŒIX&Bd `ù¬ 5aÓ³×—¯_Mê<4D>ô@̹8"óMV÷™ÕâymËâ8½~s}5iÕ¶šÇ£íöù/’³È ÎG-z°þ Άîü×Xÿ ûÍùï1Ú÷Í<7F>Î߼ݺÿù¸¥ŽÇä¿©ÿ<C3B5>Ôšüÿ²ÛÎ÷?™NSñˬÿí<C3BF>vë¿£~óýÿQÚƒõ¿6"ˆ« µ%¡#hJB¶TVpkWlö oˆ†mx­vssáù¦gâÁ¾?ƒ wURbÙOâS™
+^[1µŸ·ß<C2B7>Gñóçý^PÕím]Ùz,<¥OË2_K.åïY4­ˆnÕežb²«U6ǽ‰÷´?+æ„ I/NÆÃ>~Êxd_ òs¾<>NoŒÆÝcG§^\Ö.Û§û8˜«ÎiuÊz†„6—UUÔ¾aXóÌ•¹¨4EسD„7öïÊ%®x´<(픶–¶#j<>¦ N\aYH[šz·PµªP…Ó6í2,óñR|CKܧIRhªú+þ<†§ðêÂKrsyc®Y ª|s÷hF8uN;µ0­WºÚòÕ»#ÈVê•aåZ4[×d2ÏS°/åIÕ]S¯êë(­z.2sÝ_=/M°Œ~.Ë<²[qÒ=Õ¢ÐXm&•Ÿ¢!fK¹‚*6!àòÍèd³Óvî³Cà•%©Ÿ«Ü€=†èî3D­Ly“?;ùdLò³ýpùfC{Jç&yE<18>A ©g ûøò E<E28093>¥H€™¹Fƺp¼$YV2´¨%U•<55>÷˜°ŒJhúÚ wï7uwÑU¿Eg†)bঞò¡li¸¨V•Ý¥¬·Ìfkdï\×÷g\%CeO7m×ÞÖV+p÷åÎ× ˜º Êj7õBQ¬€7ã*º!ÍÄBPu3ñr)f*¡‰ N5{<7B>î¼ñˆùï)Î@ú}hŽW—¾…üÁ0Uù­`s=]èè|ž"—"¹O¸û…2vKš8dFfJÎ`t¯œ Û -“½›<Þ¼=-7·_t¹oÓšÖ´¦5­iMkZÓšÖ´¦5­iMkZÓšÖ´/¨ýgh,P
\ No newline at end of file
diff -Naurp pcp-6.2.2.orig/src/pmdas/hacluster/help pcp-6.2.2/src/pmdas/hacluster/help
--- pcp-6.2.2.orig/src/pmdas/hacluster/help 2023-11-16 17:51:39.000000000 +1100
+++ pcp-6.2.2/src/pmdas/hacluster/help 2024-08-07 15:49:33.914903633 +1000
@@ -281,8 +281,8 @@ The volume number of the resource for ea
The current reported disk state of for the resource:volume.
@ ha_cluster.drbd.resources.all DRBD resource information
-Value is 1 if a drbd resource exists. The details of the corresponding drbd resource
-is given as label metadata values for this metric.
+Value is 1 if a DRBD resource exists. Details of the corresponding DRBD
+resource are given as label metadata values for this metric.
@ ha_cluster.drbd.connections.resource Resource that the connection is for
The given resource that the DRBD connection is for each resource:volume.
@@ -300,5 +300,5 @@ The reported volume for the connection.
The reported peer disk state for the connection.
@ ha_cluster.drbd.connections.all DRBD Peer disk information
-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.
+Value is 1 if a DRBD peer connection exists. Details of the corresponding
+DRBD peer connection are given as label metadata values for this metric.
diff -Naurp pcp-6.2.2.orig/src/pmdas/hacluster/pacemaker.c pcp-6.2.2/src/pmdas/hacluster/pacemaker.c
--- pcp-6.2.2.orig/src/pmdas/hacluster/pacemaker.c 2023-11-16 17:51:39.000000000 +1100
+++ pcp-6.2.2/src/pmdas/hacluster/pacemaker.c 2024-08-07 15:51:14.150698727 +1000
@@ -707,6 +707,7 @@ hacluster_refresh_pacemaker_resources(co
/* Collect our metrics */
if (strstr(buffer, "resource id=") && strstr(buffer, resource_id)) {
+ /* Pacemaker v2.14 and prior crm_mon format */
if (strstr(buffer, "target_role")) {
sscanf(buffer, "%*s %*s resource_agent=\"%[^\"]\" role=\"%[^\"]\" %*s active=\"%7[^\"]\" orphaned=\"%7[^\"]\" blocked=\"%7[^\"]\" managed=\"%7[^\"]\" failed=\"%7[^\"]\" failure_ignored=\"%7[^\"]\"",
resources->agent,
@@ -718,6 +719,21 @@ hacluster_refresh_pacemaker_resources(co
failed,
failure_ignored
);
+
+ /* Pacemaker v2.16+ crm_mon format */
+ } else if (strstr(buffer, "maintenance")) {
+ sscanf(buffer, "%*s %*s resource_agent=\"%[^\"]\" role=\"%[^\"]\" active=\"%7[^\"]\" orphaned=\"%7[^\"]\" blocked=\"%7[^\"]\" %*s managed=\"%7[^\"]\" failed=\"%7[^\"]\" failure_ignored=\"%7[^\"]\"",
+ resources->agent,
+ resources->role,
+ active,
+ orphaned,
+ blocked,
+ managed,
+ failed,
+ failure_ignored
+ );
+
+ /* Pacemaker v2.15 crm_mon format */
} else {
sscanf(buffer, "%*s %*s resource_agent=\"%[^\"]\" role=\"%[^\"]\" active=\"%7[^\"]\" orphaned=\"%7[^\"]\" blocked=\"%7[^\"]\" managed=\"%7[^\"]\" failed=\"%7[^\"]\" failure_ignored=\"%7[^\"]\"",
resources->agent,

View File

@ -1,186 +0,0 @@
diff -Naurp pcp-6.2.2.orig/configure pcp-6.2.2/configure
--- pcp-6.2.2.orig/configure 2024-05-08 09:18:25.000000000 +1000
+++ pcp-6.2.2/configure 2024-06-10 13:07:44.487533040 +1000
@@ -4885,12 +4885,12 @@ then :
PCFLAGS="$PCFLAGS -Wno-array-bounds"
fi
fi
-{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking sizeof time_t" >&5
-printf %s "checking sizeof time_t... " >&6; }
+{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking sizeof off_t" >&5
+printf %s "checking sizeof off_t... " >&6; }
cat <<End-of-File >conftest.c
#include <stdio.h>
-#include <sys/time.h>
-int main() { printf("%d", (int)sizeof(time_t)); return 0; }
+#include <sys/types.h>
+int main() { printf("%d", (int)sizeof(off_t)); return 0; }
End-of-File
(eval $ac_compile) 2>&5
(eval $ac_link) 2>&5
@@ -4900,25 +4900,7 @@ rm -rf conftest conftest.*
{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ans" >&5
printf "%s\n" "$ans" >&6; }
if test "$ans" = 4; then
- PCFLAGS="$PCFLAGS -D_FILE_OFFSET_BITS=64 -D_TIME_BITS=64"
-else
- { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking sizeof off_t" >&5
-printf %s "checking sizeof off_t... " >&6; }
- cat <<End-of-File >conftest.c
-#include <stdio.h>
-#include <sys/types.h>
-int main() { printf("%d", (int)sizeof(off_t)); return 0; }
-End-of-File
- (eval $ac_compile) 2>&5
- (eval $ac_link) 2>&5
- ans=`./conftest`
- echo "./conftest -> \"$ans\"" >&5
- rm -rf conftest conftest.*
- { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ans" >&5
-printf "%s\n" "$ans" >&6; }
- if test "$ans" = 4; then
- PCFLAGS="$PCFLAGS -D_FILE_OFFSET_BITS=64"
- fi
+ PCFLAGS="$PCFLAGS -D_FILE_OFFSET_BITS=64"
fi
diff -Naurp pcp-6.2.2.orig/configure.ac pcp-6.2.2/configure.ac
--- pcp-6.2.2.orig/configure.ac 2024-05-08 09:18:25.000000000 +1000
+++ pcp-6.2.2/configure.ac 2024-06-10 13:07:42.552530243 +1000
@@ -438,13 +438,12 @@ if ! echo "$CFLAGS" | grep -- -Wno-array
then
AS_IF([test "x$cc_is_gcc" = xyes ],[PCFLAGS="$PCFLAGS -Wno-array-bounds"])
fi
-dnl we also need to worry about time_t ... we need it to be 64-bits for Y2038;
-dnl _FILE_OFFSET_BITS and _TIME_BITS must be set together for the 32-bit case.
-AC_MSG_CHECKING([sizeof time_t])
+dnl and we need to worry about off_t ... we need it to be 64-bits for V3 archives
+AC_MSG_CHECKING([sizeof off_t])
cat <<End-of-File >conftest.c
#include <stdio.h>
-#include <sys/time.h>
-int main() { printf("%d", (int)sizeof(time_t)); return 0; }
+#include <sys/types.h>
+int main() { printf("%d", (int)sizeof(off_t)); return 0; }
End-of-File
(eval $ac_compile) 2>&5
(eval $ac_link) 2>&5
@@ -453,25 +452,7 @@ echo "./conftest -> \"$ans\"" >&5
rm -rf conftest conftest.*
AC_MSG_RESULT($ans)
if test "$ans" = 4; then
- PCFLAGS="$PCFLAGS -D_FILE_OFFSET_BITS=64 -D_TIME_BITS=64"
-else
- dnl we may need to check off_t ... we need it to be 64-bits for V3 archives
- dnl this check is optional only because it may be set already (just prior).
- AC_MSG_CHECKING([sizeof off_t])
- cat <<End-of-File >conftest.c
-#include <stdio.h>
-#include <sys/types.h>
-int main() { printf("%d", (int)sizeof(off_t)); return 0; }
-End-of-File
- (eval $ac_compile) 2>&5
- (eval $ac_link) 2>&5
- ans=`./conftest`
- echo "./conftest -> \"$ans\"" >&5
- rm -rf conftest conftest.*
- AC_MSG_RESULT($ans)
- if test "$ans" = 4; then
- PCFLAGS="$PCFLAGS -D_FILE_OFFSET_BITS=64"
- fi
+ PCFLAGS="$PCFLAGS -D_FILE_OFFSET_BITS=64"
fi
AC_SUBST(PCFLAGS)
AC_SUBST(PLDFLAGS)
diff -Naurp pcp-6.2.2.orig/src/perl/LogImport/Makefile.PL pcp-6.2.2/src/perl/LogImport/Makefile.PL
--- pcp-6.2.2.orig/src/perl/LogImport/Makefile.PL 2024-05-08 09:18:25.000000000 +1000
+++ pcp-6.2.2/src/perl/LogImport/Makefile.PL 2024-06-10 13:07:42.553530244 +1000
@@ -37,7 +37,7 @@ WriteMakefile(
OPTIMIZE => '-g',
XSPROTOARG => '-noprototypes',
OBJECT => 'LogImport.o',
- DEFINE => '-DPERLIO_NOT_STDIO=0 -DPCP_VERSION -D_TIME_BITS=64 -D_FILE_OFFSET_BITS=64',
+ DEFINE => '-DPERLIO_NOT_STDIO=0 -DPCP_VERSION',
LDFROM => $ldfrom,
LDDLFLAGS => $lddlflags,
CCCDLFLAGS => $cccdlflags,
diff -Naurp pcp-6.2.2.orig/src/perl/MMV/Makefile.PL pcp-6.2.2/src/perl/MMV/Makefile.PL
--- pcp-6.2.2.orig/src/perl/MMV/Makefile.PL 2024-05-08 09:18:25.000000000 +1000
+++ pcp-6.2.2/src/perl/MMV/Makefile.PL 2024-06-10 13:07:42.553530244 +1000
@@ -37,7 +37,7 @@ WriteMakefile(
OPTIMIZE => '-g',
XSPROTOARG => '-noprototypes',
OBJECT => 'MMV.o',
- DEFINE => '-DPERLIO_NOT_STDIO=0 -DPCP_VERSION -D_TIME_BITS=64 -D_FILE_OFFSET_BITS=64',
+ DEFINE => '-DPERLIO_NOT_STDIO=0 -DPCP_VERSION',
LDFROM => $ldfrom,
LDDLFLAGS => $lddlflags,
CCCDLFLAGS => $cccdlflags,
diff -Naurp pcp-6.2.2.orig/src/perl/PMDA/Makefile.PL pcp-6.2.2/src/perl/PMDA/Makefile.PL
--- pcp-6.2.2.orig/src/perl/PMDA/Makefile.PL 2024-05-08 09:18:25.000000000 +1000
+++ pcp-6.2.2/src/perl/PMDA/Makefile.PL 2024-06-10 13:07:42.553530244 +1000
@@ -54,7 +54,7 @@ WriteMakefile(
OPTIMIZE => '-g',
XSPROTOARG => '-noprototypes',
OBJECT => 'local.o PMDA.o',
- DEFINE => '-DPERLIO_NOT_STDIO=0 -DPCP_VERSION -D_TIME_BITS=64 -D_FILE_OFFSET_BITS=64',
+ DEFINE => '-DPERLIO_NOT_STDIO=0 -DPCP_VERSION',
LDFROM => $ldfrom,
LDDLFLAGS => $lddlflags,
CCCDLFLAGS => $cccdlflags,
diff -Naurp pcp-6.2.2.orig/src/python/pmapi.c pcp-6.2.2/src/python/pmapi.c
--- pcp-6.2.2.orig/src/python/pmapi.c 2024-05-08 09:18:25.000000000 +1000
+++ pcp-6.2.2/src/python/pmapi.c 2024-06-10 13:07:42.554530246 +1000
@@ -24,8 +24,6 @@
** **
\**************************************************************************/
#define PY_SSIZE_T_CLEAN
-#define _FILE_OFFSET_BITS 64
-#define _TIME_BITS 64
#include <Python.h>
#define PMAPI_VERSION 3
#include <pcp/pmapi.h>
diff -Naurp pcp-6.2.2.orig/src/python/pmda.c pcp-6.2.2/src/python/pmda.c
--- pcp-6.2.2.orig/src/python/pmda.c 2024-05-08 09:18:25.000000000 +1000
+++ pcp-6.2.2/src/python/pmda.c 2024-06-10 13:07:42.554530246 +1000
@@ -1,5 +1,5 @@
/*
- * Copyright (C) 2013-2015,2017-2021,2024 Red Hat.
+ * Copyright (C) 2013-2015,2017-2021 Red Hat.
*
* This file is part of the "pcp" module, the python interfaces for the
* Performance Co-Pilot toolkit.
@@ -21,8 +21,6 @@
* python PMDAs via the pmda.py module, using ctypes.
*/
#define PY_SSIZE_T_CLEAN
-#define _FILE_OFFSET_BITS 64
-#define _TIME_BITS 64
#include <Python.h>
#include <pcp/pmapi.h>
#include <pcp/pmda.h>
diff -Naurp pcp-6.2.2.orig/src/python/pmgui.c pcp-6.2.2/src/python/pmgui.c
--- pcp-6.2.2.orig/src/python/pmgui.c 2024-05-08 09:18:25.000000000 +1000
+++ pcp-6.2.2/src/python/pmgui.c 2024-06-10 13:07:42.554530246 +1000
@@ -23,8 +23,6 @@
** **
\**************************************************************************/
#define PY_SSIZE_T_CLEAN
-#define _FILE_OFFSET_BITS 64
-#define _TIME_BITS 64
#include <Python.h>
#include <pcp/pmafm.h>
#include <pcp/pmtime.h>
diff -Naurp pcp-6.2.2.orig/src/python/pmi.c pcp-6.2.2/src/python/pmi.c
--- pcp-6.2.2.orig/src/python/pmi.c 2024-05-08 09:18:25.000000000 +1000
+++ pcp-6.2.2/src/python/pmi.c 2024-06-10 13:07:42.554530246 +1000
@@ -23,8 +23,6 @@
** **
\**************************************************************************/
#define PY_SSIZE_T_CLEAN
-#define _FILE_OFFSET_BITS 64
-#define _TIME_BITS 64
#include <Python.h>
#include <pcp/pmapi.h>
#include <pcp/import.h>

View File

@ -1 +1 @@
SHA512 (pcp-6.2.2.src.tar.gz) = 4d28067583fb6c589fa7b419a67e26fafd6ec2453bcc4c8df2848985b63cb792660378ed1f39f456a7bf1e1165e17d76b74beb8a3739e417fe69fb8c8a5cda77
SHA512 (pcp-6.3.1.src.tar.gz) = 339d6876c1fe2682d66a158572612393eb95375fc6734bcbc9f67ade1ca9f31fa12a08eb35dd5f95f1e193cfad655f1621c15497f33514710a8e67d105051b95