[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [Richard Schwaninger <address@hidden>] monit for AIX
From: |
Oliver Jehle |
Subject: |
Re: [Richard Schwaninger <address@hidden>] monit for AIX |
Date: |
03 Mar 2003 08:00:26 +0100 |
Hi Richard....
i know the problem with oracle... but you can do a very simple thing as
a workaround....
write a program (perl,shell or whatelse)... which runs in a loop calling
your database..... when the database isn't reachable, then you leave the
loop and give up your process-id. so you can use the rc checking...
i think, its a not "very nice" solution, but its the only way to be 100%
shure, that oracle works.... you cannot check the processes, because i
often saw(oracle versios 7 and 8) , that the processes are up, but the
database isn't responding.
For ALL:
if monit has a plugin interface, where you can add (for example with a
register api) a external check, you can also write external resource
checks --> if i remember, Martin is doing a resource check... when its
dynamic and loadable, then any kinds of check could be performed...
On Mon, 2003-03-03 at 07:41, Jan-Henrik Haukeland wrote:
> I forgot to include the AIX patch from Richard Schwaninger, here it is
> with the complete mail as well.
>
>
> ______________________________________________________________________
>
> From: Richard Schwaninger <address@hidden>
> To: address@hidden
> Subject: monit for AIX
> Date: 28 Feb 2003 16:23:24 +0100
>
> 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
>
> ______________________________________________________________________
>
- [Richard Schwaninger <address@hidden>] monit for AIX, Jan-Henrik Haukeland, 2003/03/03
- Re: [Richard Schwaninger <address@hidden>] monit for AIX,
Oliver Jehle <=
- Re: [Richard Schwaninger <address@hidden>] monit for AIX, Jan-Henrik Haukeland, 2003/03/03
- Re: [Richard Schwaninger <address@hidden>] monit for AIX, Oliver Jehle, 2003/03/03
- Re: [Richard Schwaninger <address@hidden>] monit for AIX, Jan-Henrik Haukeland, 2003/03/03
- Re: [Richard Schwaninger <address@hidden>] monit for AIX, Oliver Jehle, 2003/03/03
- Re: [Richard Schwaninger <address@hidden>] monit for AIX, Jan-Henrik Haukeland, 2003/03/03
- Re: [Richard Schwaninger <address@hidden>] monit for AIX, Oliver Jehle, 2003/03/03