Skip to content
Snippets Groups Projects
Commit 22bd4345 authored by Tamas Gal's avatar Tamas Gal :speech_balloon:
Browse files

Allow controlling the monitoring system

parent 07ec9d35
No related branches found
No related tags found
No related merge requests found
......@@ -83,6 +83,16 @@ def register_handlers(bot):
['supervisorctl', 'status']).decode('ascii') + "\n```"
bot.send_message(status, channel_id)
def supervisorctl(msg, user, channel_id):
if not is_shifter(user) and not is_operator(user):
bot.send_message(
"Sorry @{}, only operators and shifters are allowed to mess "
"with me, sorry...".format(user), channel_id)
return
output = subprocess.check_output(['supervisorctl'] +
msg.split()).decode('ascii')
bot.send_message(output, channel_id)
def shifters(msg, user, channel_id):
if channel_id != CHANNEL_ID:
print("skipping")
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment