Friday 14 March 2014

Apple: Enable SNMP on Mac OS X for PRTG Monitoring

The steps below allow you to enable the SNMP on Mac OS X for PRTG monitoring.

<< Step 1 >>
On your Mac OS machine start the Terminal, locate the snmpd.conf file under /etc/snmp/snmpd.conf and save a backup copy, maybe with this command:
mv /etc/snmp/snmpd.conf /etc/snmp/snmpd.conf.org


<< Step 2 >>
Change the snmpd.conf file with the following command:
sudo nano /etc/snmp/snmpd.conf

In our example, it looks like this:
#Allow read-access with the following SNMP Community String:
rocommunity public

# all other settings are optional but recommended.

# Location of the device
syslocation data centre A

# Human Contact for the device
syscontact SysAdmin

# System Name of the device
sysName SystemName

# the system OID for this device. This is optional but recommended,
# to identify this as a MAC OS system.
sysobjectid 1.3.6.1.4.1.8072.3.2.16



<< Step 3 >>
Start the SNMP service, e.g. with the following command:
sudo launchctl load -w /System/Library/LaunchDaemons/org.net-snmp.snmpd.plist


<< Step 4 >>
In PRTG, create a new device which represents your Mac OS machine, using the respective IP address or DNS name.
  • For this new device, perform an auto-discovery to let PRTG automatically create SNMP sensors. This will create some sensors.
  • You can further add other SNMP sensors manually. Not all measurements will be available via SNMP, but we were able to successfully create the following sensor types:
  • SNMP Traffic sensors to monitor traffic flowing through the network card(s)
  • SNMP Linux Load Average sensor (this one works although it is intended for Linux OS)
  • SNMP System Uptime to monitor how long the system has been running
  • SNMP Disk Free sensors to monitor free disk space
  • SNMP CPU Load sensor to monitor the load of each CPU
  • Several generic SNMP values such as ICMP errors, UPD datagrams, etc. which were found by the auto-discovery.


<< Step 5 >>
Since we started the SNMP service manually in Step 3, the service will not run after a reboot of the Mac OS system.

In order to start the SNMP service automatically on your Mac OS' system startup you can edit the file /etc/hostconfig.

In the file, locate the line
APPLETALK_HOSTNAME

and add the following entry before this line:  
SNMPSERVER:=-YES-

This should start your SNMP service automatically on system startup.


Reference:
How do I activate SNMP on Mac OS in order to monitor it with PRTG?
http://www.paessler.com/knowledgebase/en/topic/41843-how-do-i-activate-snmp-on-mac-os-in-order-to-monitor-it-with-prtg

No comments:

Post a Comment