manage.py 560 Bytes
Newer Older
1
import sys
Gregory Nagy committed
2 3 4
from src import cnfparse
from src import client
from src.collectables import collectables
5

6

7
def main():
Bach Dániel committed
8 9 10 11 12
    if len(sys.argv) < 2:
        print("usage: manage.py run [options]")
    if len(sys.argv) is not 2 and sys.argv[1] is not "run":
        print("[ERROR] Command cannot be parsed. Exiting...")
        return
Gregory Nagy committed
13
    configuration, metrics = cnfparse.import_conf("config/client.conf")
Bach Dániel committed
14
    cli = client.Client(configuration)
Gregory Nagy committed
15 16
    metricCollectors = collectables.provide(metrics)
    cli.run(metricCollectors)
17 18 19


if __name__ == "__main__":
Bach Dániel committed
20
    main()