Commit 0ceb4ff5 authored by Jonathan Michalon's avatar Jonathan Michalon
Browse files

Add report feature

parent 50fcd4eb
......@@ -113,3 +113,6 @@ def send_email_for_check(check):
_send_email(subject, msg_text, extra_headers)
def send_email_report(text):
from . import config
_send_email(, text)
......@@ -30,11 +30,20 @@ def usr1_handler(signum, frame):
print ("Signal SIGUSR1 caught, printing state of checks.")
print (report)
def alarm_handler(signum, frame):
(report, err) = create_report()
if err:
if __name__ == '__main__':
# register signal handling
signal.signal(signal.SIGUSR1, usr1_handler)
signal.signal(signal.SIGALRM, alarm_handler)
# register report signal interval
if > 0:
signal.setitimer(signal.ITIMER_REAL, 60,
# Parse command line
parser = argparse.ArgumentParser()
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment