예제 #1
0
import json
from pprint import pprint
from os import getcwd, path, makedirs
from datetime import datetime, timedelta
import sys

my_config = "config.yaml"
if len(sys.argv)>1:
    my_config = sys.argv[1]

if not path.exists(my_config):
    print(f"Файл конфігугації {my_config} не знайдено.")
    exit()

# load config from file config.yaml
config = cl.load_config(my_config)

# debug print
debug = config['debug'] or False;

# select list of hosts
hosts = config['hosts']

# domain loop
for domain in hosts.keys():
    print(domain) if debug else None
    # insert here check_domain
    result = {}
    # select list of checks for host
    check_arr = hosts[domain]
예제 #2
0
import monitoring.config_loader as cl
from pprint import pprint

config = cl.load_config()

pprint(config)