Download prebuilt package
The package can be downloaded from the Xsnmp 1.2.1 release page on github:
curl -O https://github.com/gjasny/Xsnmp/releases/download/v1.2.1/Xsnmp-1.2.1-300707-10.8.pkg
Or Build from source
Unfortunately Apple does not ship the pcre header file anymore with MacOSX. So I decided to link the xsnmp daemon against the static pcre library provided by MacPorts. First install pcre library
sudo port install pcre
Then clone and build the source repository
git clone git clone https://github.com/gjasny/Xsnmp.git
cd Xsnmp
git checkout v1.2.1
./build.sh
That should result in a package named Xsnmp-1.2.1-300707-10.8.pkg
.
Install the package
Either click on the package or install via command line
sudo installer -pkg Xsnmp-1.2.1-300707-10.8.pkg -target /
Configure SNMP deamon
The /etc/snmp/snmpd.conf needs to be changed to lower the access restrictions and enable the agentx directive (see https://gist.github.com/gjasny/6595882).
Replace
rocommunity public default .1.3.6.1.2.1.1.4
with
rocommunity public default
and uncomment the
master agentx
line.
Register SNMP deamon within launchd
launchctl load -w /System/Library/LaunchDaemons/org.net-snmp.snmpd.plist
Now the snmp daemon should be running. Test with:
snmpwalk -v1 -cpublic localhost system
Register Xsnmp daemon within launchd
launchctl load -w /Library/LaunchDaemons/com.xsnmp.xsnmp-agentx.plist
Now test Xsnmp:
snmpwalk -v1 -cpublic -m "+XSNMP-MIB" localhost enterprises.20038