sensu / sensu-remediation-handler

Sensu Go handler for implementing "self healing" workflows
MIT License
2 stars 5 forks source link

Update readme for cases when sudo needs to be used #12

Open gtarnaras opened 4 years ago

gtarnaras commented 4 years ago

Hello folks,

i am trying everyting step by step trying to use the remediation handler. However, for some reason i cannot start a service with systemctl. I am getting the following message when running e.g:

sudo systemctl start

Dec 05 10:51:48 cdos-monitoring sudo[9776]:    sensu : command not allowed ; TTY=unknown ; PWD=/ ; USER=root ; COMMAND=/bin/systemctl start sensu-backend
.... "level":"info","msg":"no handlers available" ...

if i try a different command, e.g. touch /var/tmp/test.txt it works. Not sure if this is somewhat a bug or configuration issue. Any ideas? Thank you!

gtarnaras commented 4 years ago

Found out that this is how Sensu works and it is absolutely fine from a security perspective. Found this in case someone else is facing the same issue https://discourse.sensu.io/t/having-sensu-sudo/26/5 . However, it would be a nice addition in the plugin's README since the example uses sudo. I would be happy to update it.

gtarnaras commented 4 years ago

Created a PR https://github.com/sensu/sensu-remediation-handler/pull/13