summaryrefslogtreecommitdiffstats
path: root/web/monitoring.py
blob: f74e60ac64d9d1d93915d23f9115cf934de8ea4b (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
#!/usr/bin/python3.10

import platform

def print_html(htmlfile, host_name):
    with open(htmlfile, 'r') as f:
        html = f.read()

    print(html.format(**locals()))

def get_host_name():
    host_name = platform.node()

    return host_name

def main():
    host_name = get_host_name()

    print('Content-Type: text/html\n')
    print_html('html/header.html.in', host_name)
    print_html('html/monitoring.html.in', host_name)
    print_html('html/footer.html', host_name)

    exit(0)

if __name__ == '__main__':
    main()