Set force_notify in log check error cases
This commit is contained in:
parent
1349440251
commit
bc3e72726e
|
@ -54,13 +54,13 @@ async def check_journal():
|
||||||
std_out, std_err = proc.communicate()
|
std_out, std_err = proc.communicate()
|
||||||
|
|
||||||
if len(std_err) > 0:
|
if len(std_err) > 0:
|
||||||
await send_msg(client, "Error reading journalctl output: {}".format(std_err))
|
await send_msg(client, "Error reading journalctl output: {}".format(std_err), force_notify=True)
|
||||||
return
|
return
|
||||||
|
|
||||||
# If there are any critical errors. upload the whole log file.
|
# If there are any critical errors. upload the whole log file.
|
||||||
if "Critical" in std_out:
|
if "Critical" in std_out:
|
||||||
upload_name = "{}-{}-{}-{}-{}:{}:{}.log".format(service_name, time.year, time.month, time.day, time.hour, time.minute, time.second)
|
upload_name = "{}-{}-{}-{}-{}:{}:{}.log".format(service_name, time.year, time.month, time.day, time.hour, time.minute, time.second)
|
||||||
await send_msg(client, "Critical error found in log!", file=discord.File(io.BytesIO(std_out.encode()), filename=upload_name))
|
await send_msg(client, "Critical error found in log!", file=discord.File(io.BytesIO(std_out.encode()), filename=upload_name), force_notify=True)
|
||||||
return
|
return
|
||||||
|
|
||||||
# No critical errors, return a heartbeat type message.
|
# No critical errors, return a heartbeat type message.
|
||||||
|
|
Reference in New Issue