commit
b136bbeb5a
|
@ -27,6 +27,7 @@ output = []
|
|||
|
||||
# Functions
|
||||
|
||||
|
||||
def calculate_count(data):
|
||||
count = {}
|
||||
ls = data.values()
|
||||
|
@ -78,6 +79,7 @@ def getMonit():
|
|||
|
||||
# Classes
|
||||
|
||||
|
||||
class monitDashboard(web.application):
|
||||
def run(self, port=8080, *middleware):
|
||||
func = self.wsgifunc(*middleware)
|
||||
|
@ -89,10 +91,12 @@ class index(object):
|
|||
return render.index(output=getMonit(),
|
||||
now=datetime.datetime.now())
|
||||
|
||||
|
||||
class help(object):
|
||||
def GET(self):
|
||||
return render.help()
|
||||
|
||||
|
||||
class download(object):
|
||||
def GET(self):
|
||||
filename = 'health_report.xlsx'
|
||||
|
@ -104,6 +108,7 @@ class download(object):
|
|||
web.header('Cache-Control', 'no-cache')
|
||||
return open(filename, 'rb').read()
|
||||
|
||||
|
||||
# Main
|
||||
if __name__ == "__main__":
|
||||
app = monitDashboard(urls, globals())
|
||||
|
|
|
@ -1,6 +1,7 @@
|
|||
import xlsxwriter
|
||||
import os
|
||||
|
||||
|
||||
def generate_report_excel(output, filename):
|
||||
if os.path.exists(filename):
|
||||
os.remove(filename)
|
||||
|
|
|
@ -84,7 +84,9 @@ $for server in range(len(output)):
|
|||
|
||||
<div class="canvas-container">
|
||||
<div class="canvas-graph">
|
||||
<div class="canvas-header"><h2 style="margin: 0">Hosts status</h2></div>
|
||||
<div class="canvas-header">
|
||||
<h2 style="margin: 0">Hosts status</h2>
|
||||
</div>
|
||||
<canvas id="canvas" width="400" height="400"></canvas>
|
||||
</div>
|
||||
</div>
|
||||
|
|
Loading…
Reference in a new issue