- 0
Updated PingChecker
-
Recently Browsing 0 members
- No registered users viewing this page.
-
Similar Content
-
Python Deep Learning - Third Edition ($39.99 Value) — Free, in exchange for your Email
By News Staff,
- ebook offer
- sponsored
- (and 2 more)
- 0 replies
- 1 view
-
Python Real-World Projects ($36.99 Value) FREE eBook download offer ends Jan 2
By News Staff,
- ebook offer
- sponsored
- (and 2 more)
- 0 replies
- 3 views
-
Python for Security and Networking - Third Edition ($39.99 Value) FREE download
By News Staff,
- ebook offer
- sponsored
- (and 2 more)
- 0 replies
- 3 views
-
Python Machine Learning ($24.00 Value) eBook FREE for a Limited Time
By News Staff,
- ebook offer
- sponsored
- (and 3 more)
- 0 replies
- 2 views
-
Microsoft launches the experimental Python Editor from Excel Labs
By John Callaham,
- microsoft
- microsoft excel
- (and 4 more)
- 2 replies
- 3 views
-
Question
Gerowen
Just uploaded an updated copy of one of my old python scripts called "pingchecker" and thought I would share it. I wrote it several years ago to make it easier for me to clean up my Active Directory container. We had a lot of old machine names in our container that no longer pointed to active machines, but with several hundred machines actively under our control in that same container, I didn't want to just start arbitrarily deleting hostnames. On top of that, I wasn't there when the whole shebang was initially set up, so I didn't have a copy of all the active hostnames we were supposed to have, and I did a poor job of maintaining records of computer names when I would reimage computers. To find out which computers were active and which were not without manually walking around and looking at them all, I wrote this script. I then went into our Active Directory container and unchecked all of the columns except "hostname", and exported that to a text file with one hostname per line, then just copied and pasted those hostnames into the terminal when it asked for targets. Actually the copy I used at work never asked for hostnames, it would just look for a text file by a particular name that I would create by exporting hostnames from Active Directory, but I modified this one to ask for them so it's more useful for everyday users. This made it very easy to copy and paste several hundred hostnames, then just hit enter and walk away, and have the results exported to a nice text file for me to look at when I got back. I ran the script 2 or 3 times over the course of a couple of weeks to allow for people who might have taken a machine on a trip or other anomalies, and that allowed me to find a pattern of machine names that were consistently offline so I could delete them and remove the clutter from our Active Directory OU.
This updated version has been converted from Python 2 to Python 3, and with this particular one you must have Python 3 installed to use it, Python 2 doesn't seem to like some of the error handling. I've also added colored text output while the script runs, so if you want to review the results while it's still running, or just watch it run, you'll get a colored highlight around the ping results of each target to help you pick out the important information while it's running. I'm thinking about building in an option to export the results to a .csv file since they're just plain text files, that way you can open it with your favorite spreadsheet editor and sort long lists of hosts by their "Up" or "Down" status, but I haven't been to bed in almost 24 hours, so that'll be a project for another day,
It's in a tar.gz archive which you can extract with all sorts of free software like 7zip.
Download link: http://sourceforge.net/projects/pingchecker/files/PingChecker_15.8.15.tar.gz/download
Project page: https://sourceforge.net/projects/pingchecker/
I linked directly to the file because as of this post, SourceForge hasn't updated the download button on the project page to point to the newest version that I just now uploaded.
Screenshot: The results stored in a text file when it's done.
Screenshot: The highlighted results you see while it's still running.
added tags
Link to comment
Share on other sites
3 answers to this question
Recommended Posts