title: snmpget “No such object available on this agent at this OID”
body: <p>I have been working on trying to get a value with a custom MIB through SNMP following this <a href="http://www.net-snmp.org/wiki/index.php/TUT:Writing_a_MIB_Module" rel="nofollow noreferrer">tutorial</a>. I'm using net-snmp 5.7.3. I have used this <a href="https://github.com/winlibs/net-snmp/blob/master/mibs/DISMAN-PING-MIB.txt" rel="nofollow noreferrer">MIB</a> along with the corresponding <a href="https://github.com/winlibs/net-snmp/tree/master/agent/mibgroup/disman/ping" rel="nofollow noreferrer">codes</a> with <a href="https://github.com/winlibs/net-snmp/blob/master/agent/mibgroup/disman/ping-mib.h" rel="nofollow noreferrer">this</a>.</p>
  
  <p>My setup: I have two VM's, both <code>Ubuntu 16</code>, one is <em>snmp-server</em> with IP:192.168.5.20 and the other <em>snmp-agent</em> with IP:192.168.5.21.</p>
  
  <p>I did <code>MIBS=ALL</code> and <code>export MIBS</code>. On the agent, I have successfully compiled my MIB and got the expected output. My code files are in the path <code>/home/snmp-agent/Desktop/proj/net-snmp-5.7.3/agent/mibgroup/</code>. I reconfigure mthe net-snmp like this:</p>
  
  <pre><code>./configure --with-mib-modules="pingCtlTable pingResultsTable pingProbeHistoryTable"
  make
  make install
  </code></pre>
  
  <p>Everything worked fine. And when I do <code>snmptranslate</code> on the agent I get:</p>
  
  <pre><code>root@snmpagent:~# snmptranslate -On DISMAN-PING-MIB::pingResultsTable
  .1.3.6.1.2.1.80.1.3
  root@snmpagent:~# snmptranslate -On DISMAN-PING-MIB::pingCtlTable
  .1.3.6.1.2.1.80.1.2
  root@snmpagent:~# snmptranslate -On DISMAN-PING-MIB::pingProbeHistoryTable
  .1.3.6.1.2.1.80.1.4
  </code></pre>
  
  <p>Output on the server, when I do this:</p>
  
  <pre><code>snmpget -v2c -c public 192.168.5.21 sysDescr.0
  SNMPv2-MIB::sysDescr.0 = STRING: Linux snmp-agent 4.10.0-33-generic #37~16.04.1-Ubuntu SMP Fri Aug 11 14:07:24 UTC 2017 x86_64
  </code></pre>
  
  <p>But when I run <code>snmpget</code>, from the server, I get this error for all the three: </p>
  
  <pre><code>snmpget -v2c -c public 192.168.5.21 DISMAN-PING-MIB::pingCtlTable.0
  DISMAN-PING-MIB::pingCtlTable = No Such Object available on this agent at this OID
  </code></pre>
  
  <p>Output when specified the OID's:</p>
  
  <pre><code>snmpget -v2c -c public 192.168.5.21 .1.3.6.1.2.1.80.1.2
  DISMAN-PING-MIB::pingCtlTable = No Such Object available on this agent at this OID
  </code></pre>
  
  <blockquote>
    <p>NOTE: I have already seen these posts with no luck for me.
    <a href="https://stackoverflow.com/questions/9898780/add-new-mib-master-agent">add new mib master agent</a>
    <a href="https://stackoverflow.com/questions/29823789/snmpget-no-such-object-available-on-this-agent-at-this-oid">snmpget-no-such-object...</a> and <a href="https://stackoverflow.com/questions/20974249/snmpget-returns-no-such-object-available-on-this-agent-at-this-oid">snmpget-returns-no-such-object...</a></p>
  </blockquote>
  
  <p><strong>UPDATE 2:</strong></p>
  
  <p>When I do <code>snmpwalk</code> from the server, I get:</p>
  
  <pre><code>root@snmp-server:# snmp-server:# snmpwalk -v 2c -c ncs -m DISMAN-PING-MIB 192.168.5.22 .1.3.6.1.2.1.80
  DISMAN-PING-MIB::pingObjects.0 = INTEGER: 1
  DISMAN-PING-MIB::pingFullCompliance.15.46.49.46.51.46.54.46.49.46.50.46.49.46.56.48 = STRING: "/bin/echo"
  DISMAN-PING-MIB::pingMinimumCompliance.15.46.49.46.51.46.54.46.49.46.50.46.49.46.56.48 = ""
  DISMAN-PING-MIB::pingCompliances.4.15.46.49.46.51.46.54.46.49.46.50.46.49.46.56.48 = ""
  DISMAN-PING-MIB::pingCompliances.5.15.46.49.46.51.46.54.46.49.46.50.46.49.46.56.48 = INTEGER: 5
  DISMAN-PING-MIB::pingCompliances.6.15.46.49.46.51.46.54.46.49.46.50.46.49.46.56.48 = INTEGER: 1
  DISMAN-PING-MIB::pingCompliances.7.15.46.49.46.51.46.54.46.49.46.50.46.49.46.56.48 = INTEGER: 1
  DISMAN-PING-MIB::pingCompliances.20.15.46.49.46.51.46.54.46.49.46.50.46.49.46.56.48 = INTEGER: 4
  DISMAN-PING-MIB::pingCompliances.21.15.46.49.46.51.46.54.46.49.46.50.46.49.46.56.48 = INTEGER: 1
  DISMAN-PING-MIB::pingIcmpEcho.1.15.46.49.46.51.46.54.46.49.46.50.46.49.46.56.48 = ""
  DISMAN-PING-MIB::pingIcmpEcho.2.15.46.49.46.51.46.54.46.49.46.50.46.49.46.56.48 = ""
  DISMAN-PING-MIB::pingIcmpEcho.3.15.46.49.46.51.46.54.46.49.46.50.46.49.46.56.48 = INTEGER: 1
  DISMAN-PING-MIB::pingIcmpEcho.4.15.46.49.46.51.46.54.46.49.46.50.46.49.46.56.48 = INTEGER: 0
  DISMAN-PING-MIB::pingMIB.4.1.2.15.46.49.46.51.46.54.46.49.46.50.46.49.46.56.48.1 = ""
  </code></pre>
  
  <p>So accordingly when I follow the output of <code>snmpwalk</code>, I get:</p>
  
  <pre><code>root@snmp-server:# snmpget 192.168.5.22 DISMAN-PING-MIB::pingFullCompliance.15.46.49.46.51.46.54.46.49.46.50.46.49.46.56.48
  DISMAN-PING-MIB::pingFullCompliance.15.46.49.46.51.46.54.46.49.46.50.46.49.46.56.48 = Wrong Type (should be INTEGER): STRING: "/bin/echo"
  </code></pre>
  
  <p>I don't understand why I have such a long OID? <strong>What is pingFullCompliance.15.46.49.46.51.46.54.46.49.46.50.46.49.46.56.48</strong> ? Where am I going wrong? Can anyone please point me in the right direction... Thank you.</p>