monit-general
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [monit] Strange behaviour if name of process is the same as the host


From: Martin Pala
Subject: Re: [monit] Strange behaviour if name of process is the same as the hostname
Date: Tue, 5 Jan 2010 23:36:43 +0100

Hi,

the problem happens when the monit configuration doesn't contain "check system" 
service check. In such case monit generates virtual check automatically and 
adds it to the tail of service checks. It uses hostname as service name ... in 
your case hostname is "fetchmail" and matches existing "check process fetchmail 
...". The auto-generated entry has no start/stop method associated, hence the 
start/stop/restart buttons are hidden in GUI. The web interface and "monit 
status" then lists both services (system and process) with the same name - 
system is on first place in GUI, so you have probably looked on system type 
check. The monit CLI acted on system type service too instead of process.

As workaround you can add following entry to your monitrc:

  check system myhostname

We'll fix it in next Monit release ... the above mentioned auto-generated 
system entry is the only one which doesn't check service name for duplicates, 
otherwise all service name are tested for uniqueness and Monit reports error 
during configuration parsing when duplicates are found.

Thanks for report.

Best regards,
Martin



On Jan 5, 2010, at 11:10 AM, Marcus Mülbüsch wrote:

> It took me some time to sort it out:
> 
> I have a Gentoo vserver called "fetchmail" which runs (surprise, surprise) 
> the "fetchmail" daemon.
> 
> Now running monit with
> "check process fetchmail with pidfile /var/run/fetchmail/fetchmail.pid"
> gives all sorts of strange behaviour:
> 
> - in the web front end the process "fetchmail" has only the button "disable 
> monitoring"; "start", "stop" and "restart" are missing (though the methods 
> are defined
> 
> - when the process is stopped via the start-stop-daemon, a "monit summary" 
> shows the daemon still running; though it isn't. The web interface shows the 
> system as "initializing", and the service as "running", but with an uptime of 
> "0 minutes" (always). Monit does not restart the service.
> 
> - when the process is killed it isn't restarted either.
> 
> Now, the solution is as simple as choosing a name for the service that is 
> different from the hostname:
> "check process fetchmaild with pidfile /var/run/fetchmail/fetchmail.pid"
> does work perfectly.
> 
> However, it took me some time to figure it out, and this is NOT the way I 
> expect it to work.
> 
> Unfortunately I cannot determine whether that has something to do with 
> vservers or not; I do not have a box I can test it. I doubt that it is a 
> gentoo thing, either.
> 
> The behaviour shows in monit-4.10.1 (the monit version marked stable in 
> gentoo's portage tree) and 5.0.3 (the last available version in gentoo's 
> portage tree)
> 
> Marcus Mülbüsch
> 
> 
> --
> To unsubscribe:
> http://lists.nongnu.org/mailman/listinfo/monit-general





reply via email to

[Prev in Thread] Current Thread [Next in Thread]