# Path: simple_monitor_alert/alerts.py
# class AlertBase(object):
#     def __init__(self, config, section=None):
#         self.config = config
#         self.section = section
#         self.init()
# 
#     def init(self):
#         pass
# 
# Path: simple_monitor_alert/monitor.py
# def log_evaluate(observable, result=None, use_logger=True):
#     from simple_monitor_alert.utils.system import get_hostname
#     result = result or observable.evaluate()
#     level = 'success' if result else observable.get_line_value('level') or 'warning'
#     msg = '{} - - Trigger: [{}] ({}) {}. '.format(get_hostname(), level,
#                                                   getattr(getattr(observable, 'monitor', None), 'name', '?'),
#                                            observable.get_verbose_name_group())
#     msg += ('Result: {}' if result else 'Assertion {} failed').format(get_verbose_condition(observable))
#     if observable.param_used:
#         msg += '. Param used: {}'.format(observable.param_used)
#     extra_info = observable.get_line_value('extra_info')
#     if extra_info:
#         msg += '. Extra info: {}'.format(extra_info)
#     if use_logger:
#         getattr(logger, 'info' if result else 'warning')(msg)
#     else:
#         return msg


import sys
import smtplib
from email.mime.text import MIMEText
from simple_monitor_alert.alerts import AlertBase
from simple_monitor_alert.monitor import log_evaluate
#!/usr/bin/env python


__version__ = '0.1.0'

SUPPORT_ALERT_IMPORT = True


class File(AlertBase):
    path = None

    def init(self):

# Path: simple_monitor_alert/alerts.py
# class AlertBase(object):
#     def __init__(self, config, section=None):
#         self.config = config
#         self.section = section
#         self.init()
# 
#     def init(self):
#         pass
# 
# Path: simple_monitor_alert/monitor.py
# def log_evaluate(observable, result=None, use_logger=True):
#     from simple_monitor_alert.utils.system import get_hostname
#     result = result or observable.evaluate()
#     level = 'success' if result else observable.get_line_value('level') or 'warning'
#     msg = '{} - - Trigger: [{}] ({}) {}. '.format(get_hostname(), level,
#                                                   getattr(getattr(observable, 'monitor', None), 'name', '?'),
#                                            observable.get_verbose_name_group())
#     msg += ('Result: {}' if result else 'Assertion {} failed').format(get_verbose_condition(observable))
#     if observable.param_used:
#         msg += '. Param used: {}'.format(observable.param_used)
#     extra_info = observable.get_line_value('extra_info')
#     if extra_info:
#         msg += '. Extra info: {}'.format(extra_info)
#     if use_logger:
#         getattr(logger, 'info' if result else 'warning')(msg)
#     else:
#         return msg


# Path: alerts/file.py
import sys
import smtplib
from email.mime.text import MIMEText
from simple_monitor_alert.alerts import AlertBase
from simple_monitor_alert.monitor import log_evaluate

#!/usr/bin/env python


__version__ = '0.1.0'

SUPPORT_ALERT_IMPORT = True


class File(AlertBase):
    path = None

    def init(self):

        self.path = self.config.get('path')