LSMS/scripts/test_alert.py

35 lines
703 B
Python
Raw Normal View History

2021-12-27 13:52:26 +01:00
#!/usr/bin/env python3
# written by sqall
# twitter: https://twitter.com/sqall01
# blog: https://h4des.org
# github: https://github.com/sqall01
#
2021-12-30 20:48:17 +01:00
# Licensed under the MIT License.
2021-12-27 13:52:26 +01:00
"""
Short summary:
If scripts are executed via cronjob, this script helps to check if the alert functions work.
Requirements:
None
"""
2022-01-05 20:16:57 +01:00
from lib.util import output_finding
2021-12-27 13:52:26 +01:00
2022-01-05 20:16:57 +01:00
# Read configuration.
2021-12-27 13:52:26 +01:00
try:
from config.config import ALERTR_FIFO, FROM_ADDR, TO_ADDR
from config.test_alert import ACTIVATED
except:
ALERTR_FIFO = None
FROM_ADDR = None
TO_ADDR = None
ACTIVATED = False
if __name__ == '__main__':
if ACTIVATED:
2022-01-05 20:16:57 +01:00
message = "Alert test."
output_finding(__file__, message)