|
From: | Martin Pala |
Subject: | Re: [monit] alert restarts service |
Date: | Fri, 18 Apr 2008 07:35:20 +0200 |
User-agent: | Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.8.1.13) Gecko/20080313 Iceape/1.1.9 (Debian-1.1.9-1) |
gorlist wrote:
Thanks for the reply. I understand. 1. Whenever I stop it manually though it only sends a "Does not exist Service sshd" message and the date. It does not follow the default more detailed format that ends with "Your faithful employee, monit". Why?
The message which ends with "Your faithful employee, monit" is the default mail format. It is possible to override the default template with "mail-format" option. See monit manual for more details.
Maybe you used this option ? It could be good if we can see the configuration.
2. What would be a good way to implement a 'hacky' remote host service restart? Like quick and dirty fix.
It could be possible to call the actions on remote hosts using remote monit web interface hooked to start/stop/exec action with wget for example.
3. I have a problem when sending mails. I use postfix, I have it configured to "Internet site" and sometimes it does not let monit send the alert mail. The mail command will succeed with all hosts (3/3). When monit does it, it only succeeds with gmail.com (1/3). The other two is yahoo.com and my own mailserver.
Please can you provide the network trace of the communication with the failed mailservers?
4. How is monit allowed to start and stop services, since AFAIK only root is privileged to do so.
Monit has the same privileges as the user under which monit is running. When monit is running as root, it's possible to setuid/setgid when executing start/stop/exec actions to different user/group.
Martin
On Fri, Apr 18, 2008 at 1:22 AM, Martin Pala <address@hidden> wrote:Hi, the restart action when monitored process exits is implicit. We plan to add options to allow to override the default behavior: http://www.tildeslash.com/monit/doc/next.php#36 Since the process existence comes before socket testing, in your case monit detects that ssh is not running and restarts it. The socket/port related alert action was not even evaluated (since it makes no sense when process is not running). If you want to cleanly stop process which is monitored by monit, you should do "monit stop ssh", so monit will perform the stop (otherwise when the process exists out of monit control, monit tries to fix the problem). Remote hosts can be monitored using "check host" statement ... currently it is not possible to restart remote services (just alerts). The possibility to restart remote services will be part of M/Monit. We don't have IRC channel for support currently. Cheers, Martin gorlist wrote:Hello, firstly let me say a big thank you to the developers for such a wonderfultool.So my monitrc looks like this: check process sshd with pidfile /var/run/sshd.pid start program "/etc/init.d/sshd start" stop program "/etc/init.d/sshd stop" if failed port 22 protocol ssh then alert The thing is that if I stop the sshd manually, the next cycle it displays "Does not exist", sends an email to the global address and after that it starts the daemon. That means 2 cycles after I stop the sshd, it starts it even if I haven't specified restart (I have only alert). Why does it do that? Also, is there a way that I can monitor daemons on remote hosts and restart them if needed? If yes, how? Finally, is there an IRC channel or something except this list to getsupport?Thank you -- To unsubscribe: http://lists.nongnu.org/mailman/listinfo/monit-general-- To unsubscribe: http://lists.nongnu.org/mailman/listinfo/monit-general-- To unsubscribe: http://lists.nongnu.org/mailman/listinfo/monit-general
[Prev in Thread] | Current Thread | [Next in Thread] |