[Top][All Lists]

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

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

From: Rory Toma
Subject: Re: Problems reading process vitals on FreeBSD when the monitored process is swapped out
Date: Thu, 26 Feb 2004 16:50:44 -0800

I suspect the fact that you can't get this info if you aren't root is security-related.

I'll look into it. I'm working on snmp stuff right now.

BTW, did we ever get a base OID?

On 2004-02-26 05:08:17 -0800 Christian Hopp <address@hidden> wrote:

On Thu, 26 Feb 2004, Ralf Hack wrote:


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,
                 (unsigned long) pinfo [0].kp_proc.p_limit,
(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

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


reply via email to

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