---
name: "mrtg2pcp"
section: "1"
platform: "linux"
package: "pcp"
version: "7.2.2-2"
release: "Arch Linux 2026-11-01"
platforms: ["linux"]
url: "https://new.carta.tech/mrtg2pcp"
---

# mrtg2pcp(1)

import MRTG data and create a PCP archive

## NAME

**mrtg2pcp** - import MRTG data and create a PCP archive

## SYNOPSIS

**mrtg2pcp** *hostname* *devname* *timezone* *infile* *outfile*

## DESCRIPTION

**mrtg2pcp** is intended to read an MRTG log file as created by [**mrtg**(1)](/mrtg/1.md) and translate this into a Performance Co-Pilot (PCP) archive with the basename *outfile*. The *hostname*, *devname*, and *timezone* arguments specify information about the system for which the statistics were gathered.

The resultant PCP archive may be used with all PCP client tools to graph subsets of the data using [**pmchart**(1)](/pmchart/1.md), perform data reduction and reporting, filter with the PCP inference engine [**pmie**(1)](/pmie/1.md), etc.

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) and *outfile***.index** (a temporal index to improve efficiency of replay operations for the archive). If any of these files exists already, then **mrtg2pcp** will **not** overwrite them and will exit with an error message of the form

\_\_pmLogNewFile: \`\`blah.0'' already exists, not over-written

**mrtg2pcp** 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.

## 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)](/pcp.conf/5.md).

## SEE ALSO

[**mrtg**(1)](/mrtg/1.md), [**pmchart**(1)](/pmchart/1.md), [**pmie**(1)](/pmie/1.md), [**pmlogger**(1)](/pmlogger/1.md), [**LOGIMPORT**(3)](/LOGIMPORT/3.md) and **PCP::LogImport**(3).
