Product SiteDocumentation Site

2.4.3. Name Space

The PMNS file defines the name space of the PMDA. It is a simple text file that is used during installation to expand the Name Space of the PMCD process. The format of this file is described by the pmns(5) man page and its hierarchical nature, syntax, and helper tools are further described in the Performance Co-Pilot User's and Administrator's Guide.
Client processes will not be able to access the PMDA metrics if the PMNS file is not installed as part of the PMDA installation procedure on the collector host. The installed list of metric names and their corresponding PMIDs can be found in ${PCP_VAR_DIR}/pmns/root.
Example 2.15, “ pmns File for the Simple PMDA” shows the simple PMDA, which has five metrics:
  • Three metrics immediately under the simple node
  • Two metrics under another non-terminal node called simple.time

Example 2.15.  pmns File for the Simple PMDA

simple {
    numfetch    SIMPLE:0:0
    color       SIMPLE:0:1
    time
    now         SIMPLE:2:4
}
simple.time {
    user        SIMPLE:1:2
    sys         SIMPLE:1:3
}
Metrics that have different clusters do not have to be specified in different subtrees of the PMNS. Example 2.16, “Alternate pmns File for the Simple PMDA” shows an alternative PMNS for the simple PMDA:

Example 2.16. Alternate pmns File for the Simple PMDA

simple { 
    numfetch    SIMPLE:0:0 
    color       SIMPLE:0:1 
    usertime    SIMPLE:1:2 
    systime     SIMPLE:1:3 
}
In this example, the SIMPLE macro is replaced by the domain number listed in ${PCP_VAR_DIR}/pmns/stdpmid for the corresponding PMDA during installation (for the simple PMDA, this would normally be the value 253).
If the PMDA implementer so chooses, all or a subset of the metric names and identifiers can be specified programatically. In this situation, a special asterisk syntax is used to denote those subtrees which are to be handles this way. Example 2.17, “Dynamic metrics pmns File for the Simple PMDA” shows this dynamic namespace syntax, for all metrics in the simple PMDA:

Example 2.17. Dynamic metrics pmns File for the Simple PMDA

simple         SIMPLE:*:*
In this example, like the one before, the SIMPLE macro is replaced by the domain number, and all (simple.*) metric namespace operations must be handled by the PMDA. This is in contrast to the static metric name model earlier, where the host-wide PMNS file is updated and used by PMCD, acting on behalf of the agent.