Add a new MIB (TCP-MIB rfc4022) for bsnmpd

I have a project in which I am trying to pull pids for open network connections through SNMP. I'm running the included bsnmpd daemon on FreeBSD 10-RELEASE. The default distribution does not include TCP-MIB, and I am at a loss for how to actually add it. Is there a way to add other MIBs to bsnmp? If so, how?
 
I don't think I've used bsnmp yet but for net-mgmt/net-snmp you need to store the MIB files in /usr/local/share/snmp/mibs. You then need to add each of those files to snmp.conf. I'm sure bsnmp has a similar configuration.
 
GROND said:
I know that net-mgmt/net-snmp includes TCP-MIB, but to be honest, I've never managed to get the service to start.
It can be a bit tricky to get going. Move or delete any existing snmp.conf/snmpd.conf and run snmpconf(1). That should create a basic, working, configuration. Once it's working you can modify them to suit your needs.
 
Hi @SirDice,

I need to add BGP4-MIB to the SNMP agent. I was just there in the snmpd.conf and the snmp.conf does not exist that add into snmp.conf this code:
Code:
mibs +BGP4-MIB

And before that, I copy BGP4-MIB.txt to /usr/local/share/snmp/mibs but no Walk BGP:
Code:
snmpwalk -v2c -c public localhost 1.3.6.1.2.1.15 
SNMPv2-SMI::mib-2.15 = No Such Object available on this agent at this OID

Then I add snmp.conf to /usr/local/share/snmp and add above code and so no walk BGP:
Code:
snmpwalk -v2c -c public localhost 1.3.6.1.2.1.15 
MIB search path: /root/.snmp/mibs:/usr/local/share/snmp/mibs
Cannot find module (BGP4-MIB): At line 0 in (none)
SNMPv2-SMI::mib-2.15 = No Such Object available on this agent at this OID

Help me please. Thanks.
 
Last edited by a moderator:
It's possible the MIB you added is depending on other MIBs. And simply loading an MIB doesn't make the values available. Even without MIBs you should still be able to get the values. The MIB just makes it easier to read for us mortals.
 
I see BGP4-MIB.txt and it only import from SNMPv2-SMI and RFC1213-MIB , that MIBs are exist in agent.
Code:
IMPORTS
                    MODULE-IDENTITY, OBJECT-TYPE, NOTIFICATION-TYPE,
                    IpAddress, Integer32, Counter32, Gauge32
                        FROM SNMPv2-SMI
                    mib-2
                        FROM RFC1213-MIB;

SirDice said:
Even without MIBs you should still be able to get the values.
How get the values? With snmpget(1)?
 
I think
Code:
SNMPv2-SMI::mib-2.15 = No Such Object available on this agent at this OID
means that SNMPv2-SMI::mib-2.15 (SNMPv2-SMI::mib-2.bgp) does not exist. My mistake.

I downloaded BGP4-MIB from another site and tried again and I succeeded.
Thanks a lot.
 
Back
Top