A user reports that pcp2graphite cannot be easily invoked from pmmgr's
'manager' facility, because pmmgr runs it thusly:
[Tue Aug 9 22:06:49] pmmgr(29205/29211): /etc/pcp/pmmgr: daemon pid 29212
started: exec pcp2graphite -g graphite1.ord1.swift.racklabs.com -P 2003
elasticsearch xfs -h local: >/var/log/pcp/pmmgr/elastic1-cab1/monitor-0.out
2>/var/log/pcp/pmmgr/elastic1-cab1/monitor-0.err
[Tue Aug 9 22:06:49] pmmgr(29205/29217): /etc/pcp/pmmgr: daemon pid 29212
found dead
^C
rferreira@elastic1-cab1:/etc/pcp/pmmgr$ cat
/var/log/pcp/pmmgr/elastic1-cab1/monitor-0.err
Excluding metric -h (PM_ERR_NAME Unknown metric name)
Excluding metric local: (PM_ERR_NAME Unknown metric name)
Usage: pcp2graphite [options] metricname ...
IOW, pmmgr puts "-h HOSTSPEC" at the end of the command line. pcp2graphite
uses pmGetNonOptionsFromList (src/python/pmapi.c code) to extract the metric
names (intended to be "elasticsearch xfs" in that example), but the "-h FOO"
part is also interpreted as a "non-option".
The pmOptions API documentation lacks coverage of the pmGetNonOptionsFromList
function call (and a number of other pmOptions calls), so it's not obvious
what's supposed to happen. Other pcp tools like pminfo(1) accept -h stuff at
the end of the command line, after metrics. IMHO the python stuff should too.