35 lines
871 B
Python
35 lines
871 B
Python
#!/usr/bin/env python3
|
|
|
|
import os
|
|
import sys
|
|
from comet_server import CometServer
|
|
|
|
def config():
|
|
print('graph_title Comet Online Devices')
|
|
print('graph_args --base 1000 -l 0 ')
|
|
print('graph_category Comet')
|
|
print('offline.label Offline')
|
|
print('offline.draw AREASTACK')
|
|
print('offline.min 0')
|
|
print('offline.colour cf4848')
|
|
print('outdated.label Online (Outdated)')
|
|
print('outdated.draw AREASTACK')
|
|
print('outdated.min 0')
|
|
print('outdated.colour fa9545')
|
|
print('online.label Online')
|
|
print('online.draw AREASTACK')
|
|
print('online.min 0')
|
|
print('online.colour 58b154')
|
|
|
|
def main():
|
|
cs = CometServer()
|
|
print("offline.value " + str(cs.countOffline()))
|
|
print("outdated.value " + str(cs.countOutdated()))
|
|
print("online.value " + str(cs.countOnline()))
|
|
|
|
if __name__ == '__main__':
|
|
if len(sys.argv) > 1 and sys.argv[1] == 'config':
|
|
config()
|
|
else:
|
|
main()
|