Jump to content

Welcome to Geeks to Go - Register now for FREE

Need help with your computer or device? Want to learn new tech skills? You're in the right place!
Geeks to Go is a friendly community of tech experts who can solve any problem you have. Just create a free account and post your question. Our volunteers will reply quickly and guide you through the steps. Don't let tech troubles stop you. Join Geeks to Go now and get the support you need!

How it Works Create Account
Photo

IP Ping VBA/VB.NET


  • Please log in to reply

#1
jwardy07

jwardy07

    Member

  • Member
  • PipPip
  • 85 posts
Hi i have 33 network attached storage on my network over a spread location. i currently have a spread sheet of them all with there IP addresses. Basically what i want to do is when i open the spreadsheet or application i need to know whether the NAS is still live. So maybe when i open the spreadsheet in the background it automatically pings all the addresses and then in the cell next to the corrosponding ip address state whether its active or not with colours maybe. I dont know whether this would be easier in excel VBA or visual studios VB.NET. But currently im stuck on how to do this. If anyone has any knowledge of this would be great and maybe an example of 1 IP ping in either application so that i can replicate myself or something. Thanks Guys

Jamie

Edited by jwardy07, 19 August 2008 - 10:16 AM.

  • 0

Advertisements


#2
Titan8990

Titan8990

    Member

  • Member
  • PipPipPipPipPip
  • 2,189 posts
This is why Windows is in desperate need of a programmable shell....
  • 0

#3
Ax238

Ax238

    Tech Staff

  • Technician
  • 1,323 posts
This can be done, but there are several approaches and it depends on your desired level of implementation. The command to run is:

ping IP | echo %errorlevel%

The output will be either 0 (live) or 1 (dead). You can do one of three things:
  • Run a batch file to generate and load the updated spreadsheet (as a CSV)
  • Open the spreadsheet and run a macro that changes the sheet and reopens the sheet
  • Open the spreadsheet and have an autorun function that updates the sheet on open
I'm guessing the optimal will be third, while the easiest would be the first. Without knowing exactly how your spreadsheet is laid out, I can't promise you they are all valid options.
  • 0

#4
jwardy07

jwardy07

    Member

  • Topic Starter
  • Member
  • PipPip
  • 85 posts
My spreadsheet layout is attached at the bottom. Thanks people

Attached Files


  • 0

#5
Ax238

Ax238

    Tech Staff

  • Technician
  • 1,323 posts
You should really store your IP addresses in the form of 192.168.100.1, without the "\\". Unless there is a specific reason for this, I would say get rid of it.

With that, I took your spreadsheet, removed the "\\" characters, and added the logic necessary to update the "Status" field when you open the spreadsheet. I opted for option 3, using a source module that can read the command line output. The spreadsheet will open more slowly, but should do what you are looking for. After it completes, the status field for every line that has an IP address will show either Online or Offline. It is assuming that the IP addresses will always be in column D and the "Status" will be two columns before it. If that changes, so must the logic.

Let me know if this is what you're looking for or if I can assist you in any other way.

Regards,

Ax

Attached Files


  • 0

#6
jwardy07

jwardy07

    Member

  • Topic Starter
  • Member
  • PipPip
  • 85 posts
Your very clever!!! I tried but didnt get anywhere near as that!!! Just out of interest is it possible to somehow get the remaining capacity of the NAS to appear in the spreadsheet or is that asking too much? Basically just trying to make it easier to maintain all of these boxes because these boxes are basically used for automatic backup storage for 300 users spaced over 33 NAS. As they are spread all over different sites of a radius 300miles+ So its a bit hard to maintain :) But thats excellent work and im very gratefull buddy!!
  • 0

#7
Ax238

Ax238

    Tech Staff

  • Technician
  • 1,323 posts
Glad it worked for you, and that I could assist.

Monitoring NAS capacity is getting into a bit more unfamiliar territory than I probably have time to delve into. I did find something that may do all of what you are looking for and more:
SmallNetBuilder - Small Network Help - Monitor your Network for Free with Servers Alive

I can't top 24/7 live summaries...

Let me know if that helps,

Ax

Edit: Here's another one:
AdvancedRM - Free software downloads and reviews - CNET Download.com

Others:
monitor network software downloads and reviews - CNET Downloads
  • 0

#8
jwardy07

jwardy07

    Member

  • Topic Starter
  • Member
  • PipPip
  • 85 posts
Thats excellent, thanks!!

Jamie
  • 0

#9
Ax238

Ax238

    Tech Staff

  • Technician
  • 1,323 posts
:) You're welcome. Let me know if those tools don't work for you and maybe we can come up with something.
  • 0






Similar Topics

0 user(s) are reading this topic

0 members, 0 guests, 0 anonymous users

As Featured On:

Microsoft Yahoo BBC MSN PC Magazine Washington Post HP