Out of the box, FreeBSD’s default SNMP daemon bsnmpd(1) does not support the UCD-SNMP-MIBs which is where all the “good stuff” like CPU, disk, network and memory that us sysadmins like to monitor. Adding this module is as easy as installing the bsnmp-ucd port and doing a quick update to bsnmp’s config file:
$ cd /usr/ports/net-mgmt/bsnmp-ucd/ $ make install clean
Once that module is installed all we need to do is add these lines to end of /etc/snmpd.config:
# # bsnmp-ucd (8) # begemotSnmpdModulePath."ucd" = "/usr/local/lib/snmp_ucd.so"
Finally we just need to restart bsnmpd to have it load the new module:
$ /etc/rc.d/bsnmpd restart
Stopping bsnmpd.
Starting bsnmpd.
Note: This assumes you have the following in your /etc/rc.conf:
bsnmpd_enable="YES"
That’s it! You should be able to retrieve full disk, CPU and memory information (as well as a bunch of other things UCD’s MIB adds) via SNMP queries!
I’ve done this, but bsnmpwalk doesn’t display the UCD elements. What else needs to be done to include the MIB in the default view?
Doing a full walk should pick it up:
snmpwalk -Ou -v 1 -c
The MIB you load is up to you a that happens on the “client” side, but something like this should pull up CPU load without MIB:
snmpwalk -Ou -v 1 -c
It has been a while since I’ve worked with this though as we’ve moved to agent based monitoring for FreeBSD hosts.
How does that work? I’ve hated SNMP since day 1.
We use Zabbix, it’s been great. We were using a mix of SNMP and Xymon before. Zabbix is much nicer and a lot more in line with what we needed as an MSP.
They don’t have an agent for FreeBSD 9?
They have server, proxy and agents in ports for FreeBSD.