Fixed filenames
This commit is contained in:
parent
999a24c632
commit
1c86aa4fe3
12
update.py
12
update.py
|
@ -69,10 +69,12 @@ def update_database(line):
|
||||||
rrdtool.update(ARCHIVE_DATA_FILE, line)
|
rrdtool.update(ARCHIVE_DATA_FILE, line)
|
||||||
|
|
||||||
def update_graphs():
|
def update_graphs():
|
||||||
for name, lines in GRAPHS.items():
|
for graph_name, lines in GRAPHS.items():
|
||||||
|
|
||||||
# Render current data
|
# Render current data
|
||||||
graph_params = ['%s.png' % name, '-a', 'PNG', '-s', 'n-%d' % ARCHIVE_INTERVAL]
|
graph_params = ['%s.png' % graph_name, '-a',
|
||||||
|
'PNG', '-s', 'n-%d' % ARCHIVE_INTERVAL]
|
||||||
|
|
||||||
for name, lable, color in lines:
|
for name, lable, color in lines:
|
||||||
graph_params += ['DEF:%s=%s:%s:LAST' % (name, DATA_FILE, name)]
|
graph_params += ['DEF:%s=%s:%s:LAST' % (name, DATA_FILE, name)]
|
||||||
graph_params += ['LINE1:%s%s:%s' % (name, color, lable)]
|
graph_params += ['LINE1:%s%s:%s' % (name, color, lable)]
|
||||||
|
@ -80,7 +82,8 @@ def update_graphs():
|
||||||
rrdtool.graph(*graph_params)
|
rrdtool.graph(*graph_params)
|
||||||
|
|
||||||
# Also render Archives
|
# Also render Archives
|
||||||
graph_params = ['%s_archive.png' % name, '-a', 'PNG', '-s', 'n-%d' % ARCHIVE_KEEP_INTERVAL]
|
graph_params = ['%s_archive.png' % graph_name, '-a',
|
||||||
|
'PNG', '-s', 'n-%d' % ARCHIVE_KEEP_INTERVAL]
|
||||||
|
|
||||||
for name, lable, color in lines:
|
for name, lable, color in lines:
|
||||||
graph_params += ['DEF:%s=%s:%s:AVERAGE' % (name, DATA_FILE, name)]
|
graph_params += ['DEF:%s=%s:%s:AVERAGE' % (name, DATA_FILE, name)]
|
||||||
|
@ -101,10 +104,11 @@ def upload_graphs():
|
||||||
sftp.put('%s.png' % name, 'solar/%s.png' % name)
|
sftp.put('%s.png' % name, 'solar/%s.png' % name)
|
||||||
sftp.put('%s_archive.png' % name, 'solar/%s_archive.png' % name)
|
sftp.put('%s_archive.png' % name, 'solar/%s_archive.png' % name)
|
||||||
|
|
||||||
|
sftp.put('index.html', 'solar/index.html')
|
||||||
sftp.close()
|
sftp.close()
|
||||||
transport.close()
|
transport.close()
|
||||||
except:
|
except:
|
||||||
print("Unexpected error uploading:", sys.exc_info()[1])
|
print("Unexpected error while uploading:", sys.exc_info()[1])
|
||||||
|
|
||||||
def main():
|
def main():
|
||||||
pass
|
pass
|
||||||
|
|
Loading…
Reference in New Issue