# Path: Database/db_controller.py
# class db_settings():
# class SettingsHelper(db_settings):
# class db_access(SettingsHelper, object):
# class db_helper(db_access):
#     USERNAME = 'postgres'
#     DB_HOST = '127.0.0.1'
#     PORT = 5432
#     DATABASE = 'network_monitor'
#     SETTINGS_FILE_PATH = "database_settings.json"
#     KEYRING_APP_ID = 'NetworkMonitor_db'
#         DB_HOST = raw_input('({0})>'.format(self.DB_HOST))
#     def loadSettings(cls):
#     def saveSettings(cls):
#     def __init__(self):
#     def open_connection(self):
#     def close_connection(connection, cursor):
#     def __init__(self):
#     def __create_database(self):
#     def __create_tables(self):
#     def test_db_setup(self):
#     def configure(self):
#     def clear_password_store(self):
# 
# Path: Database/db_helpers.py
# class server_stats(object):
# class email_log(object):
# class monitor_list(object):
#     class tcp():
#     class host():
#     class url():
#     def failures_in_x_minutes_ago(last_x_minutes_of_failures):
#     def log_email_sent(to_list):
#     def email_sent_x_minutes_ago():
#     def get_server_list():
#     def get_time_from_last_failure():
#     def log_service_down(server_logger_obj):
#     def remove_server_from_monitor_list(index_to_remove):
#         def __init__(self):
#         def create_server(ip_address, port, note=None):
#         def __init__(self):
#         def create_server(ip_address, note=None):
#         def __init__(self):
#         def create_server(web_url, note=None):
# 
# Path: Monitors/network.py
# class MonitorHTTP():
# class MonitorTCP():
# class MonitorHost():
#     def __init__(self, url, timeout):
#     def run_test(self):
#     def describe(self):
#     def __init__(self, host, port, timeout):
#     def run_test(self):
#     def describe(self):
#     def get_params(self):
#     def __init__(self, host, timeout):
#     def run_test(self):
#     def describe(self):
# 
# Path: Database/db_monitor_list.py
# def check_for_valid_service_type():
# def get_print_server_list():
# def config_monitor_list():
# 
# Path: Alerters/email_controller.py
# class gmailSettings():
# class SettingsHelper(gmailSettings):
# class send_gmail(object, SettingsHelper):
#     USERNAME = ""
#     SEND_ALERT_TO = []  # Must be a list
#     SETTINGS_FILE_PATH = "email_settings.json"
#     KEYRING_APP_ID = 'NetworkMonitor_email'
#     def loadSettings(cls):
#     def saveSettings(cls):
#     def __init__(self):
#     def test_login(self):
#     def send(self, subject, text):
#     def convert_to_list_to_csv(self):
#     def configure(self):
#     def clear_password_store(self):
# 
# Path: Alerters/email_alerts.py
# class email_actions():
#     def __init__(self):
#     def send_alert(server_info_object):
#     def parse_url_info(url_in):
#     def generate_fail_table(fail_list_in, monitor_list_in):
#     def generate_report():


import sys
import os
import logging
import argparse
from time import sleep
from Database import db_controller
from Database import db_helpers
from Monitors import network
from Database import db_monitor_list
from Alerters import email_controller
from Alerters import email_alerts
                        action="store_true",
                        help="Debug Mode Logging")
    args = parser.parse_args()

    if args.debug:
        logging.basicConfig(format="[%(asctime)s] [%(levelname)8s] --- %(message)s (%(filename)s:%(lineno)s)",
                            level=logging.DEBUG)
        logging.debug(sys.path)
        logging.debug(args)
        logging.debug('Debug Mode Enabled')
    else:
        logging.basicConfig(filename=LOG_FILENAME,
                            format="[%(asctime)s] [%(levelname)8s] --- %(message)s (%(filename)s:%(lineno)s)",
                            level=logging.WARNING)

    mode = modes(sleep_delay=args.delay, alert_timeout=args.alert_timeout, host_timeout=args.host_timeout)
    # Create new mode object for flow, I'll buy that :)

    if len(sys.argv) == 1:  # Displays help and lists servers (to help first time users)
        parser.print_help()
        sys.exit(1)

    # Arg Logic here
    if args.list:
        db_monitor_list.get_print_server_list()

    if args.config_monitors:
        db_monitor_list.config_monitor_list()

    if args.config_db:

# Path: Database/db_controller.py
# class db_settings():
# class SettingsHelper(db_settings):
# class db_access(SettingsHelper, object):
# class db_helper(db_access):
#     USERNAME = 'postgres'
#     DB_HOST = '127.0.0.1'
#     PORT = 5432
#     DATABASE = 'network_monitor'
#     SETTINGS_FILE_PATH = "database_settings.json"
#     KEYRING_APP_ID = 'NetworkMonitor_db'
#         DB_HOST = raw_input('({0})>'.format(self.DB_HOST))
#     def loadSettings(cls):
#     def saveSettings(cls):
#     def __init__(self):
#     def open_connection(self):
#     def close_connection(connection, cursor):
#     def __init__(self):
#     def __create_database(self):
#     def __create_tables(self):
#     def test_db_setup(self):
#     def configure(self):
#     def clear_password_store(self):
# 
# Path: Database/db_helpers.py
# class server_stats(object):
# class email_log(object):
# class monitor_list(object):
#     class tcp():
#     class host():
#     class url():
#     def failures_in_x_minutes_ago(last_x_minutes_of_failures):
#     def log_email_sent(to_list):
#     def email_sent_x_minutes_ago():
#     def get_server_list():
#     def get_time_from_last_failure():
#     def log_service_down(server_logger_obj):
#     def remove_server_from_monitor_list(index_to_remove):
#         def __init__(self):
#         def create_server(ip_address, port, note=None):
#         def __init__(self):
#         def create_server(ip_address, note=None):
#         def __init__(self):
#         def create_server(web_url, note=None):
# 
# Path: Monitors/network.py
# class MonitorHTTP():
# class MonitorTCP():
# class MonitorHost():
#     def __init__(self, url, timeout):
#     def run_test(self):
#     def describe(self):
#     def __init__(self, host, port, timeout):
#     def run_test(self):
#     def describe(self):
#     def get_params(self):
#     def __init__(self, host, timeout):
#     def run_test(self):
#     def describe(self):
# 
# Path: Database/db_monitor_list.py
# def check_for_valid_service_type():
# def get_print_server_list():
# def config_monitor_list():
# 
# Path: Alerters/email_controller.py
# class gmailSettings():
# class SettingsHelper(gmailSettings):
# class send_gmail(object, SettingsHelper):
#     USERNAME = ""
#     SEND_ALERT_TO = []  # Must be a list
#     SETTINGS_FILE_PATH = "email_settings.json"
#     KEYRING_APP_ID = 'NetworkMonitor_email'
#     def loadSettings(cls):
#     def saveSettings(cls):
#     def __init__(self):
#     def test_login(self):
#     def send(self, subject, text):
#     def convert_to_list_to_csv(self):
#     def configure(self):
#     def clear_password_store(self):
# 
# Path: Alerters/email_alerts.py
# class email_actions():
#     def __init__(self):
#     def send_alert(server_info_object):
#     def parse_url_info(url_in):
#     def generate_fail_table(fail_list_in, monitor_list_in):
#     def generate_report():


# Path: Network_Monitor.py
import sys
import os
import logging
import argparse
from time import sleep
from Database import db_controller
from Database import db_helpers
from Monitors import network
from Database import db_monitor_list
from Alerters import email_controller
from Alerters import email_alerts

                        action="store_true",
                        help="Debug Mode Logging")
    args = parser.parse_args()

    if args.debug:
        logging.basicConfig(format="[%(asctime)s] [%(levelname)8s] --- %(message)s (%(filename)s:%(lineno)s)",
                            level=logging.DEBUG)
        logging.debug(sys.path)
        logging.debug(args)
        logging.debug('Debug Mode Enabled')
    else:
        logging.basicConfig(filename=LOG_FILENAME,
                            format="[%(asctime)s] [%(levelname)8s] --- %(message)s (%(filename)s:%(lineno)s)",
                            level=logging.WARNING)

    mode = modes(sleep_delay=args.delay, alert_timeout=args.alert_timeout, host_timeout=args.host_timeout)
    # Create new mode object for flow, I'll buy that :)

    if len(sys.argv) == 1:  # Displays help and lists servers (to help first time users)
        parser.print_help()
        sys.exit(1)

    # Arg Logic here
    if args.list:
        db_monitor_list.get_print_server_list()

    if args.config_monitors:
        db_monitor_list.config_monitor_list()

    if args.config_db:

        db_controller.db_helper().configure()