import CS pcp-6.3.7-9.el9
This commit is contained in:
parent
fa8591c90f
commit
6c2a4da866
181
SOURCES/ds389.patch
Normal file
181
SOURCES/ds389.patch
Normal file
@ -0,0 +1,181 @@
|
||||
diff --git a/src/pmdas/ds389/pmdads389.pl b/src/pmdas/ds389/pmdads389.pl
|
||||
index 9d51bffd5f..18151aa633 100644
|
||||
--- a/src/pmdas/ds389/pmdads389.pl
|
||||
+++ b/src/pmdas/ds389/pmdads389.pl
|
||||
@@ -56,7 +56,8 @@ our %dataclusters = (
|
||||
'0' => ['0','cn=monitor','cn.',$dfscope,$dffilter,$dattrs],
|
||||
'1' => ['0','cn=monitor,cn=userRoot,cn=ldbm database,cn=plugins,cn=config','userroot.',$dfscope,$dffilter,$dattrs],
|
||||
'2' => ['0','cn=monitor,cn=changelog,cn=ldbm database,cn=plugins,cn=config','changelog_mon.',$dfscope,$dffilter,$dattrs],
|
||||
- '3' => ['0','cn=snmp,cn=monitor','snmp_mon.',$dfscope,$dffilter,$dattrs]
|
||||
+ '3' => ['0','cn=snmp,cn=monitor','snmp_mon.',$dfscope,$dffilter,$dattrs],
|
||||
+ '4' => ['0','cn=monitor,cn=ldbm database,cn=plugins,cn=config','ldbm_mon.',$dfscope,$dffilter,$dattrs]
|
||||
);
|
||||
our @def_met = (
|
||||
[0,0,$mpm_type,$mpm_indom,$mpm_sem,$mpmda_units,'threads'],
|
||||
@@ -88,13 +89,6 @@ our @def_met = (
|
||||
[1,12,$mpm_type,$mpm_indom,PM_SEM_DISCRETE,'1,0,0,'.PM_SPACE_BYTE.',0,0','maxdncachesize'],
|
||||
[1,13,$mpm_type,$mpm_indom,$mpm_sem,$mpmda_units,'currentdncachecount'],
|
||||
[1,14,PM_TYPE_32,$mpm_indom,$mpm_sem,$mpmda_units,'maxdncachecount'],
|
||||
- [1,15,$mpm_type,$mpm_indom,$mpm_sem,$mpmda_units,'normalizeddncachehits'],
|
||||
- [1,16,PM_TYPE_32,$mpm_indom,$mpm_sem,$mpmda_units,'normalizeddncachetries'],
|
||||
- [1,17,PM_TYPE_32,$mpm_indom,$mpm_sem,$mpmda_units,'normalizeddncachehitratio'],
|
||||
- [1,18,PM_TYPE_32,$mpm_indom,$mpm_sem,'1,0,0,'.PM_SPACE_BYTE.',0,0','currentnormalizeddncachesize'],
|
||||
- [1,19,PM_TYPE_32,$mpm_indom,$mpm_sem,'1,0,0,'.PM_SPACE_BYTE.',0,0','maxnormalizeddncachesize'],
|
||||
- [1,20,PM_TYPE_32,$mpm_indom,$mpm_sem,$mpmda_units,'currentnormalizeddncachecount'],
|
||||
- [1,21,PM_TYPE_32,$mpm_indom,$mpm_sem,$mpmda_units,'normalizeddncachemisses'],
|
||||
[2,0,$mpm_type,$mpm_indom,$mpm_sem,'0,0,0,0,0,0','readonly'],
|
||||
[2,1,PM_TYPE_U64,$mpm_indom,PM_SEM_COUNTER,$mpmda_units,'entrycachehits'],
|
||||
[2,2,PM_TYPE_U64,$mpm_indom,PM_SEM_COUNTER,$mpmda_units,'entrycachetries'],
|
||||
@@ -140,7 +134,14 @@ our @def_met = (
|
||||
[3,27,$mpm_type,$mpm_indom,$mpm_sem,$mpmda_units,'masterentries'],
|
||||
[3,28,$mpm_type,$mpm_indom,$mpm_sem,$mpmda_units,'cacheentries'],
|
||||
[3,29,$mpm_type,$mpm_indom,$mpm_sem,$mpmda_units,'cachehits'],
|
||||
- [3,30,$mpm_type,$mpm_indom,$mpm_sem,$mpmda_units,'slavehits']
|
||||
+ [3,30,$mpm_type,$mpm_indom,$mpm_sem,$mpmda_units,'slavehits'],
|
||||
+ [4,0,$mpm_type,$mpm_indom,$mpm_sem,$mpmda_units,'normalizeddncachehits'],
|
||||
+ [4,1,PM_TYPE_32,$mpm_indom,$mpm_sem,$mpmda_units,'normalizeddncachetries'],
|
||||
+ [4,2,PM_TYPE_32,$mpm_indom,$mpm_sem,$mpmda_units,'normalizeddncachehitratio'],
|
||||
+ [4,3,PM_TYPE_32,$mpm_indom,$mpm_sem,'1,0,0,'.PM_SPACE_BYTE.',0,0','currentnormalizeddncachesize'],
|
||||
+ [4,4,PM_TYPE_32,$mpm_indom,$mpm_sem,'1,0,0,'.PM_SPACE_BYTE.',0,0','maxnormalizeddncachesize'],
|
||||
+ [4,5,PM_TYPE_32,$mpm_indom,$mpm_sem,$mpmda_units,'currentnormalizeddncachecount'],
|
||||
+ [4,6,PM_TYPE_32,$mpm_indom,$mpm_sem,$mpmda_units,'normalizeddncachemisses']
|
||||
);
|
||||
|
||||
our @def_replagr_met = (
|
||||
@@ -240,6 +241,41 @@ sub ds389_time_to_epoch {
|
||||
substr($time,0,4) - 1900);
|
||||
}
|
||||
|
||||
+sub ds389_metric_key_attr {
|
||||
+ my ($prefix, $attr) = @_;
|
||||
+ my $al = lc($attr);
|
||||
+
|
||||
+ if ($prefix =~ /^(?:cn|userroot|changelog_mon|snmp_mon|ldbm_mon|[a-z0-9_]+_mon)\.$/) {
|
||||
+ return $al;
|
||||
+ }
|
||||
+
|
||||
+ # Replication agreement attributes are mixed-case in PMNS; map case-insensitively.
|
||||
+ my %replica_attr_map = (
|
||||
+ 'nsds5replicareapactive' => 'nsds5replicareapactive',
|
||||
+ 'nsruvreplicalastmodified' => 'nsruvReplicaLastModified',
|
||||
+ 'nsds5replicalastupdatestart' => 'nsds5replicaLastUpdateStart',
|
||||
+ 'nsds5replicalastupdateend' => 'nsds5replicaLastUpdateEnd',
|
||||
+ 'nsds5replicachangessentsincestartup' => 'nsds5replicaChangesSentSinceStartup',
|
||||
+ 'replicalastupdatestatus' => 'replicaLastUpdateStatus',
|
||||
+ 'nsds5replicalastinitstart' => 'nsds5replicaLastInitStart',
|
||||
+ 'nsds5replicalastinitend' => 'nsds5replicaLastInitEnd',
|
||||
+ 'nsds5replicalastupdatetime' => 'nsds5replicaLastUpdateTime',
|
||||
+ 'replicachangesskippedsincestartup' => 'replicaChangesSkippedSinceStartup',
|
||||
+ 'replicachangessentsincestartup' => 'replicaChangesSentSinceStartup',
|
||||
+ 'nsds5replicachangecount' => 'nsds5ReplicaChangeCount',
|
||||
+ );
|
||||
+ if (exists $replica_attr_map{$al}) {
|
||||
+ return $replica_attr_map{$al};
|
||||
+ }
|
||||
+
|
||||
+ if ($al eq 'nsds5replicaupdateinprogress') {
|
||||
+ # Keep historical PMNS typo for compatibility.
|
||||
+ return 'nsds5replicaUpdateInProgeress';
|
||||
+ }
|
||||
+
|
||||
+ return $attr;
|
||||
+}
|
||||
+
|
||||
sub ds389_process_entry {
|
||||
my ($entry, $prefix, $cluster) = @_;
|
||||
my $currtime;
|
||||
@@ -248,19 +284,20 @@ sub ds389_process_entry {
|
||||
if ($entry && $entry->can('attributes')) {
|
||||
foreach my $attr ($entry->attributes) {
|
||||
my $value = $entry->get_value($attr);
|
||||
+ my $al = lc($attr);
|
||||
|
||||
- if ($attr eq 'currenttime') {
|
||||
+ if ($al eq 'currenttime') {
|
||||
$currtime = ds389_time_to_epoch($value);
|
||||
next;
|
||||
}
|
||||
|
||||
- if ($attr eq 'starttime') {
|
||||
+ if ($al eq 'starttime') {
|
||||
my $starttime = ds389_time_to_epoch($value);
|
||||
$value = $currtime - $starttime;
|
||||
$attr = 'uptime';
|
||||
}
|
||||
|
||||
- if ($attr eq 'nsds5replicaLastUpdateStatus') {
|
||||
+ if ($al eq 'nsds5replicalastupdatestatus') {
|
||||
if ($value =~ /No replication sessions started since server startup/i) {
|
||||
$value = 30
|
||||
} elsif ($value =~ /agreement disabled/i) {
|
||||
@@ -273,31 +310,32 @@ sub ds389_process_entry {
|
||||
$attr = 'replicaLastUpdateStatus';
|
||||
}
|
||||
|
||||
- if ($attr eq 'nsds5replicaChangesSentSinceStartup' ) {
|
||||
-# my $rep_id = (split /:/, $value)[0];
|
||||
- my ($sent, $skipped) = (split /\//, (split /:/, $value)[1]);
|
||||
-# $attr = 'replica'.$rep_id.'ChangesSentSinceStartup';
|
||||
- $attr = 'replicaChangesSentSinceStartup';
|
||||
- $metrics{"$aname." . $prefix . $attr} = $sent;
|
||||
- $value = $skipped;
|
||||
-# $attr = 'replica'.$rep_id.'ChangesSkippedSinceStartup';
|
||||
- $attr = 'replicaChangesSkippedSinceStartup';
|
||||
+ if ($al eq 'nsds5replicachangessentsincestartup' ) {
|
||||
+ # Format is "rid:sent/skipped rid:sent/skipped ...", aggregate all RIDs.
|
||||
+ my ($sent, $skipped) = (0, 0);
|
||||
+ while ($value =~ /(\d+):(\d+)\/(\d+)/g) {
|
||||
+ $sent += $2;
|
||||
+ $skipped += $3;
|
||||
+ }
|
||||
+ $metrics{"$aname." . $prefix . 'replicaChangesSentSinceStartup'} = $sent;
|
||||
+ $metrics{"$aname." . $prefix . 'replicaChangesSkippedSinceStartup'} = $skipped;
|
||||
}
|
||||
|
||||
- if ($attr eq 'nsds5replicaUpdateInProgress' ) {
|
||||
+ if ($al eq 'nsds5replicaupdateinprogress' ) {
|
||||
if ($value =~ /^(true|TRUE)$/) {
|
||||
$value = 1;
|
||||
} else {
|
||||
$value = 0;
|
||||
}
|
||||
+ $attr = 'nsds5replicaUpdateInProgeress';
|
||||
}
|
||||
|
||||
if ($attr =~ /^(nsds5replicaLastInitEnd|nsds5replicaLastUpdateStart|nsds5replicaLastInitStart)$/i ) {
|
||||
$value = ds389_time_to_epoch($value);
|
||||
- if ($attr eq 'nsds5replicaLastUpdateStart') {
|
||||
+ if (lc($attr) eq 'nsds5replicalastupdatestart') {
|
||||
$startrepltime = $value;
|
||||
}
|
||||
- $metrics{"$aname." . $prefix . $attr} = $value;
|
||||
+ $metrics{"$aname." . $prefix . ds389_metric_key_attr($prefix, $attr)} = $value;
|
||||
}
|
||||
|
||||
if ($endrepltime ne '' && $startrepltime ne '' ) {
|
||||
@@ -316,7 +354,15 @@ sub ds389_process_entry {
|
||||
$value = (split / /, $maxcsn)[0];
|
||||
}
|
||||
|
||||
- $metrics{"$aname." . $prefix . $attr} = $value;
|
||||
+ # Newer 389-ds publishes SupplierEntries/ConsumerHits in cn=snmp,cn=monitor.
|
||||
+ # Keep PCP metric names masterentries/slavehits for compatibility.
|
||||
+ if ($prefix eq 'snmp_mon.' && $al eq 'supplierentries') {
|
||||
+ $attr = 'masterentries';
|
||||
+ } elsif ($prefix eq 'snmp_mon.' && $al eq 'consumerhits') {
|
||||
+ $attr = 'slavehits';
|
||||
+ }
|
||||
+
|
||||
+ $metrics{"$aname." . $prefix . ds389_metric_key_attr($prefix, $attr)} = $value;
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -346,7 +392,7 @@ sub ds389_fetch {
|
||||
my ($cluster) = @_;
|
||||
my $mesg;
|
||||
|
||||
- \&retrieve_ldap($cluster,$dataclusters{$cluster}[0],$dataclusters{$cluster}[1],$dataclusters{$cluster}[2],$dataclusters{$cluster}[3],$dataclusters{$cluster}[4], $dataclusters{$cluster}[5]);
|
||||
+ retrieve_ldap($cluster,$dataclusters{$cluster}[0],$dataclusters{$cluster}[1],$dataclusters{$cluster}[2],$dataclusters{$cluster}[3],$dataclusters{$cluster}[4], $dataclusters{$cluster}[5]);
|
||||
}
|
||||
|
||||
sub ds389_fetch_callback {
|
||||
106
SOURCES/memory-leaks.patch
Normal file
106
SOURCES/memory-leaks.patch
Normal file
@ -0,0 +1,106 @@
|
||||
diff -ru a/src/libpcp/src/logmeta.c b/src/libpcp/src/logmeta.c
|
||||
--- a/src/libpcp/src/logmeta.c 2025-03-27 00:25:53.000000000 -0400
|
||||
+++ b/src/libpcp/src/logmeta.c 2026-03-05 13:25:46.905000000 -0500
|
||||
@@ -1261,6 +1261,8 @@
|
||||
}
|
||||
}
|
||||
didp->numinst = numinst;
|
||||
+ if (didp->alloc & PMLID_INSTLIST)
|
||||
+ free(didp->instlist);
|
||||
didp->instlist = instlist;
|
||||
if (didp->alloc & PMLID_NAMELIST)
|
||||
free(didp->namelist);
|
||||
@@ -1962,7 +1964,6 @@
|
||||
*/
|
||||
memset((void *)lidp, 0, sizeof(*lidp));
|
||||
}
|
||||
-
|
||||
}
|
||||
|
||||
/*
|
||||
Only in b/src/libpcp/src: logmeta.c.orig
|
||||
diff -ru a/src/libpcp_web/src/webgroup.c b/src/libpcp_web/src/webgroup.c
|
||||
--- a/src/libpcp_web/src/webgroup.c 2026-03-05 13:26:10.539000000 -0500
|
||||
+++ b/src/libpcp_web/src/webgroup.c 2026-03-05 13:25:39.785000000 -0500
|
||||
@@ -1969,13 +1969,13 @@
|
||||
scrape->numnames, scrape->names,
|
||||
scrape->mplist, scrape->pmidlist,
|
||||
scrape->msg, scrape->arg);
|
||||
- for (i = 0; i < scrape->numnames; i++)
|
||||
- sdsfree(scrape->names[i]);
|
||||
- scrape->numnames = 0;
|
||||
} else {
|
||||
infofmt(*scrape->msg, "'%s' - %s", prefix,
|
||||
pmErrStr_r(sts, err, sizeof(err)));
|
||||
}
|
||||
+ for (i = 0; i < scrape->numnames; i++)
|
||||
+ sdsfree(scrape->names[i]);
|
||||
+ scrape->numnames = 0;
|
||||
|
||||
if (sts >= 0)
|
||||
sts = (scrape->status < 0) ? scrape->status : 0;
|
||||
diff -ru a/src/pmproxy/src/http.c b/src/pmproxy/src/http.c
|
||||
--- a/src/pmproxy/src/http.c 2025-03-30 21:41:26.000000000 -0400
|
||||
+++ b/src/pmproxy/src/http.c 2026-03-05 13:25:31.948000000 -0500
|
||||
@@ -1,5 +1,5 @@
|
||||
/*
|
||||
- * Copyright (c) 2019-2020,2023 Red Hat.
|
||||
+ * Copyright (c) 2019-2020,2023,2025 Red Hat.
|
||||
*
|
||||
* 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
|
||||
@@ -500,14 +500,18 @@
|
||||
client->buffer ? (long unsigned)sdslen(client->buffer) : 0, client);
|
||||
|
||||
buffer = sdsempty();
|
||||
- suffix = client->buffer;
|
||||
- if (suffix == NULL) { /* error or no data currently accumulated */
|
||||
+
|
||||
+ if (client->buffer == NULL) {
|
||||
+ /* error or no data currently accumulated */
|
||||
suffix = prepare_buffer(client, message, flags, 1);
|
||||
} else if (message != NULL) {
|
||||
- suffix = sdscatsds(suffix, message);
|
||||
+ suffix = sdscatsds(client->buffer, message);
|
||||
suffix = prepare_buffer(client, suffix, flags, 1);
|
||||
sdsfree(message);
|
||||
+ } else {
|
||||
+ suffix = client->buffer;
|
||||
}
|
||||
+ client->buffer = NULL;
|
||||
message = NULL;
|
||||
|
||||
pmsprintf(length, sizeof(length), "%lX",
|
||||
@@ -516,8 +520,6 @@
|
||||
sdsfree(suffix);
|
||||
suffix = NULL;
|
||||
|
||||
- client->buffer = NULL;
|
||||
-
|
||||
if (!(client->u.http.flags & HTTP_FLAG_FLUSHING)) {
|
||||
client->u.http.flags &= ~HTTP_FLAG_STREAMING; /* end of stream! */
|
||||
suffix = sdsnewlen("0\r\n\r\n", 5); /* chunked suffix */
|
||||
@@ -537,10 +539,10 @@
|
||||
} else if (message != NULL) {
|
||||
suffix = sdscatsds(client->buffer, message);
|
||||
sdsfree(message);
|
||||
- client->buffer = NULL;
|
||||
} else {
|
||||
- suffix = sdsempty();
|
||||
+ suffix = client->buffer;
|
||||
}
|
||||
+ client->buffer = NULL;
|
||||
suffix = prepare_buffer(client, suffix, flags, 1);
|
||||
buffer = http_response_header(client, sdslen(suffix), sts, type);
|
||||
}
|
||||
@@ -689,7 +691,8 @@
|
||||
pmsprintf(length, sizeof(length), "%lX",
|
||||
(unsigned long)sdslen(client->buffer));
|
||||
buffer = sdscatfmt(buffer, "%s\r\n%S\r\n", length, client->buffer);
|
||||
- /* reset for next call - original released on I/O completion */
|
||||
+ /* reset for next call - buffer released on I/O completion */
|
||||
+ sdsfree(client->buffer);
|
||||
client->buffer = NULL; /* safe, as now held in 'buffer' */
|
||||
} else if (!buffer) {
|
||||
return; /* streaming + compressing, nothing to send yet */
|
||||
Only in b/src/pmproxy/src: http.c.orig
|
||||
@ -1,6 +1,6 @@
|
||||
Name: pcp
|
||||
Version: 6.3.7
|
||||
Release: 7%{?dist}
|
||||
Release: 9%{?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
|
||||
@ -24,6 +24,8 @@ Patch12: pcp2openmetrics_hang.patch
|
||||
Patch13: atop-cpu-utilization.patch
|
||||
Patch14: pmda-openmetrics-performance.patch
|
||||
Patch15: pcp-RHEL-133548.patch
|
||||
Patch16: memory-leaks.patch
|
||||
Patch17: ds389.patch
|
||||
|
||||
%if 0%{?fedora} >= 40 || 0%{?rhel} >= 10
|
||||
ExcludeArch: %{ix86}
|
||||
@ -3634,6 +3636,12 @@ fi
|
||||
%files zeroconf -f pcp-zeroconf-files.rpm
|
||||
|
||||
%changelog
|
||||
* Thu Apr 2 2026 Jan Kurik <jkurik@redhat.com> - 6.3.7-9
|
||||
- Backported ds389 patch from the upstream (pcp-7.1.1)
|
||||
|
||||
* Thu Mar 5 2026 Jan Kurik <jkurik@redhat.com> - 6.3.7-8
|
||||
- Backported memory leaks patches from pcp-7.0.3
|
||||
|
||||
* Thu Feb 19 2026 William Cohen <wcohen@redhat.com> - 6.3.7-7
|
||||
- Update selinux policy for pmda-nvidia (RHEL-133548)
|
||||
|
||||
|
||||
Loading…
Reference in New Issue
Block a user