summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorroot <root@pigstarter.retiolum>2013-06-24 18:10:37 +0200
committerroot <root@pigstarter.retiolum>2013-06-24 18:10:37 +0200
commit9a05e52543b10a1ad64534b11164e7df051adf7e (patch)
tree6eff383ee10a4c9034555612ae9cadfe0004e1f4
parent33483e844e508a4b256ab06d9096d1e7f580643b (diff)
fix broken graphite submodule
-rw-r--r--retiolum/scripts/adv_graphgen/tinc_stats/Graphite.py12
1 files changed, 10 insertions, 2 deletions
diff --git a/retiolum/scripts/adv_graphgen/tinc_stats/Graphite.py b/retiolum/scripts/adv_graphgen/tinc_stats/Graphite.py
index ee01a02b..5002d8e5 100644
--- a/retiolum/scripts/adv_graphgen/tinc_stats/Graphite.py
+++ b/retiolum/scripts/adv_graphgen/tinc_stats/Graphite.py
@@ -12,5 +12,13 @@ class GraphiteSender:
self.sock.connect((host,port))
def send(name,data):
- from time import time
- self.sock.send("%s.%s %d %d\r\n"%self.prefix,data,time())
+ # construct a message for graphite, honor the configured prefix
+ self.sock.send("%s.%s %d %d\r\n"%(self.prefix,name,data,time()))
+
+ def send_raw(path,data):
+ #ignore the configured prefix, just it to the path given
+ self.sock.send("%s %d %d\r\n"%(path,data,time()))
+
+if __name__ == "__main__":
+ import sys
+ GraphiteSender(sys.argv[1]).send_raw(sys.argv[2],sys.argv[3])