- we have to break out the files into two separate while loops (dumb new decorator syntax breaks my old grammer) - this is the first step; its working here just fine, but i'll need to deploy it as a second docker containermaster
parent
566304f28d
commit
20e42a17dc
@ -0,0 +1,22 @@
|
||||
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()
|
Loading…
Reference in new issue