monit-general
[Top][All Lists]
Advanced

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

Problems reading process vitals on FreeBSD when the monitored process is


From: Ralf Hack
Subject: Problems reading process vitals on FreeBSD when the monitored process is swapped out
Date: Thu, 26 Feb 2004 11:12:42 +0000
User-agent: Mozilla Thunderbird 0.5 (Macintosh/20040208)

Hi,
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.

 Here is what i found:

[ Feb 26 03:01:25] 'ssh_t2' failed to get service data
[ Feb 26 03:01:45] 'ssh_t2' failed to get service data
[ Feb 26 03:02:05] 'ssh_t2' failed to get service data
[ Feb 26 03:02:25] 'ssh_t2' failed to get service data
[ Feb 26 03:02:45] 'ssh_t2' failed to get service data
[ Feb 26 03:03:05] 'ssh_t2' failed to get service data
[ Feb 26 03:03:25] 'ssh_t2' failed to get service data

set pidfile /var/run/monit.pid
set logfile /var/log/monit.log
set daemon 20 set httpd port 2812 and use address localhost
       allow localhost
       allow admin:monit

check process ssh_t2 pidfile "/var/run/tunnel_10.xxx.112.74"
       start program "/my/tools/client.sh start_t2"
       stop program "/my/tools/client.sh stop_t2"
       if failed host 10.xxx.112.74 port 22 protocol ssh then alert
       mode active

host# cat /var/run/tunnel_10.xxx.112.74
51626
host# ps -axwwwfflll | awk '/  UID/{print};/51626/{print}'
 UID   PID  PPID CPU PRI NI   VSZ  RSS WCHAN  STAT  TT       TIME COMMAND
0 51626 1 0 2 0 2336 8 select IW ?? 0:00.00 ssh -l rh -o Batchmode yes -n -N -R 2389:localhost:389 -R 3389:localhost:3389 10.xxx.112.74

I am using FreeBSD 4.9,the ssh client is openssh 3.7; monit is 4.1.1 downloaded from your website.

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;

 }








reply via email to

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