Added restart_service_from_remote

This commit is contained in:
Yavuz Aydın 2021-10-06 22:11:21 +02:00
parent 0ed7a16eaf
commit 9f9189c144
1 changed files with 17 additions and 2 deletions

View File

@ -10,7 +10,7 @@ to check if a reboot is required and also list packages that requires reboot
Plugin for checking network errors and statictics
#### restart_service
Event command to restart a service. Restaring a service will require sudo privileges on systemctl / service binaries. Add the following to `/etc/sudoers` on the client machine:
Event command to restart a service. Restarting a service will require sudo privileges on systemctl / service binaries. Add the following to `/etc/sudoers` on the client machine:
```
icinga ALL=(ALL) NOPASSWD: /bin/systemctl restart *
icinga ALL=(ALL) NOPASSWD: /usr/bin/systemctl restart *
@ -18,4 +18,19 @@ icinga ALL=(ALL) NOPASSWD: /sbin/service * restart
icinga ALL=(ALL) NOPASSWD: /usr/sbin/service * restart
```
If your Icinga2 client runs as a different user adjust as necessary.
If your Icinga2 client runs as a different user adjust as necessary.
This is meant for use with a command_endpoint set to the client. See [official documentation](https://icinga.com/docs/icinga-2/latest/doc/03-monitoring-basics/#use-event-commands-to-send-information-from-the-master) examples.
#### restart_service_from_remote
Event command to restart a service. Restarting a service will require sudo privileges on systemctl / service binaries. Add the following to `/etc/sudoers` on the client machine:
```
icinga ALL=(ALL) NOPASSWD: /bin/systemctl restart *
icinga ALL=(ALL) NOPASSWD: /usr/bin/systemctl restart *
icinga ALL=(ALL) NOPASSWD: /sbin/service * restart
icinga ALL=(ALL) NOPASSWD: /usr/sbin/service * restart
```
If your Icinga2 client runs as a different user adjust as necessary.
This is meant to be called from the master / satellite through restart_service_on_endpoint.