monit-general
[Top][All Lists]
Advanced

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

Re: monit 4.4-beta2 problems with FreeBSD 4.10


From: Martin Pala
Subject: Re: monit 4.4-beta2 problems with FreeBSD 4.10
Date: Tue, 24 Aug 2004 14:02:51 +0200

Hi,

thanks for patch :) I have tried it on FreeBSD 4.8 and it works - the patch
was added to cvs.

Monit process code was refactored in 4.4, the system dependent process code
for *BSD machines was not tested yet.

Cheers,
Martin

----- Original Message ----- 
From: "Sebastian Zander" <address@hidden>
To: <address@hidden>
Sent: Tuesday, August 24, 2004 6:12 AM
Subject: monit 4.4-beta2 problems with FreeBSD 4.10


> Hi,
>
> when running monit-4.4-beta2 on my FreeBSD 4.10 machine I found that
> the cpu and memory stats are completely wrong. I tried to fix that (patch
> attached). Because I don't know very much about FreeBSD I'm not sure
> if the patch works in general...
>
> Also it seems that for the system cpu stats monit prints the sum of user
> and system under user (system is always 0)!?
>
> Cheers,
>
> Sebastian
>
> -- 
> Sebastian Zander
> http://caia.swin.edu.au
>


----------------------------------------------------------------------------
----


> --- monit-4.4-beta2/process/sysdep_FREEBSD.c Thu Aug 12 04:35:16 2004
> +++ monit-4.4-beta2-dev/process/sysdep_FREEBSD.c Tue Aug 24 13:26:54 2004
> @@ -268,10 +268,13 @@
>
>    }
>
> -  systeminfo.mem_kbyte_max= (vmm.v_pageout_free_min +
> -      vmm.v_free_count + vmm.v_wire_count +
> -      vmm.v_active_count + vmm.v_inactive_count) *
> -     ( getpagesize() / 1024 ) ;
> +  /* Get the data from kvm_* */
> +  if (kvm_read (kvm_handle, nlst[1].n_value,
> +      &vmm, sizeof (vmm)) != sizeof (vmm)) {
> +    return FALSE;
> +  }
> +
> +  systeminfo.mem_kbyte_max = vmm.v_page_count * ( getpagesize() / 1024 )
;
>
>    return TRUE;
>
> @@ -368,7 +371,7 @@
>        stat_cutime = tv2sec (pstats.p_cru.ru_utime);
>        stat_cstime = tv2sec (pstats.p_cru.ru_stime);
>
> -      pt[i].cputime= (int)(( stat_utime + stat_stime ) / 1000);
> +      pt[i].cputime= (int)(( stat_utime + stat_stime ) / 100000);
>
>      } else {
>
> @@ -395,7 +398,7 @@
>
>        rss_lim = (u_int64_t) (plimit.pl_rlimit [RLIMIT_RSS].rlim_cur);
>
> -      vms = &pinfo [0].kp_eproc.e_vm;
> +      vms = &pinfo [i].kp_eproc.e_vm;
>
>        pt[i].mem_kbyte= (u_int64_t) pagetok (vms->vm_rssize);
>                         /* <<LOG1024 removed, we wanna have kb */
>


----------------------------------------------------------------------------
----


> --
> To unsubscribe:
> http://lists.nongnu.org/mailman/listinfo/monit-general





reply via email to

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