Beautify node stats.

Also display both rrdb fields in one graph.
alfred-data
Wilfried Klaebe 2013-11-18 10:42:32 +01:00 committed by Daniel Ehlers
parent b878028671
commit 94dba3399c
1 changed files with 10 additions and 4 deletions

12
rrd.py
View File

@ -92,10 +92,16 @@ class rrd:
subprocess.check_output(args) subprocess.check_output(args)
def createNodeGraph(self,nodePrimaryMAC,displayTimeNode): def createNodeGraph(self,nodePrimaryMAC,displayTimeNode):
nodeGraph = self.nodeMACToPNGFile(nodePrimaryMAC + '_upstate') nodeGraph = self.nodeMACToPNGFile(nodePrimaryMAC)
nodeFile = self.nodeMACToRRDFile(nodePrimaryMAC) nodeFile = self.nodeMACToRRDFile(nodePrimaryMAC)
args = ['rrdtool', 'graph', nodeGraph, '-s', '-' + self.displayTimeNode , '-w', '800', '-h' '400' args = ['rrdtool','graph', nodeGraph, '-s', '-' + self.displayTimeNode , '-w', '800', '-h', '400', '-l', '0', '-y', '1:1',
,'DEF:upstate=' + nodeFile + ':upstate:LAST', 'LINE1:upstate#F00:upstate\\l' 'DEF:clients=' + nodeFile + ':clients:LAST',
'VDEF:maxc=clients,MAXIMUM',
'CDEF:c=0,clients,ADDNAN',
'CDEF:d=clients,UN,maxc,UN,1,maxc,IF,*',
'AREA:c#0F0:up\\l',
'AREA:d#F00:down\\l',
'LINE1:c#00F:clients connected\\l',
] ]
subprocess.check_output(args) subprocess.check_output(args)