pcp
[Top] [All Lists]

[PATCH] Enable -L (Local PMDA mode) in pcp2graphite

To: pcp developers <pcp@xxxxxxxxxxx>
Subject: [PATCH] Enable -L (Local PMDA mode) in pcp2graphite
From: Marko Myllynen <myllynen@xxxxxxxxxx>
Date: Mon, 14 Sep 2015 09:53:52 +0300
Delivered-to: pcp@xxxxxxxxxxx
Organization: Red Hat
Reply-to: myllynen@xxxxxxxxxx
User-agent: Mozilla/5.0 (X11; Linux x86_64; rv:38.0) Gecko/20100101 Thunderbird/38.2.0
Also adjust its man page accordingly.
---
 man/man1/pcp2graphite.1          | 9 +++++----
 src/pcp2graphite/pcp2graphite.py | 4 ++--
 2 files changed, 7 insertions(+), 6 deletions(-)

diff --git a/man/man1/pcp2graphite.1 b/man/man1/pcp2graphite.1
index 7bad722..57401fa 100644
--- a/man/man1/pcp2graphite.1
+++ b/man/man1/pcp2graphite.1
@@ -7,6 +7,7 @@
 .B pcp2graphite
 [\f3\-h\f1 \f2HOST\f1]
 [\f3\-a\f1 \f2ARCHIVE\f1]
+[\f3\-L\f1]
 [\f3\-O\f1 \f2TIMEORIGIN\f1]
 [\f3\-T\f1 \f2TIMEFINISH\f1]
 [\f3\-s\f1 \f2SAMPLES\f1]
@@ -68,15 +69,15 @@ WantedBy=multi\-user\&.target
 Extract metrics from given PMCD server.
 Default \f2local:\f1.
 
-." .TP
-." .B \-L
-." Extract metrics from the local context PCP PMDAs.
-."
 .TP
 .B \-a ARCHIVE
 Extract metrics from given archive.
 
 .TP
+.B \-L
+Extract metrics from the local context PCP PMDAs.
+
+.TP
 .B \-t DELTA
 Specify the polling interval in seconds.  If live, polling is aligned to
 natural multiples of this interval.  Default \f260\f1
diff --git a/src/pcp2graphite/pcp2graphite.py b/src/pcp2graphite/pcp2graphite.py
index 5484512..eae005b 100644
--- a/src/pcp2graphite/pcp2graphite.py
+++ b/src/pcp2graphite/pcp2graphite.py
@@ -48,7 +48,7 @@ class GraphiteRelay(object):
         self.sampleCount = 0
         self.debug = False
         self.opts = pmapi.pmOptions()
-        self.opts.pmSetShortOptions("a:O:s:T:g:p:P:u:m:t:h:t:D:V?") # must 
include common options
+        self.opts.pmSetShortOptions("a:O:s:T:g:p:P:u:m:t:h:t:D:LV?") # must 
include common options
         self.opts.pmSetShortUsage("[options] metricname ...")
         self.opts.pmSetOptionCallback(self.option)
         self.opts.pmSetOverrideCallback(self.option_override)
@@ -66,7 +66,7 @@ Options""")
         self.opts.pmSetLongOptionFinish() # -T NUMBER
         self.opts.pmSetLongOptionDebug() # -D stuff
         self.opts.pmSetLongOptionHost() # -h HOST
-        # self.opts.pmSetLongOptionLocalPMDA() # -L ... no workie in pmapi.py?
+        self.opts.pmSetLongOptionLocalPMDA() # -L
         self.opts.pmSetLongOptionInterval() # -t NUMBER
         self.opts.pmSetLongOption("graphite-host", 1, 'g', '', "graphite 
server host (default \"localhost\")")
         self.opts.pmSetLongOption("pickled-port", 1, 'p', '', "graphite 
pickled port (default 2004)")

Thanks,

-- 
Marko Myllynen

<Prev in Thread] Current Thread [Next in Thread>