Sign in to follow this  
Followers 0
Neutro

Ping a list of computers simultaneously

26 posts in this topic

Hey folks,

I have a textfile list of around 4000 computers that I would like to ping simultaneously to see if they are online or not.

If I use the Ping() command in a loop, it will only ping 1 computer at the same time.

Any ideas?

Thanks :)

Share this post


Link to post
Share on other sites



AutoIt is single-threaded, so barring 4000 scripts I cannot see how you would accomplish this. Why (short of a DDoS) would you want to tax your host system by running that many pings simultaneously anyway?


√-1 2^3 ∑ π, and it was delicious!

Share this post


Link to post
Share on other sites

#3 ·  Posted (edited)

AutoIt is single-threaded, so barring 4000 scripts I cannot see how you would accomplish this. Why (short of a DDoS) would you want to tax your host system by running that many pings simultaneously anyway?

Since you can call ping from cmd, you should be able to pull this off (don't know about 4000) from one script if you treat each cmd instance asynchronously and just have a system to read the many stdout... right?

EDIT: It's ugly, but may work.  I am also curious as to the intent here though.  Any sort of intrusion detection system is going to start temp blacklisting this box if it's not completely useless.

Edited by danwilli

Share this post


Link to post
Share on other sites

#4 ·  Posted (edited)

I need to find out which computers of my company do not have OCS inventory software installed.

So I gathered a text list of all computers registered on our domain controller, then i get a text list of all computers registered on our OCS inventory server.

I created a small script to compare both text files so I know which computers of the domain are not registered on our OCS server.

The output file has around 3000 hostnames. Most of them are old computers that are not used anymore but that were used on the domain years ago.

So I need to ping everything and output only computers that respond to ping, so I know that I need to install OCS on them.

But if I only ping 1 computer at the same time for 5 secs, it would take around 4 hours to do!

Edit: my goal is to be able to ping more than 1 computer at the same time, maybe not all of them simultaneously. If I could ping like 10 or 20 computers at the same time, it would be much faster already :)

Edited by Neutro

Share this post


Link to post
Share on other sites

#5 ·  Posted (edited)

Try this:

Something I wrote but not multi threaded:

Br,

UEZ

Edited by UEZ

Please don't send me any personal message and ask for support! I will not reply!

Selection of finest graphical examples at Codepen.io

The own fart smells best!
Her 'sikim hıyar' diyene bir avuç tuz alıp koşma!
¯\_(ツ)_/¯  ٩(●̮̮̃•̃)۶ ٩(-̮̮̃-̃)۶ૐ

Share this post


Link to post
Share on other sites

So why not just push a script to the client machines to check for the software, and then install it from a share if it isn't there?

I don't think ping is the right way to go about this to be honest.

Do you guys not use MS SMS, Tivoli or some other type of management software for this sort of thing already?

Share this post


Link to post
Share on other sites

#7 ·  Posted (edited)

OCS is an open source alternative to products like Altiris or SCCM. However, it does not have a "heartbeat" function, to enum machines without the client installed, like the others. I believe that is why the OP is having to go through a manual list to find them.

Edited by JLogan3o13

√-1 2^3 ∑ π, and it was delicious!

Share this post


Link to post
Share on other sites

#8 ·  Posted (edited)

@danwilli > i'm doing this in a domain migration context, from an old samba managed domain to a new windows managed domain.

All computers that already have migrated to the new windows domain have OCS installed.

Badfully we cannot push an OCS installation script on the computers of the old domain because there are no tools that would allow us to do it with the samba managed domain (that's at least what the admins of this domain told me. Maybe it is in fact possible but even if it was, I do not have access to these servers).

@JLogan3o13 > yes you are right. In our company we try to use as much free and open source softwares as possible. OCS inventory is working pretty well for us, even if indeed it does not have all functions of things like SCCM and such.

@UEZ > I already looked at these posts before asking for help here :) On your first link I do not understand what is the main function/tool used to do a mass ping. The second one is nice but what I need to do is ping multiple computers at the same time, not 1 by 1 :)

Edited by Neutro

Share this post


Link to post
Share on other sites

Another idea:

Computers in an AD domain have a  password like users. The password expires and will automatically be renewed when the computer logs on again.

You could use my AD UDF to retrieve the password expiration date of all computers and then get those which haven't been logged in for e.g. > 2 months.


My UDFs and Tutorials:

Spoiler

UDFs:
Active Directory (NEW 2017-04-18 - Version 1.4.8.0) - Download - General Help & Support - Example Scripts - Wiki
OutlookEX (NEW 2017-02-27 - Version 1.3.1.0) - Download - General Help & Support - Example Scripts - Wiki
ExcelChart (2015-04-01 - Version 0.4.0.0) - Download - General Help & Support - Example Scripts
Excel - Example Scripts - Wiki
Word - Wiki
PowerPoint (2015-06-06 - Version 0.0.5.0) - Download - General Help & Support

Tutorials:
ADO - Wiki

 

Share this post


Link to post
Share on other sites

hey water :)

Thats a cool idea :)

I already tried using your AD UDF on the samba managed domain but ad_open is failing. @error is "Creation of the RootDSE object failed".

If my memory is correct, @extended did not contain anything usefull, but I can try it again tomorrow if you want.

Share this post


Link to post
Share on other sites

I have a Resara (Samba) server here to test and it works just fine.


My UDFs and Tutorials:

Spoiler

UDFs:
Active Directory (NEW 2017-04-18 - Version 1.4.8.0) - Download - General Help & Support - Example Scripts - Wiki
OutlookEX (NEW 2017-02-27 - Version 1.3.1.0) - Download - General Help & Support - Example Scripts - Wiki
ExcelChart (2015-04-01 - Version 0.4.0.0) - Download - General Help & Support - Example Scripts
Excel - Example Scripts - Wiki
Word - Wiki
PowerPoint (2015-06-06 - Version 0.0.5.0) - Download - General Help & Support

Tutorials:
ADO - Wiki

 

Share this post


Link to post
Share on other sites

BTW: Details on how the computer account password works can be found here.


My UDFs and Tutorials:

Spoiler

UDFs:
Active Directory (NEW 2017-04-18 - Version 1.4.8.0) - Download - General Help & Support - Example Scripts - Wiki
OutlookEX (NEW 2017-02-27 - Version 1.3.1.0) - Download - General Help & Support - Example Scripts - Wiki
ExcelChart (2015-04-01 - Version 0.4.0.0) - Download - General Help & Support - Example Scripts
Excel - Example Scripts - Wiki
Word - Wiki
PowerPoint (2015-06-06 - Version 0.0.5.0) - Download - General Help & Support

Tutorials:
ADO - Wiki

 

Share this post


Link to post
Share on other sites

#13 ·  Posted (edited)

Well that's good to know that your AD functions works on Samba server domain :)

Badfully for me, I do not have access to our samba server in my company, so I cannot tweak it to see what's wrong :(

I only have admin rights on the new windows domain. So I don't think I will be able to solve my problem using your AD UDF right now.

Thanks anyway for your help and for the computer password information, I was not aware of it :)

Edited by Neutro

Share this post


Link to post
Share on other sites

You do not have to have admin rights in the domain to use my AD UDF.

I have only normal user rights in my company but can extract all needed data.


My UDFs and Tutorials:

Spoiler

UDFs:
Active Directory (NEW 2017-04-18 - Version 1.4.8.0) - Download - General Help & Support - Example Scripts - Wiki
OutlookEX (NEW 2017-02-27 - Version 1.3.1.0) - Download - General Help & Support - Example Scripts - Wiki
ExcelChart (2015-04-01 - Version 0.4.0.0) - Download - General Help & Support - Example Scripts
Excel - Example Scripts - Wiki
Word - Wiki
PowerPoint (2015-06-06 - Version 0.0.5.0) - Download - General Help & Support

Tutorials:
ADO - Wiki

 

Share this post


Link to post
Share on other sites

Well I think I was not very clear in my previous post, sorry.

What I meant is: i do have a domain administrator account for both old samba domain and also for the new windows domain.

I can also remote control the windows domain controller, so i can tweak whatever I want on it.

But I do not have physical or remote control on the samba server. 

I used a script using AD_UDF on a computer running on the old samba domain on the domain administrator account but still had a failure with ad_open() as stated above.

I guess the problem is that the samba server is badly setup, but I cannot do anything about it since I cannot tweak it.

Share this post


Link to post
Share on other sites

I see.

Did you try the latest version of the UDF? Depending on how old the UDF you tried was, some things might have changed.


My UDFs and Tutorials:

Spoiler

UDFs:
Active Directory (NEW 2017-04-18 - Version 1.4.8.0) - Download - General Help & Support - Example Scripts - Wiki
OutlookEX (NEW 2017-02-27 - Version 1.3.1.0) - Download - General Help & Support - Example Scripts - Wiki
ExcelChart (2015-04-01 - Version 0.4.0.0) - Download - General Help & Support - Example Scripts
Excel - Example Scripts - Wiki
Word - Wiki
PowerPoint (2015-06-06 - Version 0.0.5.0) - Download - General Help & Support

Tutorials:
ADO - Wiki

 

Share this post


Link to post
Share on other sites

Yes I used AD UDF 1.3.0.0

Well i guess there is no easy way to ping multiple computers so i'll just do it 1 by 1 and let the script run for a long time ;)

Share this post


Link to post
Share on other sites

Yes I used AD UDF 1.3.0.0

Well i guess there is no easy way to ping multiple computers so i'll just do it 1 by 1 and let the script run for a long time ;)

 

just a moment,

take a look here

it pings ranges of computers and it is very fast


small minds discuss people average minds discuss events great minds discuss ideas.... and use AutoIt....

Share this post


Link to post
Share on other sites

Share this post


Link to post
Share on other sites

What cracks me up is that the original post was at 13:24 (my time) and the last post was at 15:56 (my time). You spent two and a half hours talking about it and ended up deciding to "look at nping tomorrow when i have some time".

Had you started a script that pinged each computer individually one after the another, like you mentioned in post #4, you'd have been done in another hour and a half (using your "around 4 hours" estimate).


Whenever someone says "pls" because it's shorter than "please", I say "no" because it's shorter than "yes".

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!


Register a new account

Sign in

Already have an account? Sign in here.


Sign In Now
Sign in to follow this  
Followers 0