Author Topic: Query a network switch  (Read 3068 times)

seckner

  • Jr. Member
  • **
  • Posts: 70
Query a network switch
« on: May 14, 2014, 01:24:04 pm »
Wondering how this was done and can WB do it... We loaded Spiceworks on the network today just to see what it was about. As it was inventorying the equipment on the network, somehow it's able to pull not only the network switch it's connected to but the physical port that it's connected to! Does anyone have any idea how they accomplished this? Is it possible to query a switch? We have HP switches but it's really not that far from a Cisco switch. Just really curious!

Deana

  • Wilson WindowWare Tech Support
  • Pundit
  • *****
  • Posts: 1183
  • WinBatch® can do it.
    • WinBatch Tech Support Database
Re: Query a network switch
« Reply #1 on: May 14, 2014, 01:36:53 pm »
Googled it and found this: http://community.spiceworks.com/help/How_Does_The_Scan_Work#Basic

It appears SNMP might be required..no real built-in support for SNMP in WinBatch:
http://techsupt.winbatch.com/webcgi/webbatch.exe?techsupt/tsleft.web+WinBatch/Networks~-~Servers+SNMP~in~WinBatch.txt

Might be able to handle using WinSock?
Deana F.
Technical Support
Wilson WindowWare Inc.

seckner

  • Jr. Member
  • **
  • Posts: 70
Re: Query a network switch
« Reply #2 on: May 14, 2014, 05:00:29 pm »
Using the info you provided I went on a search - found 2 utilities called snmpget.exe and snmpwalk.exe that allow command line access to the snmp values that can be read - going to play with it tomorrow but it looks promising! Thank you Deana!

....IFICantBYTE

  • Full Member
  • ***
  • Posts: 125
Re: Query a network switch
« Reply #3 on: May 14, 2014, 08:10:47 pm »
I have been using SNMP stuff in WinBatch for years (basic SNMP v1 get/walk only though) and have made a few utilities we use in the company I work for to monitor and report on our printer fleet and other devices.
I am using the little known built-in com component that Windows uses to interrogate printers (their bi-directional detection of printer capabilities), so it is native to all flavors of Windows.
It is able to be used to look at any SNMP device that has a known community name you can read settings from (so long as you don't need v3 authentication or want to wait for traps, support MIBs etc).

I have not tried any 3rd party .NET distributions that support SNMP yet. Most are not free, but I did find an open source one once that looked good... don't remember what it was but I saved it somewhere in case I wanted to try it one day.

Anyway, I will see if I have the time in the next day or so to pull out some of my SNMP code (can't give you the full source of the utilities I made due to privacy/copyright) and put it in an example script so that you can make use of it if you like.
 
Regards,
....IFICantBYTE

Nothing sucks more than that moment during an argument when you realize you're wrong. :)

....IFICantBYTE

  • Full Member
  • ***
  • Posts: 125
Re: Query a network switch
« Reply #4 on: May 17, 2014, 01:57:46 am »
Seckner,
I have just posted some example SNMP V1 stuff in the Script Exchange area for you.
Regards,
....IFICantBYTE

Nothing sucks more than that moment during an argument when you realize you're wrong. :)