2

I have been working on trying to get a value with a custom MIB through SNMP

This is my custom MIB:

MY-MIB DEFINITIONS ::= BEGIN

IMPORTS
    MODULE-IDENTITY, OBJECT-TYPE, Integer32, enterprises
        FROM SNMPv2-SMI
;

psutest MODULE-IDENTITY
    LAST-UPDATED    "201411250000Z"
    ORGANIZATION    "UW - System"
    CONTACT-INFO    "Bob"
    DESCRIPTION     "MIB for project"

    ::={ enterprises 214}

currentScalar       OBJECT IDENTIFIER ::= { psutest 2}
voltageScalar       OBJECT IDENTIFIER ::= { psutest 3}

currentScalar OBJECT-TYPE
    SYNTAX  Integer32
    MAX-ACCESS  read-only
    STATUS  current
    DESCRIPTION  "A simple object that holds the current current as a simple integer"

    ::= { psutest 2}

voltageScalar OBJECT-TYPE
    SYNTAX  Integer32
    MAX-ACCESS  read-only
    STATUS  current
    DESCRIPTION  "A simple object that holds the current voltage reading as a single integer"

    ::= { psutest 3}

END

Now when I do snmpget -v2c -c public localhost currentScalar.0 it returns MY-MIB::currentScalar.0 = No Such Object available on this agetn at this OID. I've already loaded the MIB by going through the tutorial here on the Net-snmp webiste Looking through this example MIB from microsoft, I feel like I might be doing somethign wrong with the lines:

currentScalar       OBJECT IDENTIFIER ::= { psutest 2}
voltageScalar       OBJECT IDENTIFIER ::= { psutest 3}

My snmpd.conf file is pretty basic:

agentAddress udp:161

view systemonly included .1.3.6.1.2.1.1
view systemonly included .1.3.6.1.2.1.25.1

rocommunity public efault .1.3.6.1
...
some system information stuff and active monitoring I haven't touched 
...

extend .1.3.6.1.4.1.214.2 /home/pi/networking/supply.sh

master agentx

Am I missing an entire object definition or something?

Funkyguy
  • 161
  • 1
  • 6
  • 1
    Try with `snmpget -m ALL -v2c -c public localhost currentScalar.0` – Janne Pikkarainen Dec 02 '14 at 07:42
  • @JannePikkarainen It returns the same error after looking through other mibs, printing out other things like: `Bad operator (INTEGER): At line 73 in /usr/share/mibs/ietf/SNMPv2-PDU` and `Undefined OBJECT-GROPU (diffServMultiFieldClfrNextFree): At line 2157 in /usr/share/mibs/ietf/IPSEC-SPD-MIB` and such – Funkyguy Dec 02 '14 at 07:50
  • @Funkyguy Hey bro did you find the solution for it? I'm stuck with the same from a couple of weeks. – Ashish Srivastava Sep 06 '17 at 11:16
  • @AshishSrivastava hey man, I'm sorry but I don't think I ever did. I'm pretty sure I just ended up submitting the theory of operation to my professor and left it at that. – Funkyguy Sep 06 '17 at 11:39
  • oh! that's horrible. Even I'm trying but no luck yet. anyways all the best buddy. and thanks for replying:) – Ashish Srivastava Sep 06 '17 at 11:41

0 Answers0