Go Back   Cyber Tech Help Support Forums > Hardware > Networking

Notices

Networking Use this board for problem solving and the discussion of Networking, router, and Wi-Fi issues

Reply
 
Topic Tools
  #1  
Old October 8th, 2020, 12:46 AM
CyberTrek CyberTrek is offline
Senior Member
 
Join Date: Aug 2008
Location: NC, USA, Earth, Sector 001
Posts: 585
Getting PINGed Results Sortable/Filtered

I am trying to figure a way to make a simple, sortable or filterable ping script. I got a few, meh, thousand servers I need to ping. Now, I can have them all in a file. I can execute it from Command Prompt or Powershell for it to ping everything and append to a file. The problem is the output. Just comes out like regular ping results, since, well, I am using ping. So whether I run

ips.txt:
server1
server2

from Command Prompt:

C:\Users\me>for /f "tokens=1" %a in (c:\temp\ips.txt) DO @ping -n 3 %a >> c:\temp\PingResults.txt

Or

ips.ps1:
ping server1 -n 2 >> “c:\temp\IP_Results.txt"
ping server2 -n 2 >> “c:\temp\IP_Results.txt"

(or even if CSV is the output)

In Powershell:

Pings are all complete results located in c:\temp\IP_Results.txt.
PS C:\WINDOWS\system32> & C:\temp\IP_Results.ps1

Both give me the same results in the outputted file, which I know is expected of ping.

Pinging server1 [10.111.123.248] with 32 bytes of data:
Request timed out.
Request timed out.

Ping statistics for 10.111.123.248:
Packets: Sent = 2, Received = 0, Lost = 2 (100% loss),

Pinging server2 [10.111.123.249] with 32 bytes of data:
Request timed out.
Request timed out.

Ping statistics for 10.111.123.249:
Packets: Sent = 2, Received = 0, Lost = 2 (100% loss),

Fine and dandy. What I would really like is to have all the servers in an output that shows me at least three key bits of info I need, like:

Server1, 10.1.1.2, inactive/time out/whatever
Server2, 10, 2, 3, 4, active/pinged/whatever

I want to be able to have it all into a list so I can at least, like in a spreadsheet, filter out all the ones that failed knowing what their server names and IPs are, so I can work on those. Rather than having to go through the generic ping results like above for 2000 results.

Know what I mean?

Thanks.
Reply With Quote
Reply

Bookmarks


Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump

Similar Topics
Topic Topic Starter Forum Replies Last Post
On the results from... Mr Bean Malware Removal 13 June 9th, 2009 02:13 AM
AVG results #ELMO# Malware Removal 3 May 10th, 2007 12:39 PM
How Do you unblock a site that has been filtered lauriem0 Windows NT, 2000, 2003, 2008, 2012 4 December 16th, 2005 01:49 AM
Bad results. dickster Windows XP 2 July 17th, 2002 12:49 AM


All times are GMT +1. The time now is 06:29 AM.