Log in

View Full Version : Ping detail


Arunmathi
Aug 16, 2009, 03:52 AM
Is it possible to ping all the branch routers and the area routers of the company simultaneously?
If yes, in what language the program should be written for pinging?(all router's wan and lan ip are already known)
:confused:

chuckhole
Aug 18, 2009, 02:25 PM
Is this for a basic network monitoring system? What kind of results do you want to see? Do you want to add any action items/notifications in case of a failure? How many devices are you monitoring?

Check out SolarWinds (http://www.solarwinds.com) or WhatUp Gold (http://www.whatsupgold.com/) to name a few.

If you are wanting to do this yourself, then check out VBScript or Windows PowerShell. You can use the Windows Management Instrumentation (WMI) ping command to perform a scripted single ping. I do this in our logon scripts before attempting to make drive connections to shares.

Here is a VBScript version (paste the contents below to a text file and name it with a .VBS extension). Change the strServer = "ServerName" to your actual device name or IP address. Launch it a command prompt by typing the full name of the file.

strServer = "ServerName"
strWMIService = "ON"
Err.Clear
Set objWMIService = GetObject("winmgmts:\\.\root\cimv2")
If Err.Number <> "0" then
Err.Clear
strWMIService = "OFF"
End if

if strWMIService = "ON" then
Set colItems = objWMIService.ExecQuery("Select * from Win32_PingStatus Where Address = '" & strServer & "'")
For Each objItem in colItems
If objItem.StatusCode = 0 Then
MachineStatus = True
Else
MachineStatus = False
End if
Next
if MachineStatus = True then
Wscript.Echo strServer & " is responding"
else
Wscript.Echo strServer & " is NOT responding"
end if
else
Wscript.Echo "There was an error in the WMI Service on this computer."
end if