Bug fixes
Sapan Bhatia [Fri, 25 Oct 2013 18:48:28 +0000 (14:48 -0400)]
aggmgr.py
input.yaml
rrdaggregate.py

index 2ac74bb..9d82543 100644 (file)
--- a/aggmgr.py
+++ b/aggmgr.py
@@ -2,7 +2,7 @@ import yaml
 import os
 import re
 
-FIND_PATH='/usr/bin/find'
+FIND_PATH='find'
 
 class AggManager:
        def __init__(self, program):
@@ -53,7 +53,7 @@ class AggManager:
 
                                self.cdefs.append('CDEF:%s=%s'%(xvar,','.join(psexp)))
                                i1+=1
-                               self.xports.append('XPORT:%s:"%s"'%(xvar,xvar))
+                               self.xports.append('XPORT:%s:"%s"'%(xvar,k))
                                
                        
 
index ae1ad88..831ae1e 100644 (file)
@@ -3,7 +3,7 @@ output: json
 
 entries:
 - name: princeton_per_node_cpu
-  regex: (node\d+\.princeton\.vicci\.org)/cpu-\d+/cpu-idle.rrd
+  regex: (node28\.princeton\.vicci\.org)/cpu-\d+/cpu-idle.rrd
   ds: value
   fn: sum
 
index 0eca368..4e396b0 100755 (executable)
@@ -13,7 +13,7 @@ def main():
        parser = argparse.ArgumentParser()
        parser.add_argument('-datadir',help='Directory location of your rrd files',default='/usr/var/lib/collectd/rrd')
        parser.add_argument('-rrdopts',help='Option string passed verbatim to rrdtool',default='--start now-1h --end now --json')
-       parser.add_argument('-print',help='Debug only',default='No',action='store_true')
+       parser.add_argument('-pretend',help='Debug only',default=False,action='store_true')
        parser.add_argument('program',help='Program in YAML that specifies the required aggregation.')
        values = parser.parse_args()
 
@@ -27,8 +27,11 @@ def main():
        cmdline = """
        rrdtool xport %(verbatim)s %(defs)s %(cdefs)s %(xports)s
        """%options
-       os.system(cmdline)
-       #print cmdline
+
+       if (not values.pretend):
+               os.system(cmdline)
+       else:
+               print cmdline