Ad Widget

Collapse

reboot linux OS from an Action

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • lbon
    Junior Member
    • Dec 2022
    • 14

    #1

    reboot linux OS from an Action

    I have an action that is triggered by malfunctioning services.

    First actions are to try to restart these services, but if they fail for 30 min, I want zabbix to reboot the OS

    I have created a Remote Command executing this:

    su zabbix -s /bin/bash; sudo /sbin/reboot; exit;

    The zabbix_agent.log on the host shows that command is executed, but in the secure log, I get:

    Aug 27 22:08:50 sudo: pam_unix(sudo:auth): conversation failed
    Aug 27 22:08:50 sudo: pam_unix(sudo:auth): auth could not identify password for [zabbix]
    Aug 27 22:08:50 sudo: zabbix : command not allowed ; TTY=unknown ; PWD=/ ; USER=root ; COMMAND=/sbin/reboot

    User zabbix is not in wheel nor in the sudoers... But rather than adding zabbix here (which I guess will fix the issue, yet granting to much power to zabbix user), I would like to know, if there is a better way to have zabbix reboot a host from an action? The host is running as a VM in vCenter.


  • lbon
    Junior Member
    • Dec 2022
    • 14

    #2
    Not possible other than elevating the zabbix agent user?

    Comment

    Working...