monit-general
[Top][All Lists]
Advanced

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

Re: Problems reading process vitals on FreeBSD when the monitored proces


From: Christian Hopp
Subject: Re: Problems reading process vitals on FreeBSD when the monitored process is swapped out
Date: Thu, 26 Feb 2004 14:08:17 +0100 (CET)

On Thu, 26 Feb 2004, Ralf Hack wrote:

Hello!

> I monitor an ssh tunnel and get the following message after several
> hours. It appears that kvm_read fails reading the memory size once
> the process is swapped out on the monitoring server (STAT
> += W). Once I active the monitored process by simply using the
> session, the problem disappears. Sorry, I do not know enough about
> FreeBSD programming to offer a fix for this.

(...)

> I could track down the problem using gdb to line 376 in sysdep_FREEBSD.c
>
> Breakpoint 3, get_process_info_sysdep (p=0x808f4c0)
>     at process/sysdep_FREEBSD.c:376
> 376         return FALSE;
> (gdb) c
>
>
>   /* ----------------------------- MEMORY --------------------------------*/
>   /* Got it from libgtop/sysdep/freebsd/procmem.c */
>
>   if (kvm_read (kvm_handle,
> #if (__FreeBSD_version > 500000)
>                 (unsigned long) &pinfo->ki_addr->p_limit,
> #else
>                 (unsigned long) pinfo [0].kp_proc.p_limit,
> #endif
>                 (char *) &plimit, sizeof (plimit)) != sizeof (plimit)) {
>
>     return FALSE;
>
>   }

Yep, it has to be there!  It's really tricky.  If this kvm_read call
fails, too less data is transmitted from the kernel (see man page or
other implementations).  I am hesitant to guess the amount of memory
at that point (e.g. 0), but it is the only solution I see at that
point.

I would love to have more docs about freebsd and kvm, but I haven't
googled anything useful yet.  I have cursed about all this already a
lot!

Christian


-- 
Christian Hopp                                email: address@hidden
Institut für Elektrische Informationstechnik             fon: +49-5323-72-2113
TU Clausthal, Leibnizstr. 28, 38678 Clausthal-Zellerf.   fax: +49-5323-72-3197
                             pgpkey: https://www.iei.tu-clausthal.de/pgp-keys/





reply via email to

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