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()
@ -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)')