# bsnmpd and bsnmp-ucd: no UCD related output



## patpro (Oct 27, 2011)

Hello,

I'm running various releases of FreeBSD (8.1, 8.2, 7.3...) and I've enabled SNMPD service on them for few days now. I'm very new to snmp, but I've read few things about it, and especially about FreeBSD's implementation bsnmpd.

I've installed complementary software: bsnmp-ucd and bsnmptools. And I've configured /etc/snmpd.config to load the ucd module:


```
# grep begemotSnmpdModulePath /etc/snmpd.config 
begemotSnmpdModulePath."mibII"	= "/usr/lib/snmp_mibII.so"
begemotSnmpdModulePath."netgraph" = "/usr/lib/snmp_netgraph.so"
begemotSnmpdModulePath."pf"	= "/usr/lib/snmp_pf.so"
begemotSnmpdModulePath."hostres" = "/usr/lib/snmp_hostres.so"
#begemotSnmpdModulePath."bridge" = "/usr/lib/snmp_bridge.so"
begemotSnmpdModulePath."ucd" = "/usr/local/lib/snmp_ucd.so"
```

But it seems I can't get any value/info from the ucd module. I've made a bsnmpwalk from localhost and a snmpwalk from a remote host, I've commented out the module and restarted bsnmpd, then made a new (b)snmpwalk, but outputs looks the same. Of course counters and values differ, but outputs of snmpwalks with UCD won't read any extra information compared to outputs of snmpwalks without UCD loaded.

Am I missing something?


----------



## idle (Nov 3, 2011)

I prefer using net-snmp (as everyone does), with proxying to bsnmpd for some special mibs, such as pf.


----------



## patpro (Nov 4, 2011)

hmm. I was not aware proxying to bsnmpd was an option, but still, I'll stick with bsnmpd. I've discussed my problem via email with bsnmp-ucd port developer. It appears that there might be a slight issue in bsnmp-ucd or bsnmpd that prevent UCD info to come out of a simple snmpwalk. If you add the OID of bsnmp-ucd into the snmpwalk command, the data is correctly sent by the remote bsnmpd:


```
$ snmpwalk -v2c -c public <TARGET_IP> UCD-SNMP-MIB::ucdavis | grep -c UCD
104
$ snmpwalk -v2c -c public <TARGET_IP> | grep -c UCD
2
```


----------



## idle (Nov 4, 2011)

snmpwalk doesn't use for information gathering, there is snmpget for this purpose, which works properly, since it addresses directly.

```
#snmpwalk -v2c -c public localhost | grep -c UCD
1
#snmpwalk -v2c -c public localhost UCD-SNMP-MIB::ucdavis | grep -c UCD
101
#snmpget -v2c -c public localhost UCD-SNMP-MIB::versionTag.0
UCD-SNMP-MIB::versionTag.0 = STRING: 5.5
```


----------



## patpro (Nov 5, 2011)

I know that, on a scheduled basis, you pull only the value you need for monitoring purpose. But as I wrote in my first post, I'm new to snmp, and I need a lot of wandering/exploration to grasp this powerful tool. And by the way, snmpwalk is supposed to walk the whole tree. How would I know something is available if the walk is not comprehensive?


----------



## phoenix (Nov 5, 2011)

Does it work if you add *-m all* to the snmpwalk command:
`$ snmpwalk -v2c -c public -m all localhost`

That tells snmpwalk to load *ALL* the MIB files you have stored under /usr/share/snmp/mibs/


----------



## patpro (Nov 6, 2011)

On localhost I have only bsnmpwalk, which doesn't include such a flag. 
Remote host has obviously no clue about local /usr/share/snmp/mibs/ files, but still, a remote snmpwalk with -m all flag fetches about 250 more lines, all of them in the TCP-MIB:: tree. Nothing about UCD.

By the way, it's worth noting that bsnmp-ucd comes with a def file and a MIB file, but none of them is installed in /usr/share/snmp/, because of port policy (I guess). I've installed those files myself.


----------



## phoenix (Nov 9, 2011)

Does the remote host have the UCD MIB files installed under /usr/share/snmp/mib/ (or whatever directory the snmp tools use on that system)?


----------

