On Thu, Sep 18, 2003 at 11:41:29AM +0200, Martin Pala wrote:
Jan-Henrik Haukeland wrote:
Rick Robino <address@hidden> writes:
As I mentioned in that past letter I can make the error go away by
adjusting just one expression in socket.c;
Ah, but using the address of and address must be wrong, and by doing
this, the host variable must point to wonderland (i.e. the host
variable cannot contain sensible data in create_socket()):
Socket_T socket_new(const char *host, int port, int type, int use_ssl) {
....
if((s= create_socket((char *)&host, port, proto, NET_TIMEOUT)) != -1)
socket_new() is called from remote_status() by:
Socket_T sock= socket_new(Run.bind_addr?Run.bind_addr:"localhost",
Run.httpdport, SOCKET_TCP, Run.httpdssl);
=> in the case that you have not specified which address is monit httpd
binded to, "monit status" will connect to localhost to obtain status
from running daemon (where the string "localhost" is static).
Does it fail if you specify monit httpd address in monit configuration
file, such as:
set httpd port 2812 and
use address 127.0.0.1
allow 127.0.0.1
as well as in the case that you have not specified the interface?:
set httpd port 2812 and
allow 127.0.0.1
(Note: in the first case value of Run.bind_addr will be used, in the
second case "localhost" will be used).
Sorry I didn't reply earlier, had to sleep and work. I think you
are on to something. Here are a few cases and results, varying
only use address and allow.
base monitrc:
set logfile syslog
set mailserver spiff.local
set httpd port 1443
and use address 192.168.1.2
# allow 127.0.0.1
# allow rrobino:******
# ssl enable
# pemfile /System/Library/OpenSSL/certs/monit.pem
check apache with pidfile /var/run/httpd.pid
start program = "/usr/bin/sudo /usr/sbin/apachectl start"
stop program = "/usr/bin/sudo /usr/sbin/apachectl stop"
check syslogd with pidfile /var/run/syslog.pid
start program = "/usr/bin/sudo /System/Library/StartupItems/SystemLog/SystemLog
StartServic>
stop program = "/usr/bin/sudo /System/Library/StartupItems/SystemLog/SystemLog
StopService"
case1:
use address 127.0.0.1
allow 127.0.0.1
result1: malloc warning
case2:
allow 127.0.0.1
result2: malloc warning
case3:
use address 127.0.0.1
result3: no error
[ same result using 'localhost' instead of loopback address ]
case4:
use address 10.0.1.65 (unresolvable by dns, but assigned and up)
result4: "The monit server did not return a process, device, ..." error
[ same result using hostname of 10.1.1.65, as in /etc/hosts and in
netinfo ]
case5:
use address 10.0.1.65
allow 10.0.1.65
result5: both the malloc and the recently fixed "did not return a
process" error
case6: (unresolvable address, _not_ assigned to any local interface)
use address 192.168.1.2
result6: no error, slow return
[ same result using bogus name instead of IP address ]
case7:
use address 192.168.1.2
allow 192.168.1.2
result7: malloc error, slow return
Summary: allow <host|ip> yields the malloc warning, and use address
is responsible for the 'monit server did not return a...' error.
Bogus addresses that aren't really bound to local interfaces
apparently cause a resolution attempt once per service and then
return without displaying an error.
My ssl lines are commented out not only to enforce control on the
test but also because I get an error now; but I haven't updated
my CVS since last night. Am updating now.
Does this give you any clues? Any other tests you can think of?
--Rick
_______________________________________________
monit-dev mailing list
address@hidden
http://mail.nongnu.org/mailman/listinfo/monit-dev