I would like to monitor my machine that is running on macOS with the SNMP sensors of PRTG. How do I activate SNMP on macOS so that PRTG can query values for disk free, load average, and others via SNMP?
This article applies to PRTG Network Monitor 19 or later
Activate SNMP on macOS and Monitor with PRTG
Current macOS versions include SNMP by default. There is a basic setup assistant that you can use to configure SNMP on your macOS machine.
Step 1: Back Up the snmpd.conf File
On your macOS machine, open the Terminal app, locate the snmpd.conf file under /etc/snmp/snmpd.conf, and save a backup copy. You can use the following command:
sudo cp /etc/snmp/snmpd.conf /etc/snmp/snmpd.conf.org
Step 2: Adapt the snmpd.conf File
In the Terminal, enter the following command to start the setup assistant:
sudo snmpconf -g basic_setup
Follow the setup questions to configure SNMP to your needs.
Note: We recommend that you explicitly configure read-only access for SNMP v1 and SNMP v2c. This is because the default configuration value for the SNMP community string is public and therefore access is not secured.
Step 3: Start the SNMP Daemon
To start the SNMP daemon, use the following command:
sudo launchctl load -w /System/Library/LaunchDaemons/org.net-snmp.snmpd.plist
Step 4: Create SNMP Sensors
In PRTG, create a new device that represents your macOS machine using the respective IP address or DNS name.
- For this new device, run an auto-discovery to let PRTG automatically create some SNMP sensors.
- You can manually add further SNMP sensors. Not all measurements will be available via SNMP, but you should be able to create the following sensor types:
- SNMP Traffic sensor to monitor traffic on the network cards
- SNMP Linux Load Average sensor (this sensor works although it is intended for Linux operating systems)
- SNMP System Uptime sensor to monitor how long the system has been running
- SNMP Disk Free sensor to monitor free disk space
- SNMP CPU Load sensor to monitor the load of each CPU
- The auto-discovery might also find several generic SNMP values such as Internet Control Message Protocol (ICMP) errors or User Datagram Protocol (UDP) datagrams.
Step 5: Add the SNMP Daemon to Automatic Startup
Because you manually started the SNMP daemon in Step 3, the daemon will not run after you restart your macOS system.
Best practice is to automatically start the SNMP daemon at system startup. To add your SNMP daemon to automatic startup, you can edit the file /etc/hostconfig.
In the file, locate the line
and add the following entry before APPLETALK_HOSTNAME:
/etc/hostconfig appears to be gone in El Capitan. How can we configure SNMP to run automatically on the newest version of OSX?
Please check this link for an SNMP configuration guide for the El Capitan OS.
Best regards, Felix