Create rrd images only on demand. Added command line switch --with-img.

master
Thomas Hooge 2015-10-30 19:31:54 +01:00
parent dcd6609030
commit ec3c414594
1 changed files with 6 additions and 3 deletions

View File

@ -155,9 +155,9 @@ def main(params):
rrd = RRD(os.path.join(script_directory, 'nodedb'), rrd = RRD(os.path.join(script_directory, 'nodedb'),
os.path.join(params['dest_dir'], 'nodes')) os.path.join(params['dest_dir'], 'nodes'))
rrd.update_database(nodedb['nodes']) rrd.update_database(nodedb['nodes'])
if params['img']:
rrd.update_images() rrd.update_images()
if __name__ == '__main__': if __name__ == '__main__':
parser = argparse.ArgumentParser() parser = argparse.ArgumentParser()
@ -166,7 +166,7 @@ if __name__ == '__main__':
nargs='+', default=[], metavar='FILE') nargs='+', default=[], metavar='FILE')
parser.add_argument('-m', '--mesh', parser.add_argument('-m', '--mesh',
default=['bat0'], nargs='+', default=['bat0'], nargs='+',
help='Use given batman-adv mesh interface(s) (defaults' help='Use given batman-adv mesh interface(s) (defaults '
'to bat0); specify alfred unix socket like ' 'to bat0); specify alfred unix socket like '
'bat0:/run/alfred0.sock.') 'bat0:/run/alfred0.sock.')
parser.add_argument('-d', '--dest-dir', action='store', parser.add_argument('-d', '--dest-dir', action='store',
@ -177,6 +177,9 @@ if __name__ == '__main__':
parser.add_argument('-p', '--prune', metavar='DAYS', type=int, parser.add_argument('-p', '--prune', metavar='DAYS', type=int,
help='forget nodes offline for at least DAYS') help='forget nodes offline for at least DAYS')
parser.add_argument('--with-rrd', dest='rrd', action='store_true', parser.add_argument('--with-rrd', dest='rrd', action='store_true',
default=False,
help='enable the collection of RRD data')
parser.add_argument('--with-img', dest='img', action='store_true',
default=False, default=False,
help='enable the rendering of RRD graphs (cpu ' help='enable the rendering of RRD graphs (cpu '
'intensive)') 'intensive)')