Ad Widget

Collapse

Actions on remote linux

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • guille.rodriguez
    Senior Member
    • Jun 2022
    • 114

    #1

    Actions on remote linux

    Hi all, I have a template for Linux that have same service (for example apache, mysql).

    Sometimes website fails down because MySQL stops by OOM Kill, I solved the problem with OOM and after a few weeks it's solved.

    But I want to execute actions like

    systemctl restart mariadb.service when Trigger MariaDB Service is Down appears on host that triggers the problem.

    My first approach is using an action using Zabbix Agent, but fails because

    1 - Zabbix user on machine dont have home & shell configured on /etc/passwd.
    2 - Zabbix user on machine dont have permissions of sudo

    I've tried to changing thoose things on machine and it works but I don't want to configure this on all machines (I can do it with puppet / ansible... but I prefer ask other way).


    Is it possible using script executed on server? I tried and it works but I need to create 1 script for every server... is it possible to use some macro like {HOST.CON} like and argument, to execute some like this

    ssh root@{HOST.CON} "systemctl restart mariadb.service"

    On Windows I dont have this problem because Windows Agent is installed and executed as full admin, so ...
  • guille.rodriguez
    Senior Member
    • Jun 2022
    • 114

    #2
    Nobody know how to do that?

    Comment

    • cyber
      Senior Member
      Zabbix Certified SpecialistZabbix Certified Professional
      • Dec 2006
      • 4807

      #3


      {HOST.CONN} → Trigger-based notifications and commands

      So yes...

      Comment

      Working...