32 lines
802 B
Python
32 lines
802 B
Python
#!/usr/bin/env python3
|
|
|
|
import os
|
|
import sys
|
|
from comet_server import CometServer
|
|
|
|
def config():
|
|
print('graph_title Comet Server History')
|
|
print('graph_args --base 1000')
|
|
print('graph_category Comet')
|
|
print('buckets.label Storage buckets')
|
|
print('buckets.colour 4d98d7')
|
|
print('users.label Users')
|
|
print('users.colour cf4848')
|
|
print('devices.label Devices')
|
|
print('devices.colour 58b154')
|
|
print('boosters.label Boosters')
|
|
print('boosters.colour a561d3')
|
|
|
|
def main():
|
|
cs = CometServer()
|
|
print("buckets.value " + str(cs.countBuckets()))
|
|
print("users.value " + str(cs.countUsers()))
|
|
print("devices.value " + str(cs.countDevices()))
|
|
print("boosters.value " + str(cs.countBoosters()))
|
|
|
|
if __name__ == '__main__':
|
|
if len(sys.argv) > 1 and sys.argv[1] == 'config':
|
|
config()
|
|
else:
|
|
main()
|