How to get memory usage reported in SNMP under Mac OS X 10.8 Server

mac-osx-servermemory usagesnmp

I have two servers running Mac OS X 10.8.3 Server (Build 12D78) with SNMP reporting enabled. I have a cacti server set up collecting data from these hosts. My Load Average, CPU Usage, Disk Space Usage and network graphs all look great! But memory usage is all -nan across the board.

I saw this related question but it's so old I believe it is not valid for OS X Server 10.8.

When I run snmpwalk -v2c -c communityname 10.100.10.10 .1.3.6.1.4.1.2021.4 against the Mac OS X server, I get:

UCD-SNMP-MIB::memIndex.0 = INTEGER: 0
UCD-SNMP-MIB::memErrorName.0 = STRING: swap
UCD-SNMP-MIB::memMinimumSwap.0 = INTEGER: 16000 kB

Compare that to a FreeBSD server on my network:

kyle:~ dfjosh$ snmpwalk -v2c -c communityname 10.100.1.1 .1.3.6.1.4.1.2021.4
UCD-SNMP-MIB::memIndex.0 = INTEGER: 0
UCD-SNMP-MIB::memErrorName.0 = STRING: swap
UCD-SNMP-MIB::memTotalSwap.0 = INTEGER: 2097024 kB
UCD-SNMP-MIB::memAvailSwap.0 = INTEGER: 2097024 kB
UCD-SNMP-MIB::memTotalReal.0 = INTEGER: 504028 kB
UCD-SNMP-MIB::memAvailReal.0 = INTEGER: 27336 kB
UCD-SNMP-MIB::memTotalFree.0 = INTEGER: 34092 kB
UCD-SNMP-MIB::memMinimumSwap.0 = INTEGER: 16000 kB
UCD-SNMP-MIB::memShared.0 = INTEGER: 124432 kB
UCD-SNMP-MIB::memBuffer.0 = INTEGER: 60320 kB
UCD-SNMP-MIB::memCached.0 = INTEGER: 6756 kB
UCD-SNMP-MIB::memSwapError.0 = INTEGER: noError(0)
UCD-SNMP-MIB::memSwapErrorMsg.0 = STRING: 
kyle:~ dfjosh$ snmpwalk -v2c -c farcry 10.100.10.10 .1.3.6.1.4.1.2021.4
UCD-SNMP-MIB::memIndex.0 = INTEGER: 0
UCD-SNMP-MIB::memErrorName.0 = STRING: swap
UCD-SNMP-MIB::memMinimumSwap.0 = INTEGER: 16000 kB

I tried compiling and installing net-SNMP from scratch, biut it didn't change the data returned.

How can I get Mac OS X Server to report memory usage (and, ideally, swap or page in/ous) via SNMP?

Best Answer

Probably silly question, but have you compared the config files between the BSD and the OS X Server?

Additionally have you compared the compile time configuration options between the machines?

'--build=x86_64-linux-gnu' '--includedir=/usr/include' '--mandir=/usr/share/man' '--
 infodir=/usr/share/info' '--localstatedir=/var' '--libexecdir=/usr/lib/net-snmp' '--disable-
 maintainer-mode' '--disable-dependency-tracking' '--prefix=/usr' '--sysconfdir=/etc' '--
 mandir=/usr/share/man' '--with-persistent-directory=/var/lib/snmp' '--enable-ucd-snmp-compatibility' 
 '--enable-shared' 'CFLAGS=-g -O2 -fstack-protector --param=ssp-buffer-size=4 -Wformat -Werror=format-
 security' 'CPPFLAGS=-D_FORTIFY_SOURCE=2' 'CXXFLAGS=-g -O2 -fstack-protector --param=ssp-buffer-size=4 
-Wformat -Werror=format-security' 'FFLAGS=-g -O2' 'LDFLAGS=-Wl,-Bsymbolic-functions -Wl,-z,relro' '--
 with-perl-modules=INSTALLDIRS=vendor' '--enable-as-needed' '--enable-ipv6' '--with-logfile=none' '--
 without-rpm' '--with-libwrap' '--with-openssl' '--without-dmalloc' '--without-efence' '--without-
 rsaref' '--with-sys-contact=root' '--with-sys-location=Unknown' '--with-mib-modules=smux ucd- 
 snmp/dlmod ucd-snmp/diskio ucd-snmp/lmSensors  host' '--with-out-mib-modules=' '--enable-mfd-rewrites' '

This is what I have on my Linux machine with the Sensors for memory included.

Related Topic