Erik Steggall
2015-05-08 00:40:36 UTC
I've created a custom MIB and I'm able to add the MIB to the agent (get and
set values work) but I'm unable to add the MIB so that the tools recognize
the names of my OIDs. Do I need to add anything to the .c/.h files in order
to get the naming to work correctly?
Pages I've read:
http://www.net-snmp.org/wiki/index.php/TUT:Using_and_loading_MIBS
http://www.net-snmp.org/wiki/index.php/FAQ:Applications_06
http://www.net-snmp.org/wiki/index.php/FAQ:Agent_06
More Info:
# This call fails and IDK why
# OIDs are definitely there...
SNMPv2-SMI::enterprises.45190.1.1.2.0 = STRING: "Peaxy Inc"
# Adding -m doesn't seem to help
SNMPv2-SMI::enterprises.45190.1.1.2.0 = STRING: "Peaxy Inc"
# Can't use names
# My mibdirs
#### Start MIB ####
PEAXY-SNMP-MIB DEFINITIONS ::= BEGIN
-- Peaxy Inc.
-- Author: Erik Q. Steggall
--
-- IMPORTS: Include definitions from other mibs here
--
IMPORTS
netSnmpExamples FROM NET-SNMP-EXAMPLES-MIB
OBJECT-TYPE, NOTIFICATION-TYPE, MODULE-IDENTITY,
Integer32, Opaque, enterprises, Counter32, Unsigned32
FROM SNMPv2-SMI
MODULE-COMPLIANCE, OBJECT-GROUP FROM SNMPv2-CONF
--
-- A brief description and update info about this mib
--
pxeSnmpMib MODULE-IDENTITY
LAST-UPDATED "201505050000Z"
ORGANIZATION "Peaxy Inc"
CONTACT-INFO "Postal: Erik Steggall
2380 Bering Dr,
San Jose, CA, 95131
email: ***@peaxy.net
"
DESCRIPTION "An MIB for Peaxy Inc."
::= { enterprises 45190 }
--
-- Define typical mib nodes
--
pxeMIBObjects OBJECT IDENTIFIER ::= { pxeSnmpMib 1 }
pxeMIBConformance OBJECT IDENTIFIER ::= { pxeSnmpMib 2 }
--
-- define objects
--
pxeAgentModules OBJECT IDENTIFIER ::= { pxeMIBObjects 1 }
pxeAgentModuleObject OBJECT-TYPE
SYNTAX Integer32
MAX-ACCESS read-write
STATUS current
DESCRIPTION
"This is an int to test snmp for PEAXY"
DEFVAL { 1 }
::= { pxeAgentModules 1 }
pxeAgentTestString OBJECT-TYPE
SYNTAX OCTET STRING
MAX-ACCESS read-write
STATUS current
DESCRIPTION
"This is a demo string, should hold PEAXY"
DEFVAL { 2 }
::= { pxeMIBObjects 2 }
END
#### End MIB ####
best,
- Erik S.
(530)400-6194
set values work) but I'm unable to add the MIB so that the tools recognize
the names of my OIDs. Do I need to add anything to the .c/.h files in order
to get the naming to work correctly?
Pages I've read:
http://www.net-snmp.org/wiki/index.php/TUT:Using_and_loading_MIBS
http://www.net-snmp.org/wiki/index.php/FAQ:Applications_06
http://www.net-snmp.org/wiki/index.php/FAQ:Agent_06
More Info:
# This call fails and IDK why
snmptranslate -m +PEAXY-SNMP-MIB -IR -Of pxeSnmpMib
Unknown object identifier: pxeSnmpMib# OIDs are definitely there...
snmpwalk localhost .1.3.6.1.4.1.45190
SNMPv2-SMI::enterprises.45190.1.1.1.0 = INTEGER: 42SNMPv2-SMI::enterprises.45190.1.1.2.0 = STRING: "Peaxy Inc"
# Adding -m doesn't seem to help
snmpwalk -m +PEAXY-SNMP-MIB localhost .1.3.6.1.4.1.45190
SNMPv2-SMI::enterprises.45190.1.1.1.0 = INTEGER: 42SNMPv2-SMI::enterprises.45190.1.1.2.0 = STRING: "Peaxy Inc"
# Can't use names
snmpwalk -m +PEAXY-SNMP-MIB localhost PEAXY-SNMP-MIB::pxeSnmpMib
PEAXY-SNMP-MIB::pxeSnmpMib: Unknown Object Identifier# My mibdirs
net-snmp-config --default-mibdirs
/root/.snmp/mibs:/usr/local/share/snmp/mibsls ~/.snmp/mibs/ | grep PEAXY
PEAXY-SNMP-MIB.txtls /usr/local/share/snmp/mibs/ | grep PEAXY
PEAXY-SNMP-MIB.txt#### Start MIB ####
PEAXY-SNMP-MIB DEFINITIONS ::= BEGIN
-- Peaxy Inc.
-- Author: Erik Q. Steggall
--
-- IMPORTS: Include definitions from other mibs here
--
IMPORTS
netSnmpExamples FROM NET-SNMP-EXAMPLES-MIB
OBJECT-TYPE, NOTIFICATION-TYPE, MODULE-IDENTITY,
Integer32, Opaque, enterprises, Counter32, Unsigned32
FROM SNMPv2-SMI
MODULE-COMPLIANCE, OBJECT-GROUP FROM SNMPv2-CONF
--
-- A brief description and update info about this mib
--
pxeSnmpMib MODULE-IDENTITY
LAST-UPDATED "201505050000Z"
ORGANIZATION "Peaxy Inc"
CONTACT-INFO "Postal: Erik Steggall
2380 Bering Dr,
San Jose, CA, 95131
email: ***@peaxy.net
"
DESCRIPTION "An MIB for Peaxy Inc."
::= { enterprises 45190 }
--
-- Define typical mib nodes
--
pxeMIBObjects OBJECT IDENTIFIER ::= { pxeSnmpMib 1 }
pxeMIBConformance OBJECT IDENTIFIER ::= { pxeSnmpMib 2 }
--
-- define objects
--
pxeAgentModules OBJECT IDENTIFIER ::= { pxeMIBObjects 1 }
pxeAgentModuleObject OBJECT-TYPE
SYNTAX Integer32
MAX-ACCESS read-write
STATUS current
DESCRIPTION
"This is an int to test snmp for PEAXY"
DEFVAL { 1 }
::= { pxeAgentModules 1 }
pxeAgentTestString OBJECT-TYPE
SYNTAX OCTET STRING
MAX-ACCESS read-write
STATUS current
DESCRIPTION
"This is a demo string, should hold PEAXY"
DEFVAL { 2 }
::= { pxeMIBObjects 2 }
END
#### End MIB ####
best,
- Erik S.
(530)400-6194