monit-dev
[Top][All Lists]
Advanced

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

Re: monit for AIX


From: Jan-Henrik Haukeland
Subject: Re: monit for AIX
Date: 03 Mar 2003 07:35:25 +0100
User-agent: Gnus/5.0808 (Gnus v5.8.8) XEmacs/21.4 (Civil Service)

Richard Schwaninger <address@hidden> writes:

> I have added support for AIX 4.3.3 to monit. The corresponding
> files are included - you may add them to the distribution.
> Appended is sysdep_AIX.c

Thank you for the contribution! Allthough I'm not sure we will want to
support AIX since I do not think anyone in the project actually has
access to an AIX machine. Christian, as responsible for the sysdep
code what are your thoughts on this?

> I found the following problems (AIX 4.3, gcc-2.95):
> monitor.h: char *get_uptime(time_t delta) should be char *get_uptime(long 
> delta) (maybe this should be done by autoconf?)

The time_t type is defined in time.h which is not included in
monitor.h, but it should be. (On many systems time.h and time_t is
sub-included via sys/types.h)

> add a corresponding entry in configure.ac (maybe there is more, but I
> don't know autoconf enough...)
> ---configure.ac-----8<----------
> ...
> elif test `uname` = "AIX"
> then
>    ARCH="AIX"
>    CFLAGS="$CFLAGS -D _REENTRANT"
> ...
> --------8<-----------
> 
> and the most mysterious thing is that getpgid sometimes returns
> -1 and errno is set to 0. If you apply the fix below then all
> _seems_ to work correctly.
> 
> ---util.c-----8<---------------
> /**
>  * @return TRUE (i.e. the running pid id)  if
>  * the process is running, otherwise FALSE
>  */
> int is_process_running(Process_T p) {
>   
>   pid_t  pid;
>   int kill_return= 0;
> 
>   ASSERT(p);
>   
>   errno= 0;
>   if((pid= get_pid(p->pidfile))) {
>       
> #ifdef AIX
>       kill_return=getpgid(pid);
>       /* hmm. I get getpgid== -1 and errno==0 sometimes... */
>       if((kill_return>0)||(errno==EPERM)||(errno==0)) {
>           return pid;
>       }
> #else
>     if(((kill_return= getpgid(pid)) > 0) || (errno == EPERM)) {
>             pid,getpgid(pid),getpgid(0),kill_return,errno);
>         return pid;
>     }
> #endif
>   }
> 
>   memset(p->procinfo, 0, sizeof *(p->procinfo));
>   return FALSE;
>   
> }
> ---------8<----------------


If you run monit with http support and if errno is not thread local on
AIX (it probably isn't) it could be that the http thread has set errno
to 0. Anyway, if getpgid returns -1 an error *has* occured and the pid
should not be returned.


> A (probably) simple question: How to monitor oracle? 

Unfortunately I do not use Oracle, but maybe someone else on the
mailinglist can answer this?

> The sample does not work (at least not on AIX): oracle does not
> write a pid file and the process that starts up the different oracle
> subprocesses terminates when the database is running. Ok, I could
> wait for some seconds and get the pid of one of those processes and
> let monit check for this one, but...
> Here's a process listing after I call 'dbstart' (from the oracle-7.3.4
> original distribution).
>   oracle  9420     1   0   Feb 26      -  0:00 ora_pmon_SAT
>   oracle 12104     1   0   Feb 26      -  0:41 ora_dbwr_SAT
>   oracle 12762     1   0   Feb 26      -  0:00 ora_arch_SAT
>   oracle 13206     1   0   Feb 26      -  0:00 ora_d000_SAT
>   oracle 13404     1   0   Feb 26      -  0:00 ora_lgwr_SAT
>   oracle 13812     1   0   Feb 26      -  0:00 ora_smon_SAT
>   oracle 13940     1   0   Feb 26      -  0:00 ora_s000_SAT
> All of these processes should be monitored separately, but I don't
> want to add all them to monit. Any way to solve this?
> 
> Thanks
> -- 
> - risc
> =================================================================
> Richard Schwaninger                Vorarlberg Milch reg. Gen. mbH
> Leiter EDV                                       Nofler Straße 62
> WWW: http://www.vmilch.at                        A-6800 Feldkirch
> Tel.: +43 5522 72130                      Fax.: +43 5522 72130-44



Regards
-- 
Jan-Henrik Haukeland




reply via email to

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