From: Guillaume Pellerin Date: Wed, 13 Mar 2024 11:25:21 +0000 (+0100) Subject: send all messages, fix monitor message X-Git-Tag: 3.0.1~4 X-Git-Url: https://git.parisson.com/?a=commitdiff_plain;h=cb5102f48da5f17e1bcd9cc43db05523f0d2b0e8;p=telecaster-server.git send all messages, fix monitor message --- diff --git a/bin/monitoring/check_telecaster.py b/bin/monitoring/check_telecaster.py index 49118cd..b2dfe50 100755 --- a/bin/monitoring/check_telecaster.py +++ b/bin/monitoring/check_telecaster.py @@ -56,7 +56,9 @@ class TelecasterCheck: for daemon in self.daemons: if not self.get_pid(daemon['proc'], args=daemon['args']): self.is_up = False - self.message += daemon['proc'] + " " + daemon['args'] + " is OFF" + "\n" + self.message += daemon['proc'] + " " + daemon['args'] + " is OFF" + " - " + else: + self.message += daemon['proc'] + " " + daemon['args'] + " is ON" + " - " def check_writing(self): for record_path in self.record_paths: @@ -78,7 +80,10 @@ class TelecasterCheck: if self.is_up: time.sleep(self.TIME_SLEEP) self.is_writing = False - self.message += format + " monitor is not writing\n" + self.message += format + " writing is OFF - " + else: + self.is_writing = True + self.message += format + " writing is ON - " f = open(log, 'w') f.write(str(size)) f.close() @@ -86,8 +91,8 @@ class TelecasterCheck: def run(self): self.check_daemons() self.check_writing() + print(self.message) if not self.is_up or not self.is_writing: - print(self.message) sys.exit(self.CRITICAL_STATE) else: sys.exit(self.OK_STATE)