Submit Hint Search The Forums LinksStatsPollsHeadlinesRSS
14,000 hints and counting!

Fix a bug in snmp output to show data for new Mac mini UNIX
I've searched for a command line tool to integrate in my mrtg page. It should fetch the temperature and fans peed from the system on my Mac mini. Apparently snmpd can do this.

After starting snmpd, I stumbled across /usr/share/snmp/SensorDat.xml. There is an entry there for my Mac mini, but it didn't workL:
    <key>MacMini3,1</key>
    <dict>
        <key>fan_data</key>
I downloaded the net-snmp-source from Apple, and found a test program in this directory:
net_snmp/Build/net-snmp/agent/mibgroup/ucd-snmp/data_access/


When I ran it, the program told me this:
$ ./sensors
No log handling enabled - turning on stderr logging
registered debug token sensors, 1
registered debug token access:lmSensors, 1
sensors:init: called
Couldn't find a table entry for the model name Macmini3,1
Sensor Data Collection not supported
sensors:shutdown: called
Looking at the output, the names differ:
  • Macmini3,1 is the system name.
  • MacMini3,1 is the key name in the XML!
After changing the key in SensorDat.xml to Macmini3,1 it works! Here's the output now:
$ ./sensors
No log handling enabled - turning on stderr logging
registered debug token sensors, 1
registered debug token access:lmSensors, 1
sensors:init: called
access:lmSensors: === Type: temp_data ===
access:lmSensors: converted 11744 to 45875
access:lmSensors: saved index 1 for CPU heatsink temp
access:lmSensors: Inserted key CPU heatsink temp: value 45875
access:lmSensors: converted 15744 to 61500
access:lmSensors: saved index 2 for MCP die temp
access:lmSensors: Inserted key MCP die temp: value 61500
access:lmSensors: converted 11392 to 44500
access:lmSensors: saved index 3 for HDD case temp
access:lmSensors: Inserted key HDD case temp: value 44500
access:lmSensors: converted 11872 to 46375
access:lmSensors: saved index 4 for CPU die temp
access:lmSensors: Inserted key CPU die temp: value 46375
access:lmSensors: Container sensors pre-load container, 4 entries
sensors:container: free_items
access:lmSensors: === Type: fan_data ===
access:lmSensors: saved index 5 for Fan RPM
access:lmSensors: Inserted key Fan RPM: value 6007
access:lmSensors: Container sensors pre-load container, 1 entries
sensors:container: free_items
access:lmSensors: === Type: volt_data ===
access:lmSensors: converted 7520 to 29375
access:lmSensors: saved index 6 for CPU Vcore voltage
access:lmSensors: Inserted key CPU Vcore voltage: value 29375
access:lmSensors: converted 61376 to 239750
access:lmSensors: saved index 7 for DC IN voltage
access:lmSensors: Inserted key DC IN voltage: value 239750
access:lmSensors: converted 14851 to 58011
access:lmSensors: saved index 8 for NB Vcore voltage
access:lmSensors: Inserted key NB Vcore voltage: value 58011
access:lmSensors: Container sensors pre-load container, 3 entries
sensors:container: free_items
sensors:container: free_items
sensors:shutdown: called
I hope this helps; maybe it's possible to extend this file for use with other systems.
    •    
  • Currently 2.67 / 5
  You rated: 4 / 5 (12 votes cast)
 
[6,517 views]  

Fix a bug in snmp output to show data for new Mac mini | 3 comments | Create New Account
Click here to return to the 'Fix a bug in snmp output to show data for new Mac mini' hint
The following comments are owned by whoever posted them. This site is not responsible for what they say.
Fix a bug in snmp output to show data for new Mac mini
Authored by: boecko on Apr 01, '10 12:15:19PM
After integrating the snmp-values in mrtg.cfg you'll get something like the picture routers2cgi.png if you use the routers2cgi-package
the snmp-oids are:
CPU-Fan
.1.3.6.1.4.1.2021.13.16.3.1.3.5

CPU heatsink
.1.3.6.1.4.1.2021.13.16.2.1.3.1
CPU die
.1.3.6.1.4.1.2021.13.16.2.1.3.4


[ Reply to This | # ]
Fix a bug in snmp output to show data for new Mac mini
Authored by: The Eck on Apr 01, '10 04:36:56PM

"It should fetch the temperature and fans peed from the system..."

Holy cow! Is there a way to prevent the fans from peeing on the system? :-)



[ Reply to This | # ]
Fix a bug in snmp output to show data for new Mac mini
Authored by: leamanc on Apr 01, '10 05:57:35PM

A new classic spell check failure (when there is no spelling mistake, but it's not what you meant to say:

fans peed
instead of:
fan speed

[ Reply to This | # ]