29 lines
613 B
Python
29 lines
613 B
Python
#!/usr/bin/env python3
|
|
|
|
import os
|
|
import sys
|
|
from comet_server import CometServer
|
|
|
|
def config():
|
|
cs = CometServer()
|
|
onlineCheck = cs.checkOnline()
|
|
print('graph_title Comet Uptime')
|
|
print('graph_args --base 1000 -l 0 ')
|
|
print('graph_category Comet')
|
|
print('online.label Online')
|
|
print('online.draw AREA')
|
|
print('online.min 0')
|
|
if onlineCheck == 1:
|
|
print('online.colour 58b154')
|
|
else:
|
|
print('online.colour cf4848')
|
|
|
|
def main():
|
|
cs = CometServer()
|
|
print("online.value " + str(cs.checkOnline()))
|
|
|
|
if __name__ == '__main__':
|
|
if len(sys.argv) > 1 and sys.argv[1] == 'config':
|
|
config()
|
|
else:
|
|
main() |