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 strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

use access to ping computers 2

Status
Not open for further replies.

techsupport3977

Technical User
Mar 7, 2005
56
US
I would like to establish a list of computers that I currently have on my network. I then would like a query to ping those computers every 'X' hours.

I would the results of the ping to be logged into a table to show datetime stamp of when the ping occurred, which computer and the results. The results should be pass / fail.

What needs to be done in order to accomplish this?
 

Shell "cmd.exe /c ping xxx.xxx.xxx.xxx > c:\ping.txt"
then read the results from the text file into a table
 
While MS Access can certainly be programmed to do this sort of network monitoring, it may not be the best tool depending upon your business requirements. Consider searching for packages such as Site Scope, etc. that are designed to perform monitoring and maintain statisticals of up/down time. There could also be freeware tools that could ping and record results... htwh,

Steve Medvid
"IT Consultant & Web Master"

Chester County, PA Residents
Please Show Your Support...
 
I have gotten this far with the data extraction.

Code:
Private Sub Form_Open(Cancel As Integer)

'Ping a computer and save it to a text file
Shell "cmd.exe /c ping XX.XX.XX.XX > c:\temp\ping\extruder_e.txt"

'Open the file for data extraction
Dim myString As String
Dim strArray() As String

Open "c:\temp\ping\extruder_e.txt" For Input As #1
    strArray = Split(Input(LOF(1), 1), vbCrLf)
    
Close #1
End Sub

How do I extract the data for Access though? Do you have another posting I can follow on VBforums? I am an novice when it comes to navigating on that website and plus I am not sure what to search for.
 
The data would now be in your array.
You have a long way to go. You need to replace the XXXXXX with your ips you want to ping
then there is useless data in the returned data so you will want to parse that out as well. Additionally The Shell function runs other programs asynchronously. This means that a program started with Shell might not finish executing before the statements following the Shell function are executed. You will need to make provisions for that.
All this involves opening the recordset- reading and parsing the data appending the data to the recordset etc..

I would strongly consider looking at Steves solution. If there is freeware out there that will do it why reinvent the wheel

 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top