Product SiteDocumentation Site

3.8.9. PMAPI Archive-Specific Services

The functions described in this section provide archive-specific services.

3.8.9.1.  pmGetArchiveLabel Function

int pmGetArchiveLabel(pmLogLabel *lp)
Python:
pmLogLabel loglabel = pmGetArchiveLabel()
Provided the current PMAPI context is associated with a set of PCP archive logs, the pmGetArchiveLabel function may be used to fetch the label record from the first archive in the set of archives. The structure returned through lp is as shown in Example 3.17, “ pmLogLabel Structure”:

Example 3.17.  pmLogLabel Structure

/*
 * Label Record at the start of every log file - as exported above the PMAPI ...
 */
#define PM_TZ_MAXLEN    40
#define PM_LOG_MAXHOSTLEN   64
#define PM_LOG_MAGIC    0x50052600
#define PM_LOG_VERS01   0x1
#define PM_LOG_VERS02   0x2
#define PM_LOG_VOL_TI   -2      /* temporal index */
#define PM_LOG_VOL_META -1      /* meta data */
typedef struct {
    int            ll_magic;          /* PM_LOG_MAGIC | log format version no. */
    pid_t          ll_pid;            /* PID of logger */
    struct timeval ll_start;          /* start of this log */
    char           ll_hostname[PM_LOG_MAXHOSTLEN]; /* name of collection host */
    char           ll_tz[PM_TZ_MAXLEN];            /* $TZ at collection host */
} pmLogLabel;
The python bindings get the label record from the archive.