.\" Automatically generated by Pod::Man 2.25 (Pod::Simple 3.16) .\" .\" Standard preamble: .\" ======================================================================== .de Sp \" Vertical space (when we can't use .PP) .if t .sp .5v .if n .sp .. .de Vb \" Begin verbatim text .ft CW .nf .ne \\$1 .. .de Ve \" End verbatim text .ft R .fi .. .\" Set up some character translations and predefined strings. \*(-- will .\" give an unbreakable dash, \*(PI will give pi, \*(L" will give a left .\" double quote, and \*(R" will give a right double quote. \*(C+ will .\" give a nicer C++. Capital omega is used to do unbreakable dashes and .\" therefore won't be available. \*(C` and \*(C' expand to `' in nroff, .\" nothing in troff, for use with C<>. .tr \(*W- .ds C+ C\v'-.1v'\h'-1p'\s-2+\h'-1p'+\s0\v'.1v'\h'-1p' .ie n \{\ . ds -- \(*W- . ds PI pi . if (\n(.H=4u)&(1m=24u) .ds -- \(*W\h'-12u'\(*W\h'-12u'-\" diablo 10 pitch . if (\n(.H=4u)&(1m=20u) .ds -- \(*W\h'-12u'\(*W\h'-8u'-\" diablo 12 pitch . ds L" "" . ds R" "" . ds C` "" . ds C' "" 'br\} .el\{\ . ds -- \|\(em\| . ds PI \(*p . ds L" `` . ds R" '' 'br\} .\" .\" Escape single quotes in literal strings from groff's Unicode transform. .ie \n(.g .ds Aq \(aq .el .ds Aq ' .\" .\" If the F register is turned on, we'll generate index entries on stderr for .\" titles (.TH), headers (.SH), subsections (.SS), items (.Ip), and index .\" entries marked with X<> in POD. Of course, you'll have to process the .\" output yourself in some meaningful fashion. .ie \nF \{\ . de IX . tm Index:\\$1\t\\n%\t"\\$2" .. . nr % 0 . rr F .\} .el \{\ . de IX .. .\} .\" .\" Accent mark definitions (@(#)ms.acc 1.5 88/02/08 SMI; from UCB 4.2). .\" Fear. Run. Save yourself. No user-serviceable parts. . \" fudge factors for nroff and troff .if n \{\ . ds #H 0 . ds #V .8m . ds #F .3m . ds #[ \f1 . ds #] \fP .\} .if t \{\ . ds #H ((1u-(\\\\n(.fu%2u))*.13m) . ds #V .6m . ds #F 0 . ds #[ \& . ds #] \& .\} . \" simple accents for nroff and troff .if n \{\ . ds ' \& . ds ` \& . ds ^ \& . ds , \& . ds ~ ~ . ds / .\} .if t \{\ . ds ' \\k:\h'-(\\n(.wu*8/10-\*(#H)'\'\h"|\\n:u" . ds ` \\k:\h'-(\\n(.wu*8/10-\*(#H)'\`\h'|\\n:u' . ds ^ \\k:\h'-(\\n(.wu*10/11-\*(#H)'^\h'|\\n:u' . ds , \\k:\h'-(\\n(.wu*8/10)',\h'|\\n:u' . ds ~ \\k:\h'-(\\n(.wu-\*(#H-.1m)'~\h'|\\n:u' . ds / \\k:\h'-(\\n(.wu*8/10-\*(#H)'\z\(sl\h'|\\n:u' .\} . \" troff and (daisy-wheel) nroff accents .ds : \\k:\h'-(\\n(.wu*8/10-\*(#H+.1m+\*(#F)'\v'-\*(#V'\z.\h'.2m+\*(#F'.\h'|\\n:u'\v'\*(#V' .ds 8 \h'\*(#H'\(*b\h'-\*(#H' .ds o \\k:\h'-(\\n(.wu+\w'\(de'u-\*(#H)/2u'\v'-.3n'\*(#[\z\(de\v'.3n'\h'|\\n:u'\*(#] .ds d- \h'\*(#H'\(pd\h'-\w'~'u'\v'-.25m'\f2\(hy\fP\v'.25m'\h'-\*(#H' .ds D- D\\k:\h'-\w'D'u'\v'-.11m'\z\(hy\v'.11m'\h'|\\n:u' .ds th \*(#[\v'.3m'\s+1I\s-1\v'-.3m'\h'-(\w'I'u*2/3)'\s-1o\s+1\*(#] .ds Th \*(#[\s+2I\s-2\h'-\w'I'u*3/5'\v'-.3m'o\v'.3m'\*(#] .ds ae a\h'-(\w'a'u*4/10)'e .ds Ae A\h'-(\w'A'u*4/10)'E . \" corrections for vroff .if v .ds ~ \\k:\h'-(\\n(.wu*9/10-\*(#H)'\s-2\u~\d\s+2\h'|\\n:u' .if v .ds ^ \\k:\h'-(\\n(.wu*10/11-\*(#H)'\v'-.4m'^\v'.4m'\h'|\\n:u' . \" for low resolution devices (crt and lpr) .if \n(.H>23 .if \n(.V>19 \ \{\ . ds : e . ds 8 ss . ds o a . ds d- d\h'-1'\(ga . ds D- D\h'-1'\(hy . ds th \o'bp' . ds Th \o'LP' . ds ae ae . ds Ae AE .\} .rm #[ #] #H #V #F C .\" ======================================================================== .\" .IX Title "PMDA 3pm" .TH PMDA 3pm "2014-04-04" "perl v5.14.2" "User Contributed Perl Documentation" .\" For nroff, turn off justification. Always turn off hyphenation; it makes .\" way too many mistakes in technical documents. .if n .ad l .nh .SH "NAME" PCP::PMDA \- Perl extension for Performance Metrics Domain Agents .SH "SYNOPSIS" .IX Header "SYNOPSIS" .Vb 1 \& use PCP::PMDA; \& \& $pmda = PCP::PMDA\->new(\*(Aqmyname\*(Aq, $MYDOMAIN); \& \& $pmda\->connect_pmcd; \& \& $pmda\->add_metric($pmid, $type, $indom, $sem, $units, \*(Aqname\*(Aq, \*(Aq\*(Aq, \*(Aq\*(Aq); \& $pmda\->add_indom($indom, [0 => \*(Aqwhite\*(Aq, 1 => \*(Aqblack\*(Aq, ...], \*(Aq\*(Aq, \*(Aq\*(Aq); \& \& $pmda\->set_fetch(\e&fetch_method); \& $pmda\->set_refresh(\e&refresh_method); \& $pmda\->set_instance(\e&instance_method); \& $pmda\->set_fetch_callback(\e&fetch_callback_method); \& $pmda\->set_store_callback(\e&store_callback_method); \& \& $pmda\->set_user(\*(Aqpcp\*(Aq); \& \& $pmda\->run; .Ve .SH "DESCRIPTION" .IX Header "DESCRIPTION" The \s-1PCP::PMDA\s0 Perl module contains the language bindings for building Performance Metric Domain Agents (PMDAs) using Perl. Each \s-1PMDA\s0 exports performance data for one specific domain, for example the operating system kernel, Cisco routers, a database, an application, etc. .SH "METHODS" .IX Header "METHODS" .IP "\s-1PCP::PMDA\-\s0>new(name, domain)" 4 .IX Item "PCP::PMDA->new(name, domain)" \&\s-1PCP::PMDA\s0 class constructor. \fIname\fR is a string that becomes the name of the \s-1PMDA\s0 for messages and default prefix for the names of external files used by the \s-1PMDA\s0. \fIdomain\fR is an integer domain number for the \s-1PMDA\s0, usually from the register of domain numbers found in \fB\f(CB$PCP_VAR_DIR\fB/pmns/stdpmid\fR. .ie n .IP "$pmda\->\fIconnect_pmcd()\fR" 4 .el .IP "\f(CW$pmda\fR\->\fIconnect_pmcd()\fR" 4 .IX Item "$pmda->connect_pmcd()" Allows the \s-1PMDA\s0 to set up the \s-1IPC\s0 channel to \fBpmcd\fR(1) and complete the credentials handshake with \fBpmcd\fR(1). If \fIconnect_pmcd\fR is not explicitly called the setup and handshake will be done when the \&\fIrun\fR method is called. .Sp The advantage of explicitly calling \fIconnect_pmcd\fR early in the life of the \s-1PMDA\s0 is that this reduces the risk of a fatal timeout during the credentials handshake, which may be an issue if the \s-1PMDA\s0 has considerable work to do, e.g. determining which metrics and instance domains are available, before calling \fIrun\fR. .ie n .IP "$pmda\->add_indom(indom, insts, help, longhelp)" 4 .el .IP "\f(CW$pmda\fR\->add_indom(indom, insts, help, longhelp)" 4 .IX Item "$pmda->add_indom(indom, insts, help, longhelp)" \&\s-1TODO\s0 .ie n .IP "$pmda\->add_metric(pmid, type, indom, sem, units, name, help, longhelp)" 4 .el .IP "\f(CW$pmda\fR\->add_metric(pmid, type, indom, sem, units, name, help, longhelp)" 4 .IX Item "$pmda->add_metric(pmid, type, indom, sem, units, name, help, longhelp)" \&\s-1TODO\s0 .ie n .IP "$pmda\->add_pipe(command, callback, data)" 4 .el .IP "\f(CW$pmda\fR\->add_pipe(command, callback, data)" 4 .IX Item "$pmda->add_pipe(command, callback, data)" \&\s-1TODO\s0 .ie n .IP "$pmda\->add_sock(hostname, port, callback, data)" 4 .el .IP "\f(CW$pmda\fR\->add_sock(hostname, port, callback, data)" 4 .IX Item "$pmda->add_sock(hostname, port, callback, data)" \&\s-1TODO\s0 .ie n .IP "$pmda\->add_tail(filename, callback, data)" 4 .el .IP "\f(CW$pmda\fR\->add_tail(filename, callback, data)" 4 .IX Item "$pmda->add_tail(filename, callback, data)" \&\s-1TODO\s0 .ie n .IP "$pmda\->add_timer(timeout, callback, data)" 4 .el .IP "\f(CW$pmda\fR\->add_timer(timeout, callback, data)" 4 .IX Item "$pmda->add_timer(timeout, callback, data)" \&\s-1TODO\s0 .ie n .IP "$pmda\->err(message)" 4 .el .IP "\f(CW$pmda\fR\->err(message)" 4 .IX Item "$pmda->err(message)" \&\s-1TODO\s0 .ie n .IP "$pmda\->error(message)" 4 .el .IP "\f(CW$pmda\fR\->error(message)" 4 .IX Item "$pmda->error(message)" \&\s-1TODO\s0 .ie n .IP "$pmda\->log(message)" 4 .el .IP "\f(CW$pmda\fR\->log(message)" 4 .IX Item "$pmda->log(message)" \&\s-1TODO\s0 .ie n .IP "$pmda\->put_sock(id, output)" 4 .el .IP "\f(CW$pmda\fR\->put_sock(id, output)" 4 .IX Item "$pmda->put_sock(id, output)" \&\s-1TODO\s0 .ie n .IP "$pmda\->replace_indom(index, insts)" 4 .el .IP "\f(CW$pmda\fR\->replace_indom(index, insts)" 4 .IX Item "$pmda->replace_indom(index, insts)" \&\s-1TODO\s0 .ie n .IP "$pmda\->set_fetch_callback(cb_function)" 4 .el .IP "\f(CW$pmda\fR\->set_fetch_callback(cb_function)" 4 .IX Item "$pmda->set_fetch_callback(cb_function)" \&\s-1TODO\s0 .ie n .IP "$pmda\->set_fetch(function)" 4 .el .IP "\f(CW$pmda\fR\->set_fetch(function)" 4 .IX Item "$pmda->set_fetch(function)" \&\s-1TODO\s0 .ie n .IP "$pmda\->set_inet_socket(port)" 4 .el .IP "\f(CW$pmda\fR\->set_inet_socket(port)" 4 .IX Item "$pmda->set_inet_socket(port)" \&\s-1TODO\s0 .ie n .IP "$pmda\->set_instance(function)" 4 .el .IP "\f(CW$pmda\fR\->set_instance(function)" 4 .IX Item "$pmda->set_instance(function)" \&\s-1TODO\s0 .ie n .IP "$pmda\->set_ipv6_socket(port)" 4 .el .IP "\f(CW$pmda\fR\->set_ipv6_socket(port)" 4 .IX Item "$pmda->set_ipv6_socket(port)" \&\s-1TODO\s0 .ie n .IP "$pmda\->set_refresh(function)" 4 .el .IP "\f(CW$pmda\fR\->set_refresh(function)" 4 .IX Item "$pmda->set_refresh(function)" \&\s-1TODO\s0 .ie n .IP "$pmda\->set_store_callback(cb_function)" 4 .el .IP "\f(CW$pmda\fR\->set_store_callback(cb_function)" 4 .IX Item "$pmda->set_store_callback(cb_function)" \&\s-1TODO\s0 .ie n .IP "$pmda\->set_unix_socket(socket_name)" 4 .el .IP "\f(CW$pmda\fR\->set_unix_socket(socket_name)" 4 .IX Item "$pmda->set_unix_socket(socket_name)" \&\s-1TODO\s0 .ie n .IP "$pmda\->set_user(username)" 4 .el .IP "\f(CW$pmda\fR\->set_user(username)" 4 .IX Item "$pmda->set_user(username)" \&\s-1TODO\s0 .SH "HELPER METHODS" .IX Header "HELPER METHODS" .IP "pmda_pmid(cluster, item)" 4 .IX Item "pmda_pmid(cluster, item)" Construct a Performance Metric Identifier (\s-1PMID\s0) from the domain number (passed as an argument to the \fInew\fR constructor), the \&\fIcluster\fR (an integer in the range 0 to 2^12\-1) and the \&\fIitem\fR (an integer in the range 0 to 2^10\-1). .Sp Every performance metric exported from a \s-1PMDA\s0 must have a unique \&\s-1PMID\s0. .IP "pmda_pmid_name(cluster, item)" 4 .IX Item "pmda_pmid_name(cluster, item)" \&\s-1TODO\s0 .IP "pmda_pmid_text(cluster, item)" 4 .IX Item "pmda_pmid_text(cluster, item)" \&\s-1TODO\s0 .IP "pmda_inst_name(index, instance)" 4 .IX Item "pmda_inst_name(index, instance)" \&\s-1TODO\s0 .IP "pmda_inst_lookup(index, instance)" 4 .IX Item "pmda_inst_lookup(index, instance)" \&\s-1TODO\s0 .IP "pmda_units(dim_space, dim_time, dim_count, scale_space, scale_time, scale_count)" 4 .IX Item "pmda_units(dim_space, dim_time, dim_count, scale_space, scale_time, scale_count)" \&\s-1TODO\s0 .IP "pmda_config(name)" 4 .IX Item "pmda_config(name)" \&\s-1TODO\s0 .IP "pmda_uptime(now)" 4 .IX Item "pmda_uptime(now)" \&\s-1TODO\s0 .IP "\fIpmda_long()\fR" 4 .IX Item "pmda_long()" \&\s-1TODO\s0 .IP "\fIpmda_ulong()\fR" 4 .IX Item "pmda_ulong()" .SH "MACROS" .IX Header "MACROS" Most of the PM_* macros from the \s-1PCP\s0 C headers are available. .PP For example the \fItype\fR of a metric's value may be directly specified as one of \&\fB\s-1PM_TYPE_32\s0\fR, \fB\s-1PM_TYPE_U32\s0\fR, \fB\s-1PM_TYPE_64\s0\fR, \fB\s-1PM_TYPE_U64\s0\fR, \&\fB\s-1PM_TYPE_FLOAT\s0\fR, \fB\s-1PM_TYPE_DOUBLE\s0\fR, \fB\s-1PM_TYPE_STRING\s0\fR or \&\fB\s-1PM_TYPE_NOSUPPORT\s0\fR. .SH "SEE ALSO" .IX Header "SEE ALSO" \&\fIperl\fR\|(1) and \fIpcpintro\fR\|(3). .PP The \s-1PCP\s0 mailing list pcp@xxxxxxxxxxx can be used for questions about this module. .PP Further details can be found at http://oss.sgi.com/projects/pcp .SH "AUTHOR" .IX Header "AUTHOR" Nathan Scott, .PP Copyright (C) 2008\-2010 by Aconex. Copyright (C) 2004 by Silicon Graphics, Inc. .PP This library is free software; you can redistribute it and/or modify it under the terms of the \s-1GNU\s0 General Public License, version 2 (see the \*(L"\s-1COPYING\s0\*(R" file in the \s-1PCP\s0 source tree for further details).