Hi Stuart,

Thanks for this. However I think I'm still missing something.. Sorry ;)

On 24 Apr 2015, at 00:37, Stuart Henderson <s...@spacehopper.org> wrote:

> On 2015-04-23, andy <a...@brandwatch.com> wrote:
>> Hi,
>>
>> This should be a simple one ;)
>>
>> I have configured and started snmpd, and then used snmpwalk ("snmpwalk
>> -v2c -c public 127.0.0.1:161 .") to walk the oid tree, and the only branch
>> I see is OPENBSD-PF-MIB. Tested on 5.6.
>>
>> I don't seem to see any output for OPENBSD-BASE-MIB.txt,
>> OPENBSD-CARP-MIB.txt, OPENBSD-MEM-MIB.txt, OPENBSD-RELAYD-MIB (pending
>> 5.7), and OPENBSD-SENSORS-MIB.txt.
>>
>> What do we need to do to enable these? Or is snmpwalk just missing them?
>> I'm being dumb?
>>
>> Cheers, Andy.
>>
>
> You need to start the walk from a suitable location. "If no OID argument
> is present, snmpwalk will search the subtree rooted at SNMPv2-SMI::mib-2
> (including any MIB object values from other MIB modules, that are
> defined as lying within this subtree)."
>
> The following examples assume that you have the OpenBSD MIBs loaded (these
> are setup by default in the net-snmp package, but you'll need to add them
> yourself if querying from another OS).
>
> $ snmpwalk -v2c -c public localhost SNMPv2-MIB::sysORID
> SNMPv2-MIB::sysORID.1 = OID: SNMPv2-SMI::mib-2
> SNMPv2-MIB::sysORID.2 = OID: IP-MIB::ip
> SNMPv2-MIB::sysORID.3 = OID: IP-FORWARD-MIB::ipForward
> SNMPv2-MIB::sysORID.4 = OID: SNMPv2-MIB::snmp
> SNMPv2-MIB::sysORID.5 = OID: BRIDGE-MIB::dot1dBridge
> SNMPv2-MIB::sysORID.6 = OID: HOST-RESOURCES-MIB::host
> SNMPv2-MIB::sysORID.7 = OID: IF-MIB::ifMIB
> SNMPv2-MIB::sysORID.8 = OID: SNMPv2-SMI::enterprises.2021.13.15
> SNMPv2-MIB::sysORID.9 = OID: OPENBSD-BASE-MIB::pfMIBObjects
> SNMPv2-MIB::sysORID.10 = OID: OPENBSD-BASE-MIB::sensorsMIBObjects
> SNMPv2-MIB::sysORID.11 = OID: OPENBSD-BASE-MIB::memMIBObjects
> SNMPv2-MIB::sysORID.12 = OID: OPENBSD-BASE-MIB::carpMIBObjects
> SNMPv2-MIB::sysORID.13 = OID: SNMPv2-SMI::snmpModules.10.2.1
> SNMPv2-MIB::sysORID.14 = OID: SNMPv2-SMI::snmpModules.15.1.1

So SNMPv2-MIB::sysORID shows me all of the OID roots the system offers :)

[LIVE]root@ar1301:/usr/local/share/snmp/mibs# snmpwalk -v2c -c public
127.0.0.1:161 SNMPv2-MIB::sysORID
SNMPv2-MIB::sysORID.1 = OID: SNMPv2-SMI::mib-2
SNMPv2-MIB::sysORID.2 = OID: IP-MIB::ip
SNMPv2-MIB::sysORID.3 = OID: IP-FORWARD-MIB::ipForward
SNMPv2-MIB::sysORID.4 = OID: SNMPv2-MIB::snmp
SNMPv2-MIB::sysORID.5 = OID: BRIDGE-MIB::dot1dBridge
SNMPv2-MIB::sysORID.6 = OID: HOST-RESOURCES-MIB::host
SNMPv2-MIB::sysORID.7 = OID: IF-MIB::ifMIB
SNMPv2-MIB::sysORID.8 = OID: SNMPv2-SMI::enterprises.2021.13.15
SNMPv2-MIB::sysORID.9 = OID: OPENBSD-BASE-MIB::pfMIBObjects
SNMPv2-MIB::sysORID.10 = OID: OPENBSD-BASE-MIB::sensorsMIBObjects
SNMPv2-MIB::sysORID.11 = OID: OPENBSD-BASE-MIB::memMIBObjects
SNMPv2-MIB::sysORID.12 = OID: OPENBSD-BASE-MIB::carpMIBObjects
SNMPv2-MIB::sysORID.13 = OID: SNMPv2-SMI::snmpModules.10.2.1
SNMPv2-MIB::sysORID.14 = OID: SNMPv2-SMI::snmpModules.15.1.1
>
> $ snmpwalk -v2c -c public localhost OPENBSD-BASE-MIB::carpMIBObjects
> OPENBSD-CARP-MIB::carpAllow.0 = INTEGER: true(1)
> OPENBSD-CARP-MIB::carpPreempt.0 = INTEGER: 0
> OPENBSD-CARP-MIB::carpLog.0 = INTEGER: false(2)
> OPENBSD-CARP-MIB::carpIfNumber.0 = INTEGER: 0
> OPENBSD-CARP-MIB::carpIpPktsRecv.0 = Counter64: 0
> OPENBSD-CARP-MIB::carpIp6PktsRecv.0 = Counter64: 0
> OPENBSD-CARP-MIB::carpPktDiscardsForBadInterface.0 = Counter64: 0
> OPENBSD-CARP-MIB::carpPktDiscardsForWrongTtl.0 = Counter64: 0
> OPENBSD-CARP-MIB::carpPktShorterThanHeader.0 = Counter64: 0
> OPENBSD-CARP-MIB::carpPktDiscardsForBadChecksum.0 = Counter64: 0
> OPENBSD-CARP-MIB::carpPktDiscardsForBadVersion.0 = Counter64: 0
> OPENBSD-CARP-MIB::carpPktDiscardsForTooShort.0 = Counter64: 0
> OPENBSD-CARP-MIB::carpPktDiscardsForBadAuth.0 = Counter64: 0
> OPENBSD-CARP-MIB::carpPktDiscardsForBadVhid.0 = Counter64: 0
> OPENBSD-CARP-MIB::carpPktDiscardsForBadAddressList.0 = Counter64: 0
> OPENBSD-CARP-MIB::carpIpPktsSent.0 = Counter64: 0
> OPENBSD-CARP-MIB::carpIp6PktsSent.0 = Counter64: 0
> OPENBSD-CARP-MIB::carpNoMemory.0 = Counter64: 0
> OPENBSD-CARP-MIB::carpTransitionsToMaster.0 = Counter64: 0
>
> You can use "iso.org.dod.internet.private.enterprises.openBSD" to show all
of
> the vendor OIDs. And you can use snmpctl rather than Net-SNMP; e.g.

I tried this, but I don't see all of the OID's, I only see OPENBSD-PF-MIB at
iso.org.dod.internet.private.enterprises.openBSD;

[LIVE]root@ar1301:/usr/local/share/snmp/mibs# snmpctl walk 127.0.0.1 oid
iso.org.dod.internet.private.enterprises.openBSD | wc -l
    1289
[LIVE]root@ar1301:/usr/local/share/snmp/mibs# snmpwalk -v2c -c public
127.0.0.1:161 OPENBSD-PF-MIB::pfMIBObjects | wc -l
    1290
[LIVE]root@ar1301:/usr/local/share/snmp/mibs# snmpwalk -v2c -c public
127.0.0.1:161 .1.3.6.1.4.1.30155 | wc -l
    1290

The output from these 3 commands is the same (I.e. only the PF-MIB).

Is there a single command that will show/walk every single OID and value snmpd
provides?

>
> $ snmpctl walk sym oid iso.org.dod.internet.private.enterprises.openBSD |
head
> openBSD.pfMIBObjects.pfInfo.pfRunning.0=1
> openBSD.pfMIBObjects.pfInfo.pfRuntime.0=74529800
> openBSD.pfMIBObjects.pfInfo.pfDebug.0=3
> openBSD.pfMIBObjects.pfInfo.pfHostid.0="0xb438d4c7"
> openBSD.pfMIBObjects.pfCounters.pfCntMatch.0=1662286
> openBSD.pfMIBObjects.pfCounters.pfCntBadOffset.0=0
> openBSD.pfMIBObjects.pfCounters.pfCntFragment.0=3
> openBSD.pfMIBObjects.pfCounters.pfCntShort.0=2
> openBSD.pfMIBObjects.pfCounters.pfCntNormalize.0=0
> openBSD.pfMIBObjects.pfCounters.pfCntMemory.0=0
>
> AFAIK the relayd support is only so that relayd can send traps, I don't
think
> it provides anything that you can query.
>



The reason I would like to see "everything" is to confirm all the branches
snmpd provides, because I would like to combine the use of both net-snmp and
snmpd..

I.e. Run snmpd on 127.0.0.1:161, and run net-snmp on the interface IP, and
then add proxy directives to net-snmp to forward all the branches snmpd
provides to 127.0.0.1:161 (snmpd).
https://www.packetmischief.ca/2012/02/26/net-snmp-and-snmpd-coexistence-on-op
enbsd/

This all works perfectly and means you also get all the other system OID
provided by net-snmp to give the maximum about oid's possible from OpenBSD,
but I need to know what branches to proxy to snmpd?

Currently I have;
/etc/snmp/snmpd.conf

agentAddress  udp:10.0.4.3:161
proxy -v2c -c brandwatch 127.0.0.1:161 OPENBSD-BASE-MIB::pfMIBObjects
proxy -v2c -c brandwatch 127.0.0.1:161 OPENBSD-BASE-MIB::sensorsMIBObjects
proxy -v2c -c brandwatch 127.0.0.1:161 OPENBSD-BASE-MIB::memMIBObjects
proxy -v2c -c brandwatch 127.0.0.1:161 OPENBSD-BASE-MIB::carpMIBObjects

This passes all lookups on these 4 OID's to OpenBSD's snmpd, and net-snmp
handles all the others.

> SNMPv2-MIB::sysORID
> OPENBSD-BASE-MIB::carpMIBObjects

Does this makes sense, and can you recommend any other OID's?

Thanks, Andy.

Reply via email to