aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorroot <root@freifunk.in-kiel.de>2014-02-15 22:49:20 +0100
committerroot <root@freifunk.in-kiel.de>2014-02-15 22:49:20 +0100
commitf449e93a0eff7b74059ae52d2371c493ef50bbdf (patch)
tree7d01817355272768cb7be1d06e575218256adad6
parentcad3827d0db018d70241d6ec9d7250845ff7ee8d (diff)
parent791947234c9cb1d444170f8e03111981aefdab08 (diff)
Merge remote-tracking branch 'ffnord/master'
Conflicts: bat2nodes.py mkmap.sh
-rwxr-xr-xbat2nodes.py8
-rwxr-xr-xmkmap.sh10
-rwxr-xr-xrrd.py28
3 files changed, 23 insertions, 23 deletions
diff --git a/bat2nodes.py b/bat2nodes.py
index 26611ec..9e37644 100755
--- a/bat2nodes.py
+++ b/bat2nodes.py
@@ -77,10 +77,6 @@ if options['obscure']:
scriptdir = os.path.dirname(os.path.realpath(__file__))
-rrd = rrd(scriptdir + "/nodedb/", options['destination_directory'] + "/nodes")
-rrd.update_database(db)
-#rrd.update_images()
-
m = D3MapBuilder(db)
#Write nodes json
@@ -90,3 +86,7 @@ nodes_json.close()
#Move to destination
os.rename(options['destination_directory'] + '/nodes.json.new',options['destination_directory'] + '/nodes.json')
+
+rrd = rrd(scriptdir + "/nodedb/", options['destination_directory'] + "/nodes")
+rrd.update_database(db)
+#rrd.update_images()
diff --git a/mkmap.sh b/mkmap.sh
index 75340e6..e503a5e 100755
--- a/mkmap.sh
+++ b/mkmap.sh
@@ -2,9 +2,11 @@
DEST="$1"
-[ -n "$DEST" ] || exit 1
+[ "$DEST" ] || exit 1
-#"$(dirname "$0")"/ffhlwiki.py http://freifunk.metameute.de/wiki/Knoten > "$(dirname "$0")"/aliases_hl.json
-#"$(dirname "$0")"/ffhlwiki.py http://freifunk.metameute.de/wiki/Moelln:Knoten > "$(dirname "$0")"/aliases_moelln.json
+cd "$(dirname "$0")"/
-"$(dirname "$0")"/bat2nodes.py -a "$(dirname "$0")"/aliases.json -A -d $DEST
+#./ffhlwiki.py http://freifunk.metameute.de/wiki/Knoten > aliases_hl.json
+#./ffhlwiki.py http://freifunk.metameute.de/wiki/Moelln:Knoten > aliases_moelln.json
+
+./bat2nodes.py -A -a aliases.json -a aliases_hl.json -a aliases_moelln.json -d $DEST
diff --git a/rrd.py b/rrd.py
index cde7727..8aba12c 100755
--- a/rrd.py
+++ b/rrd.py
@@ -34,14 +34,11 @@ class rrd:
,'--step' , '60'
# Number of nodes available
,'DS:nodes:GAUGE:120:0:U'
- ,'RRA:LAST:0:1:44640'
- ,'RRA:LAST:0:60:744'
- ,'RRA:LAST:0:1440:1780'
# Number of client available
,'DS:clients:GAUGE:120:0:U'
- ,'RRA:LAST:0:1:44640'
- ,'RRA:LAST:0:60:744'
- ,'RRA:LAST:0:1440:1780'
+ ,'RRA:AVERAGE:0.5:1:120'
+ ,'RRA:AVERAGE:0.5:60:744'
+ ,'RRA:AVERAGE:0.5:1440:1780'
]
subprocess.call(args)
@@ -58,8 +55,8 @@ class rrd:
def createGlobalGraph(self):
nodeGraph = self.imagePath + "/" + "globalGraph.png"
args = ["rrdtool", 'graph', nodeGraph, '-s', '-' + self.displayTimeGlobal, '-w', '800', '-h' '400'
- ,'DEF:nodes=' + self.globalDbFile + ':nodes:LAST', 'LINE1:nodes#F00:nodes\\l'
- ,'DEF:clients=' + self.globalDbFile + ':clients:LAST','LINE2:clients#00F:clients'
+ ,'DEF:nodes=' + self.globalDbFile + ':nodes:AVERAGE', 'LINE1:nodes#F00:nodes\\l'
+ ,'DEF:clients=' + self.globalDbFile + ':clients:AVERAGE','LINE2:clients#00F:clients'
]
subprocess.check_output(args)
@@ -78,10 +75,11 @@ class rrd:
,'--start',str(round(self.currentTimeInt - 60))
,'--step' , '60'
,'DS:upstate:GAUGE:120:0:1'
- ,'RRA:LAST:0:1:44640'
- # Number of client available
- ,'DS:clients:GAUGE:120:0:U'
- ,'RRA:LAST:0:1:44640'
+ ,'DS:clients:GAUGE:120:0:200'
+ ,'RRA:AVERAGE:0.5:1:120'
+ ,'RRA:AVERAGE:0.5:5:1440'
+ ,'RRA:AVERAGE:0.5:60:720'
+ ,'RRA:AVERAGE:0.5:720:730'
]
subprocess.check_output(args)
@@ -95,11 +93,11 @@ class rrd:
]
subprocess.check_output(args)
- def createNodeGraph(self,nodePrimaryMAC,displayTimeNode):
+ def createNodeGraph(self,nodePrimaryMAC):
nodeGraph = self.nodeMACToPNGFile(nodePrimaryMAC)
nodeFile = self.nodeMACToRRDFile(nodePrimaryMAC)
args = ['rrdtool','graph', nodeGraph, '-s', '-' + self.displayTimeNode , '-w', '800', '-h', '400', '-l', '0', '-y', '1:1',
- 'DEF:clients=' + nodeFile + ':clients:LAST',
+ 'DEF:clients=' + nodeFile + ':clients:AVERAGE',
'VDEF:maxc=clients,MAXIMUM',
'CDEF:c=0,clients,ADDNAN',
'CDEF:d=clients,UN,maxc,UN,1,maxc,IF,*',
@@ -149,4 +147,4 @@ class rrd:
nodeName = os.path.basename(fileName).split('.')
if nodeName[1] == 'rrd' and not nodeName[0] == "nodes":
- self.createNodeGraph(nodeName[0],self.displayTimeNode)
+ self.createNodeGraph(nodeName[0])