How can I get FreeNAS and pfSense to report more using SNMP?

Solution 1:

After much research on this I discovered what the problem was. Both pfSense and FreeNAS provide SNMP support through the FreeBSD begemot SNMP daemon (bsnmpd). In order to provide memory usage, CPU usage, and Load Average information, the begemot SNMP daemon needs to have an additional module, snmp_ucd.so loaded.

I found the following forum thread explaining to load snmp_ucd.so, however it was not present on my two systems.

To resolve this, I created a virtual machine and installed FreeBSD 8.3 on it. Inside this virtual machine, I used the FreeBSD Ports system to download and build the required snmp_ucd.so library using:

cd /usr/ports/net-mgmt/bsnmp-ucd
make all install clean 
cd /usr/ports/net-mgmt/bsnmptools
make all install clean

After that, I used scp to copy /usr/local/lib/snmp_ucd.so from the FreeBSD virtual machine to both my pfSense server as well as my FreeNAS server.

I then used the FreeNAS GUI to add the following Auxiliary parameters:

begemotSnmpdModulePath."ucd" = "/mnt/Garrison/jail/usr/local/lib/snmp_ucd.so"

Screencap of FreeNAS

This added the line automatically to /etc/snmpd.config on the FreeNAS server and I was able to get graphs!

The pfSense server was more tricky since it didn't allow me to apply the change using the GUI, and the pfSense scripts would automatically rebuild /etc/snmpd.config, overwriting my changes. To get pfSense working, I had to edit /etc/inc/services.inc. Before the line which read:

fwrite($fd, $snmpdconf);

I added the following:

    //Josh Additions: Make load avg and CPU usage work:
    $snmpdconf .= <<<EOD
# Josh additions:
begemotSnmpdModulePath."ucd" = "/usr/local/lib/snmp_ucd.so"



EOD;

Then, disabling and re-enabling SNMP applied the change and CPU usage graphs work now! That change will almost certainly not persist across pfSense upgrades, but I couldn't find an easier, more stable way to apply the change.