monit-dev
[Top][All Lists]
Advanced

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

[Richard Schwaninger <address@hidden>] monit for AIX


From: Jan-Henrik Haukeland
Subject: [Richard Schwaninger <address@hidden>] monit for AIX
Date: 03 Mar 2003 07:41:44 +0100
User-agent: Gnus/5.0808 (Gnus v5.8.8) XEmacs/21.4 (Civil Service)

I forgot to include the AIX patch from Richard Schwaninger, here it is
with the complete mail as well.

--- Begin Message --- Subject: monit for AIX Date: Fri, 28 Feb 2003 16:23:24 +0100 User-agent: KMail/1.4.2
Hi,

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

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?)

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<----------------

A (probably) simple question: How to monitor oracle? 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

Attachment: sysdep_AIX.c
Description: Text Data


--- End Message ---

-- 
Jan-Henrik Haukeland

reply via email to

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