Bug 1824403

Summary: the folio written by pmchart when entering record mode should change local: and localhost to the actual hostname, to match the archive
Product: Red Hat Enterprise Linux 8 Reporter: Yogesh Babar <ybabar>
Component: pcpAssignee: Mark Goodwin <mgoodwin>
Status: CLOSED ERRATA QA Contact: Jan Kurik <jkurik>
Severity: medium Docs Contact:
Priority: unspecified    
Version: 8.0CC: agerstmayr, jkurik, mgoodwin, nathans, patrickm
Target Milestone: rcKeywords: Bugfix, Triaged
Target Release: 8.0Flags: pm-rhel: mirror+
Hardware: All   
OS: Linux   
Whiteboard:
Fixed In Version: pcp-5.2.2-1.el8 Doc Type: No Doc Update
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2021-05-18 15:19:30 UTC Type: Bug
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Embargoed:

Description Yogesh Babar 2020-04-16 06:46:50 UTC
Description of problem:

The pmchart in record mode on local system throws error "Host "local:" cannot be matched to an open archive for <metric_name>". The pmafm also shows the mismatch error 

pmafm> check
 Archive: /home/yogesh/.pcp/pmlogger/local:/20200415.03.49.55 ... Errors
 Hostname mismatch: folio=local: archive=pcp

My hostname is 'PCP'. 

Version-Release number of selected component (if applicable):

pcp-4.3.2-3.el8_1.x86_64

How reproducible:


Steps to Reproduce:
1. on a localhost system
2. pmchart 
3.choose record
4. add any view
5. stop the recording

Actual results:
you will get the error - "Host "local:" cannot be matched to an open archive for <metric_name>".

Expected results:

the folio written by pmchart when entering record mode should change local: and localhost to the actual hostname, to match the archive

Additional info:

If you comment out the PMCD_LOCAL=1 from /etc/sysconfif/pmcd and start using the #pmchart -h <localhost_name> it works and it does capture the correct folio with correct hostname. 

Also, using #pmchart -h <remote_hostname> also works. 

It only fails on localsystem.

Comment 1 Mark Goodwin 2020-09-18 06:38:47 UTC
Fixed upstream:

commit 214675b92c1d8290955c0026b1e41e8583a03098
Author: Mark Goodwin <mgoodwin>
Date:   Fri Sep 18 16:31:33 2020 +1000

    pmchart: record mode - save actual hostname instead of local: in views and folios
    
    Hostname in the view and folio needs to match the the archive label,
    otherwise pmafm can't match up archives with views.
    
    Resolves: RHBZ#1824403

Comment 4 Mark Goodwin 2020-09-30 08:48:53 UTC
Regression reported by QA fixed upstream for pcp-5.2.2 :

commit c18e0033d9c1a2bd0b3cd248173c6901c0ec25e1
Author: Mark Goodwin <mgoodwin>
Date:   Wed Sep 30 18:35:49 2020 +1000

    pmchart: record mode, keep "local:" arg for launched pmloggers
    
    When pmchart "record mode" launches a pmlogger for host "local:",
    don't resolve the argument to the local hostname because pmlogger
    may not then be able to connect to the local PMCD if PMCD_LOCAL=1
    is set in sysconfig. Pmlogger already correctly handles translation
    of "local:" for the archive label.
    
    Resolves regression reported in RHBZ#1824403

Comment 9 errata-xmlrpc 2021-05-18 15:19:30 UTC
Since the problem described in this bug report should be
resolved in a recent advisory, it has been closed with a
resolution of ERRATA.

For information on the advisory (pcp bug fix and enhancement update), and where to find the updated
files, follow the link below.

If the solution does not work for you, open a new bug report.

https://access.redhat.com/errata/RHBA-2021:1754