SAR2PCP(1)
π SAR2PCP(1) π
okay bestie, so this is the sar2pcp page from the General Commands Manual β it's a whole vibe and it's about turning your sar data into a PCP archive. sit down, grab a boba, let's go π§β¨
β¨ NAME β¨
sar2pcp β import sar data and create a PCP archive π¦
πΈ SYNOPSIS πΈ
sar2pcp infile outfile
like, that's it. two little args. main character energy fr π
π DESCRIPTION π
okay so sar2pcp is intended to read a binary System Activity Reporting (sar) data file as created by sadc(1) (that's your infile) and translate this into a Performance Co-Pilot (PCP) archive with the basename outfile. slay β¨
but β plot twist β if infile has the suffix .xml, then it will be considered already in XML format and sar2pcp will operate directly on it. no middleman, no problem π
The resultant PCP archive may be used with all the PCP client tools to graph subsets of the data using pmchart(1), perform data reduction and reporting, filter with the PCP inference engine pmie(1), etc. it's giving versatile. it's giving iconic. π
A series of physical files will be created with the prefix outfile. these are:
outfile.0β the performance data πoutfile.metaβ the metadata that describes the performance data π·οΈoutfile.indexβ a temporal index to improve efficiency of replay operations for the archive β±οΈ
π¨ no cap, listen up: if any of these files exists already, then sar2pcp will not overwrite them and will exit with an error message of the form
_&__pmLogNewFile: ``blah.0'' already exists, not over-written
like she said no, and she meant it π
sar2pcp is a Perl script that uses the PCP::LogImport Perl wrapper around the PCP libpcp_import library, and as such could be used as an example to develop new tools to import other types of performance data and create PCP archives. A Python wrapper module is also available. yes bestie, she's a template, she's a blueprint, she's everything π
π NOTES π
As of sysstat version 12.0.5, sadc(1) has added functionality to directly write PCP archive files. so if you wanna produce archive files from sar, run:
$ sadf -l -O pcparchive=ARCHIVE_NAME sar.dat -- -A
copy that exactly, don't be cute with it π₯
π CAVEATS π
okay this is the part where we get serious, bestie, because this is where people get humbled π
When not using the XML input option, sar2pcp requires infile to have been created by a version of sadc(1) from
http://sebastien.godard.pagesperso-orange.fr/
which includes the sadf(1) utility to translate infile into an XML stream (any since version 6). sar2pcp will automatically run sadf(1) and translate the resultant XML into a PCP archive. so like, she does the work for you, but only if the ingredients are right π«Ά
When using binary sadc files it is important to ensure the installed sadf is compatible with the version of sadc that originally generated the binary files. Simply assuming a newer installed version will work is unfortunately far too optimistic, and nor should one assume that binary data from different platforms (e.g. different endianness) will work β these issues are due to limitations in sadc and sadf, and not in sar2pcp itself. so don't come for her, she's innocent π
Fortunately, the sadf message indicating that an incompatibility has been detected is consistent across versions, and is always prefixed
Invalid system activity file
if you see that, that's your sign. that's the vibe check failing. that's the universe telling you the versions don't match π
Using an XML infile has the advantage that the installed version of sadf is completely bypassed. sar2pcp undertakes to transform any valid XML produced by any of the different variations of sadf into a valid PCP archive. Any version of PCP will be able to interpret the archive files produced by any version of sar2pcp, and you are also free to move the binary PCP archive between different platforms, different hardware, even different operating systems β it Just Works (TM). β¨ literally the dream. the fantasy. the It Just Works (TM) moment we all deserve π
π§ PCP ENVIRONMENT π§
Environment variables with the prefix PCP_ are used to parameterize the file and directory names used by PCP. On each installation, the file /etc/pcp.conf contains the local values for these variables. The $PCP_CONF variable may be used to specify an alternative configuration file, as described in pcp.conf(5). π
For environment variables affecting PCP tools, see pmGetOptions(3). π
π SEE ALSO π
pmie(1), pmchart(1), pmlogger(1), pmlogextract(1), pmlogsummary(1), sadc(1), sadf(1), sar(1), Date::Parse(3pm), Date::Format(3pm), PCP::LogImport(3pm), XML::TokeParser(3pm) and LOGIMPORT(3). go read them, they're all part of the family π
aaaand that's the whole page, bestie!! π this cutie comes to you from the Performance Co-Pilot girlypop herself, PCP, and yes, her name is right there in the title too β SAR2PCP(1), she's the moment, she's the icon, she's the legend π
β¨π¦πΈπ
π¦ where this page comes from
- arch rolling: pcp 7.2.2-2 Β· GPL-2.0-or-later AND LGPL-2.1-or-later AND CC-BY-3.0
- centos-stream 10: pcp-doc 7.1.5-6.el10 Β· GPL-2.0-or-later AND CC-BY-3.0
- centos-stream 9: pcp-doc 6.3.7-14.el9 Β· GPL-2.0-or-later AND CC-BY-3.0
- debian trixie: pcp-import-sar2pcp 6.3.8-1
- fedora 43: pcp-doc 7.0.1-1.fc43 Β· GPL-2.0-or-later AND CC-BY-3.0
- fedora 43: pcp-doc 7.2.1-1.fc43
- fedora 43: pcp-doc 7.2.2-1.fc43
- fedora 43: pcp-doc 7.2.2-2.fc43 Β· GPL-2.0-or-later AND CC-BY-3.0
- fedora 44: pcp-doc 7.1.0-6.fc44 Β· GPL-2.0-or-later AND CC-BY-3.0
- fedora 44: pcp-doc 7.2.1-1.fc44
- fedora 44: pcp-doc 7.2.2-1.fc44
- fedora 44: pcp-doc 7.2.2-2.fc44 Β· GPL-2.0-or-later AND CC-BY-3.0
- ubuntu questing: pcp-import-sar2pcp 6.3.8-1
- ubuntu resolute: pcp-import-sar2pcp 7.1.1-1
- ubuntu stonking: pcp-import-sar2pcp 7.2.1-2build1
- Copyright (c) 2012-2013, 2019 Red Hat
- Copyright (c) 2010 Ken McDonell. All Rights Reserved
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash on : a language model's rewrite of the original, under its terms