Thank you Dave.

Now it is becoming clearer to me.

I read
/usr/ports/net-mgmt/net-snmp/work/net-snmp-5.4.1.2/agent/mibgroup/hardware/memory
but still don't know why the hrStorageUsed.1 is different from that
calculated from
sysctl.

I am using the 'free' script from
http://www.cyberciti.biz/faq/freebsd-command-to-get-ram-information/memory_freebsd.c
to find out the total used memory. { hw.physmem - ( (
vm.stats.vm.v_inactive_count + vm.stats.vm.v_cache_count +
> vm.stats.vm.v_free_count ) * hw.pagesize ) }

I can live with the slight discrepancy and use hrStorageUsed.1 as the total
used memory.

Thank you once again.


On Tue, Aug 12, 2008 at 2:21 AM, Dave Shield <[EMAIL PROTECTED]>wrote:

> 2008/8/12 Chee Meng Gui <[EMAIL PROTECTED]>:
> > So the hrStorageEntry.hrStorageUsed.1  is in kilobytes?
>
> hrStorageUsed is reported in the units specified in hrStorageUnits.
> So if hrStorageUnits.1 is 1024, then hrStorageUsed.1 is in Kb
>
>
> > When I checked this result against the used memory output of sysctl {
> > hw.physmem - ( ( vm.stats.vm.v_inactive_count + vm.stats.vm.v_cache_count
> +
> > vm.stats.vm.v_free_count ) * hw.pagesize ) } , the two were not equal.
>
> On FreeBSD with the latest (5.4.x) agent,  "Physical memory" is
> retrieved by running sysctl on HW_USERMEM.   Most of the other
> values are calculated by running sysctl on VM_METER
>
> See 'agent/mibgroup/hardware/memory/memory_freebsd.c'
> for the details.
>
> Dave
>
-------------------------------------------------------------------------
This SF.Net email is sponsored by the Moblin Your Move Developer's challenge
Build the coolest Linux based applications with Moblin SDK & win great prizes
Grand prize is a trip for two to an Open Source event anywhere in the world
http://moblin-contest.org/redirect.php?banner_id=100&url=/
_______________________________________________
Net-snmp-users mailing list
Net-snmp-users@lists.sourceforge.net
Please see the following page to unsubscribe or change other options:
https://lists.sourceforge.net/lists/listinfo/net-snmp-users

Reply via email to