monit-general
[Top][All Lists]
Advanced

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

Re: 4.7-beta1: monit <command> <service> does not work


From: Jan-Henrik Haukeland
Subject: Re: 4.7-beta1: monit <command> <service> does not work
Date: Tue, 20 Dec 2005 21:20:03 +0100


On 20. des. 2005, at 19.52, metaworx lists wrote:

I tried that. works with strace, doesn't without.

Bhaa! Well, the only (non-commercial[1]) option left then, since we cannot reproduce it, is to run gdb and debug the problem.

I'll give you a few pointers to get you started. First, run gdb on the non-installed monit software (i.e. from the directory you built monit), because debug info is stripped during installation. The idea is to test if the monit daemon gets a connection from the monit client at all, which seems to be the problem and then find where the problem is located. The monit client-server system looks like this:

(1)monit <service> <command> - (2)send command via socket -> (3) monit daemon accepts command -> (4)do command


1) Open two consoles
2) Start the monit daemon using gdb and set a breakpoint like so;

gdb ./monit
...
(gdb) b socket_create_a
Breakpoint 1 at 0xd8ec: file socket.c, line 256.
(gdb) r -Iv
...

3) In the other console run, 'monit stop vs5_dbhost'

4) If console number 1 stops execution with this;

Breakpoint 1, socket_create_a (socket=6, remote_host=0xa000ce68 "127.0.0.1", port=2812, sslserver=0x0) at socket.c:256
256       ASSERT(socket>=0);
(gdb) n

Then the connection was accepted by the daemon, now step through the code using 'n' or 's' where applicable and try to locate the problem. It may be a SSL problem and I'm particularly interested in if this block of code in socket.c:socket_create_a, 'if(sslserver)..' has any problems? If so, have you recently installed a new open-ssl version?


5) if it does not stop in 4) the problem must be at the other end. Instead of setting the breakpoint in the server, start the client with gdb and set a breakpoint there as shown below. Make sure you have started the daemon first with ./monit -Iv

gdb ./monit
...
(gdb) b control_service_daemon
Breakpoint 1 at 0x39d8: file control.c, line 92.
(gdb) r monitor apache
Starting program: /Users/hauk/src/monit/monit monitor apache
...
Breakpoint 1, control_service_daemon (S=0xbffffa38 "apache", action=0xbffffa30 "monitor") at control.c:92
92        char *auth= Util_getBasicAuthHeader();

Step through and see where and why the socket calls fails.

Let us know how it goes!

--
Jan-Henrik Haukeland
Mobil +47 97141255

[1] If all else fails we do provide online help for a small fee, see the monit support pages.




reply via email to

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