monit-dev
[Top][All Lists]
Advanced

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

Two problems.


From: Mostafa Hosseini
Subject: Two problems.
Date: Tue, 09 Sep 2003 18:14:19 -0400
User-agent: Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.4) Gecko/20030624

Hi,
I encountered two problems while using monit-4.0 ( beta ):

1) mem usage resource check:
I have:

<snip>
check apache with path /var/run/httpd.pid
   start program = "/etc/init.d/httpd start"
   stop program  = "/etc/init.d/httpd stop"
   if cpu > 80 % for 2 cycles then restart
   if mem > 80 % for 1 cycles then restart
<snip>

monit restarts apache every cycle and says:

Event: mem usage of 2.4% matches resource limit [mem usage>-173853900.8%]


It seems the limit is being parsed incorrectly.
Comparing the sections in p.y for CPU PERCENT:

           | CPU operator PERCENT {
                   resourceset.resource_id= RESOURCE_ID_CPU_PERCENT;
                   resourceset.operator= $<number>2;
                   resourceset.limit= (int) ($<real>3 * 10);

and MEMORY PERCENT:

               | MEMORY operator PERCENT {
                   resourceset.resource_id= RESOURCE_ID_MEM_PERCENT;
                   resourceset.operator= $<number>2;
                   resourceset.limit= (int) ($<number>3 * 10);
                 }

one can see that the the latter has "number" instead of "real"

I changed "number" to "real", recompiled and my problem was solved.

2) checking unix sockets:
I have:

<snip>
if failed unixsocket /tmp/appserver/ctl then restart
<snip>

to check for the validity of a unix socket.

This results in monit aborting because of an assertion:

monit[23155]: AssertException: at xmalloc.c:110 aborting..

This happens because in socket.c at line #151:
S->host= xstrdup(p->hostname);
p->hostname is null.

I fixed the problem for myself based on the code in monit 3.2 this way:

if( p->family == AF_UNIX )
       S->host = xstrdup( p->pathname );
   else
       S->host= xstrdup(p->hostname);


I was wondering if this would help.

Cheers and thanks for the great work.
Mostafa





reply via email to

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