Take the 2-minute tour ×
Server Fault is a question and answer site for system and network administrators. It's 100% free, no registration required.

I want to build an application using snmp for searching my LAN and exploring the devices which have shared some resources. I need some assistance to start with it, I have trying to do the same using net-snmp, but still no success.

share|improve this question

closed as not a real question by Chris Thorpe, John Gardeniers, Sven, Iain, Chopper3 Apr 16 '11 at 9:09

It's difficult to tell what is being asked here. This question is ambiguous, vague, incomplete, overly broad, or rhetorical and cannot be reasonably answered in its current form. For help clarifying this question so that it can be reopened, visit the help center.If this question can be reworded to fit the rules in the help center, please edit the question.

    
You need to provide much more information for someone to be able to actually assist you. What exactly is the problem you're having? –  Chris Thorpe Apr 16 '11 at 7:27
    
The application would contain the following functional units: 1. search the whole LAN i.e., all the computers presently connected and active within the LAN, 2. Then the discovered devices should send the device trap messages when they are active and when they have been shut down. These are the two implementations I expect from net-snmp or any other such package preferably in C or python –  Ankur Apr 16 '11 at 7:39

2 Answers 2

I think what you want to do is not possible.

  • First, SNMP isn't installed and/or activated on any desktop operating system by default.
  • Second, there is no way to configure SNMP remotely by SNMP, in the best case you could reconfigure an already configured system by it. This means that you have to manually install and configure SNMP on all devices first in order to allow the necessary operations.
  • Third, while it surely possible to send out SNMP traps on boot/shutdown for Net-SNMP and the Windows implementation, most other network devices like printers etc. can't be configured to do this. If they send out traps at all, it is just to report error conditions.

If all you want to do is network discovery, there are much better alternatives to do it then forcing SNMP do something it wasn't designed for.

share|improve this answer
    
Thanks for the help, now it will be easy for me to move to other alternatives but tell one thing about the third point i.e., Is there any way that the other computers on LAN would send me some sort of message before they shut down or just after they start. Can I make them do something like this? I want to implement this to avoid polling by my system to check their status. –  Ankur Apr 16 '11 at 8:42
    
This answer highlights the different definitions of 'the network'. Typically people with server backgrounds (I'm guessing like @SvenW) consider 'the network' to be a collection of servers, thus making SNMP not the best method of collecting data, whereas people like myself, with a background in routing & switching, consider 'the network' to be a collection of routers, switches, firewalls etc. for which SNMP is just about the only method of gathering data, thus leading to radically different answers. –  blankabout Apr 16 '11 at 9:06

If you want to do full network discovery the only realistic way forward is to:
1 - Get MAC addresses from the switches, (from their MAC address tables)
2 - Get the IP address/MAC addresses (the ARP tables) from the routers
3 - Use DNS to reverse lookup the host names using the IP address

This process needs to be repeated on a regular basis because the data in both MAC address and ARP tables times out, in the former case in 10 minutes, in the latter case normally it will be several hours.

With the information above you can identify where (or at least to which switch port) devices are connected and then, if you need more information, interrogate each host for details of O/S or whatever else you need to know.

share|improve this answer

Not the answer you're looking for? Browse other questions tagged or ask your own question.