---
name: "pmgetpmnslocation"
section: "3"
platform: "linux"
package: "libpcp3-dev"
version: "4.3.2+really4.3.1-0.1"
release: "Debian 10 (Buster)"
platforms: ["linux"]
url: "https://new.carta.tech/pmGetPMNSLocation"
---

# pmgetpmnslocation(3)

determine the location of the currently used PMNS

Part of [pmGetPMNSLocation(3)](/pmGetPMNSLocation/3.md).

## NAME

**pmGetPMNSLocation** - determine the location of the currently used PMNS

## C SYNOPSIS

**#include \<pcp/pmapi.h\>**

**int pmGetPMNSLocation(void);**

**cc ... -lpcp**

## DESCRIPTION

If an application needs to know where the Performance Metrics Name Space (PMNS) is coming from then **pmGetPMNSLocation** will return whether it is from an archive, **PMNS\_ARCHIVE**, or from a local PMNS file, **PMNS\_LOCAL**, or from a remote pmcd, **PMNS\_REMOTE**.

This information may be useful in determining an appropriate error message depending on the PMNS' location.

## 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). Values for these variables may be obtained programmatically using the [**pmGetConfig**(3)](/pmGetConfig/3.md) function.

## SEE ALSO

[**PMAPI**(3)](/PMAPI/3.md), [**pmGetConfig**(3)](/pmGetConfig/3.md), [**pmLoadASCIINameSpace**(3)](/pmLoadASCIINameSpace/3.md), [**pmLoadNameSpace**(3)](/pmLoadNameSpace/3.md), [**pmTrimNameSpace**(3)](/pmTrimNameSpace/3.md), [**pcp.conf**(5)](/pcp.conf/5.md), [**pcp.env**(5)](/pcp.env/5.md) and [**pmns**(5)](/pmns/5.md).

## DIAGNOSTICS

- **PM\_ERR\_NOPMNS**

  If is not possible to determine where the location of the PMNS is. This could be due to problems with the current context or being unable to load a local PMNS.
