I am an snmp beginner and have created a custom MIB and included it in snmpd.conf via pass persist.
pass_persist .1.3.6.1.4.1.56947.1.1 /usr/bin/env python3 -u my_script.py
While I can successfully query the data, the returned data is a mix between the OIDs and the textual representation of OIDs.
Something like
SNMPv2-SMI::enterprises.56947.1.1.1
If I query, for example the UCD MIB (.1.3.6.1.4.1.2021)
I get the full textual representation, like UCD-SNMP-MIB::memIndex.0
which corresponds to .1.3.6.1.4.1.2021.4.1
As far as I know the UCD Mibs have been merged into net-snmp itself and may work differently than my own MIB.
My MIB (ommited some parts for brevity)
MY-MIB DEFINITIONS ::= BEGIN
IMPORTS
MODULE-IDENTITY, enterprises, Integer32
FROM SNMPv2-SMI
myMIB MODULE-IDENTITY
-- identify stuff
::= { enterprises 56947 }
product1 OBJECT IDENTIFIER ::= { myMIB 1 }
product1Data OBJECT IDENTIFIER ::= { product1 1 }
objectCount OBJECT-TYPE
SYNTAX Integer32
MAX-ACCESS read-only
STATUS current
DESCRIPTION "test"
::= { product1Data 1 }
END
But is this behavior by design or am I missing something?
My excpectation/wish would be to receive something like MY-MIB::objectCount
SNMPv2-SMI::enterprises.56947.1.1.1
– Lex Li Feb 23 at 14:39/usr/share/snmp/mibs
where I found all the other MIBS. Does the file name have to correspond to the name atDEFINITIONS
in the file? – Arikael Feb 23 at 16:00snmpwalk
andsnmptranslate
use the config/etc/snmp/snmp**d**.conf
but they use/etc/snmp/snmp.conf
. In this config (on the manager machine) I added the linemibs +MY-MIB
and it worked. Also add your mib file to your manager/client – Arikael Feb 24 at 8:55