Monitoring remote and restart remote systems (Linux /IOT)

Issue #646 closed
Former user created an issue

I'm trying out monit to monitor over 200 IOT-Linux units. My problem is that some of the deamons on the Busybox system is a bit unstable. And our phone support don't want to ssh into every unit to restart a deamon or service. They want a webinterface and just click ;-) So I did a "hack" of your code. My idea is when the system is down the remote server will fire a command. Like this : ssh user1@server1 'start /bin/tool-kits2'
(you do need a trust via ssh) But the web user(support) can also force a restart of a remote deamon.

Comments (1)

  1. Tildeslash repo owner

    You can set the start/stop/restart programs of the given service to the ssh command (when the user will click the Start button in the GUI, Monit will then execute the remote command). For example:

    check host server1 with address
        start program = "/usr/bin/ssh user1@server1 'start /bin/tool-kits2'"
        stop program = "/usr/bin/ssh user1@server1 'stop /bin/tool-kits2'"

    You can also automate the restart action ... for example if the connection to port 25 failed:

    if failed port 25 protocol smtp then exec "/usr/bin/ssh user1@server1 'sudo restart postfix'"
  2. Log in to comment