You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

23 lines
551 B

import slack
import pdb
import re
import time
from pathlib import Path
import os
def react_to_monitoring():
results_file = Path("/shared/alerts.log")
does_file_exist = results_file.is_file()
if results_file.is_file():
open_file = open("/shared/alerts.log","r")
for line in open_file:
webclient.chat_postMessage(
channel = channel_id,
text = line
)
os.remove("/shared/alerts.log")
if __name__ == '__main__':
while True:
react_to_monitoring()