简体   繁体   中英

Monit : monitor remote processes

I want to setup a "Monit" on a centralized server to monitor the process on the remote servers. (In My use case, i want to restart the Storm supervisors on servers A,B,C and Kafka brokers on servers D,E,F,G if they get shut down). I could not find an example where monit is used to monitor the remote processes. Is there any way to achieve the same using monit or any alternatives.

First off I am using an Ubuntu Server 16.04, So my syntax and file location may different than yours.

I was able to open the /etc/monit/monitrc and input the remote server i am trying to monitor This is the syntax I used:

Test to Check the host server remotely

check host host.domain.name with address ip.addy.here.ip
start program = "ssh user@ipaddress /etc/init.d/sshd start"
stop program = "ssh user@ipaddress /etc/init.d/sshd stop"
if failed port 22 protocol ssh
then alert

Of course you would have to use a user with priviledges.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM