Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Chris Miller on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

snmpget fails on remote computer 1

Status
Not open for further replies.
May 10, 2012
3
GR
Hello all!
I'm facing a frustrating problem and I really hope that someone could help me out..

- I've designed and written a MIB of my own (ARROW-MIB.txt)
- Put it and exported it on a Debian computer (named "Server")
- Written an agent to support this MIB

On the "Server" computer, all the snmp commands work flawlessly.

The problem begins when I'm trying to read the MIB from another Debian computer (named "Client").

The "Client" computer has snmp and snmpd installed. It is connected to the "Server" computer via a network I've created and the two of them communicate with no problems.

But, the following issue occurs:

If I run (on the "Client") an snmpget command to the "Server" using the numeric OID, it works perfectly. For example:
command : snmpget -v 2c -c remote Server .1.3.6.1.4.1.2022.1.0
result : iso.3.6.1.4.1.2022.1.0 = INTEGER: 0

But, if I try to run the snmpget command using the name of the object I want to get, then a big fat failure occurs:

command : snmpget -v 2c -c remote Server ARROW-MIB::arrowDaemonRunning.0

result : MIB search path: /home/queen/.snmp/mibs:/usr/share/mibs/site:/usr/share/snmp/mibs:/usr/share/mibs/iana:/usr/share/mibs/ietf:/usr/share/mibs/netsnmp
Cannot find module (SNMPv2-SMI): At line 5 in /usr/share/mibs/netsnmp/ARROW-MIB.txt
Did not find 'enterprises' in module #-1 (/usr/share/mibs/netsnmp/ARROW-MIB.txt)
Unlinked OID in ARROW-MIB: arrowMIB ::= { enterprises 2022 }
Undefined identifier: enterprises near line 14 of /usr/share/mibs/netsnmp/ARROW-MIB.txt
ARROW-MIB::arrowDaemonRunning.0: Unknown Object Identifier

It should be noted that the "Client" Debian computer does not have the ARROW-MIB.txt, nor the Agent I have written for it. The ARROW-MIB and Agent are solely on the "Server" pc.

And it is really important that the "Client" pc will be able to execute snmp commands using the human readable names. I don't want to be obliged to pass the numeric OIDs all the time, for they can change all the time whereas the names will always be the same.

Is there a way that I can read OID values from a Remote (Client) computer using the human readable names of the OIDs? If yes, what is it??

Thank you very much in advance :)
 
The Client computer(snmpget) in this case is acting like the SNMP manager. It has to know about the about MIB if you want to use names.

SNMP doesn't care about names like sysName.0 or arrowDaemonRunning.0.
It only talks OIDs. Much like IP does care about computer names it only cares IP addresses.

So, you will need to make snmpget aware of the arrow mib, so it can do name<->oid translation.

Look up documentation on snmpget for the proper method to do this, as I don't know. :)

Bill
 
Damn.. You are absolutely right, though I was hoping to avoid that. I really wanted the "Client" pc to have nothing as far as the ARROW-MIB and its agent are concerned. Damn.

Well, if that is the case, I have to add the MIB and its agent to the Client pc as well. There are two ways to do that (just answering to your "I don't know the proper method to do this" statement)

1. Add the MIB and create an Agent that will take care of the parsing and everything else needed, running as a standalone application on the background. A useful, yet really simple, tutorial could be found here: (fit for very simple MIBs with nothing but scalar OIDs)

2. Add the MIB and build the agent INTO the snmpd daemon. This is what I want know (I don't want to have a standalone application on the Client). How to build an agent into the snmpd, I do not know and I have not found any useful tutorials so far. But I've read that it can be accomplished.

So, I'm off my way to find how to accomplish the "2" now.
Thank you very much for your complete and rapid reply!
 
Hello,

I just started using NET-SNMP and I am trying to make Net-Snmp works between two computers. I install Net-Snmp 5.7.1 on two linux and I can get all the snmp commands work on each computer. However when I try:

server side:
sudo /usr/local/sbin/snmpd -f -L -d 9999

client side :
snmpget -v2c -c public 192.169.0.188:9999 NET-SNMP-TUTORIAL-MIB::nstAgentModuleObject.0
or
snmpget -v2c -c public 192.169.0.188:9999 .1.3.6.1.4.1.8072.2.4.1.1.1.0

192.169.0.188 is my server ip address and .1.3.6.1.4.1.8072.2.4.1.1.1.0 is the oid of my object. I guess my main question is how to connect these two computers so that we can get Net-Snmp work remotely.

I really appreciate for any help.
 
Few things:

1. This should be a new thread

2. You can perform the snmpget to each localhost, but not one machine to other?

3. Any firewalls/routers in play?

Bill
 
Hi,

Thank you for the reply. I managed to connect the computers remotely by changing the configuration file(snmpd.conf) agent address. However my problem is, when I change the agent address I cannot restrict the agent address to only certain IP address since I will get an error:

Cannot open specified output.

So what I did is I make the agent address to listen all network interfaces at port 161, although this is not advisable.

Regards.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top