Fix a bug in snmp output to show data for new Mac mini
Apr 01, '10 07:30:00AM • Contributed by: boecko
Apr 01, '10 07:30:00AM • Contributed by: boecko
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:
When I ran it, the program told me this:
Looking at the output, the names differ:
I hope this helps; maybe it's possible to extend this file for use with other systems.
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
- Macmini3,1 is the system name.
- MacMini3,1 is the key name in the XML!
$ ./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
•
[6,771 views]
