Fix out of range in pcp-mpstat

This commit is contained in:
wk333 2023-02-13 10:48:29 +08:00
parent 2b01017f30
commit 952e705e3b
2 changed files with 34 additions and 2 deletions

View File

@ -0,0 +1,26 @@
From 9e7d6b2796f669a5e41f5e4fb5ea349a39d8795b Mon Sep 17 00:00:00 2001
From: caodongxia <315816521@qq.com>
Date: Thu, 14 Jul 2022 15:16:42 +0800
Subject: [PATCH] fix out of range
---
src/pcp/mpstat/pcp-mpstat.py | 3 +++
1 file changed, 3 insertions(+)
diff --git a/src/pcp/mpstat/pcp-mpstat.py b/src/pcp/mpstat/pcp-mpstat.py
index fefb6aa..17da944 100755
--- a/src/pcp/mpstat/pcp-mpstat.py
+++ b/src/pcp/mpstat/pcp-mpstat.py
@@ -602,6 +602,9 @@ class MpstatReport(pmcc.MetricGroupPrinter):
# need two fetches to report rate converted counter metrics
return
+ if not group['hinv.ncpu'].netValues or not group['kernel.uname.sysname'].netValues:
+ return
+
if self.Machine_info_count == 0:
self.print_machine_info(group, manager)
self.Machine_info_count = 1
--
2.23.0

View File

@ -9,8 +9,8 @@
Name: pcp
Version: 4.1.3
Summary: System-level performance monitoring and performance management
Release: 13
License: GPLv2+ and LGPLv2.1+ and CC-BY
Release: 14
License: GPLv2+ and LGPLv2.1+ and CC-BY-SA-3.0
URL: https://pcp.io
Source0: https://dl.bintray.com/pcp/source/pcp-4.1.3.tar.gz
Source1: https://github.com/performancecopilot/pcp-webapp-vector/archive/1.3.1-1/pcp-webapp-vector-1.3.1-1.tar.gz
@ -21,6 +21,8 @@ Patch0001: Fix-some-options-and-syntax-errors.patch
Patch0002: fix-pcp-pidstat-bug.patch
Patch0003: Add-pcp_domain-selinux-policy.patch
Patch6000: CVE-2019-3695-CVE-2019-3696.patch
#Refer: https://github.com/performancecopilot/pcp/pull/822
Patch0004: fix-out-of-range-mpstat.patch
BuildRequires: gcc gcc-c++ procps autoconf bison flex nss-devel rpm-devel avahi-devel xz-devel zlib-devel
BuildRequires: python2-devel python3-devel ncurses-devel readline-devel cyrus-sasl-devel papi-devel libpfm-devel >= 4
@ -867,6 +869,7 @@ This package installs selinux support files for PCP.
%patch0002 -p1
%patch0003 -p1
%patch6000 -p1
%patch0004 -p1
%build
@ -2220,6 +2223,9 @@ fi
%config(noreplace) /etc/pcp/pmrep/*
%changelog
* Thu Jul 14 2022 caodongxia <caodongxia@h-partners.com> - 4.1.3-14
- Fix out of range in pcp-mpstat
* Tue Jun 8 2021 lingsheng <lingsheng@huawei.com> - 4.1.3-13
- Add pcp_domain selinux policy