10

I am using centos Operating System.
i am trying to get the memory statistics of localhost through snmpget command, i am getting this error.

snmpget -v 1 -c public localhost .1.3.6.1.4.1.2021.4.6
Error in packet
Reason: (noSuchName) There is no such variable name in this MIB.
Failed object: UCD-SNMP-MIB::memAvailReal

But, if i fire this one .. i am getting the output..

snmpget -v 1 -c public localhost .1.3.6.1.2.1.1.3.0
DISMAN-EVENT-MIB::sysUpTimeInstance = Timeticks: (58756) 0:09:47.56

I am not getting what I am doing wrong. I exported the path of /usr/share/snmp/mibs/ to $PATH variable.
can any one help me out.

Carlos Landeras
  • 11,025
  • 11
  • 56
  • 82
Riyaz
  • 127
  • 1
  • 3
  • 8

2 Answers2

11

You'd better read the FAQ page of net-snmp,

http://www.net-snmp.org/wiki/index.php/FAQ:Applications_09

You should use

snmpget -v 1 -c public localhost .1.3.6.1.4.1.2021.4.6.0.

Lex Li
  • 60,503
  • 9
  • 116
  • 147
  • 2
    Also useful to do snmpwalk -v 1 -c public localhost .1.3.6.1.2.1.1 and you will see what OIDs exist in your tree – k1eran Jul 05 '13 at 08:46
  • We were having the same issue, (for a piece of networking equipment though) however our instance sub-identifier was 1, not 0. – Hobadee May 31 '19 at 16:26
0

snmpwalk -v 1 -c public localhost iso.1.3.6.1.4.1.2021.4.6

Use this.