aboutsummaryrefslogtreecommitdiffhomepage
diff options
context:
space:
mode:
authorilariofebi <ilario@febi.biz>2017-09-25 14:31:31 +0200
committerRahiel Kasim <rahielkasim@gmail.com>2017-09-25 14:31:31 +0200
commitc255aa76610dd8467401b6cef146284b89105ca5 (patch)
treef68070e3bc5b38d0736f80d622c9dd8a3b3f628a
parentf32d785bbdb6afd3ea83f05ccbc66abf768fbf79 (diff)
Add hostname info before the message (#4)
-rw-r--r--supervisor_alert.py2
1 files changed, 2 insertions, 0 deletions
diff --git a/supervisor_alert.py b/supervisor_alert.py
index 18ac265..5572c95 100644
--- a/supervisor_alert.py
+++ b/supervisor_alert.py
@@ -19,6 +19,7 @@ from functools import partial
from os.path import expanduser
from pwd import getpwnam
from subprocess import CalledProcessError, check_call
+import socket
from supervisor.childutils import listener, get_headers
@@ -64,6 +65,7 @@ def main():
def telegram(message):
"""Send message with telegram-send."""
+ message = "%s)\n%s" % (socket.gethostname(), message) # Add hostname info before the message
try:
check_call(["telegram-send", message] + telegram_conf_args)
listener.ok()