Jump to content

Constant ping check


Tayls

Recommended Posts

Hey IT people. 

I want to run a constant google ping check on a machine, but have it output to a text file, with the date and time. Esentially, I have a bunch of users who seem to be losing connection regularly on their surface pros and want to see what is going on - some of the users of which are wired in into the network. They mainly spot it when coming out of NAV and trying to go back into it - it asks to restart. 

Does anyone know th correct way to setup a batch file so it runs this constant ping? Eventually I’ll probably set one up on one of the main severs and have it archive at the end of each day before running a new one on a schedule. 

Edited by Tayls
Link to comment
Share on other sites

1 hour ago, PieFacE said:

Can't you just use...

 

ping -t www.google.com > file.txt 

 

In a command prompt

 

 

and echo %TIME% for a timestamp, but you have to loop it.

  • Like 1
Link to comment
Share on other sites

I could run that on cmd, but I want to run it on a single users surface first, because I want to see if they are losing connection to the network whilst being plugged into the floor. I don’t want to leave cmd open on their session all day because, well, users are users. So I ideally need to create a txt file so I can take a look through it and see if there are any drops. 

How should it look on the text doc? I want to be able to open it and be able to refresh it to see new lines. I definitely want the time and then the info that ping www.google.com -t would give next to each other. 

Link to comment
Share on other sites

1 hour ago, Tayls said:

I could run that on cmd, but I want to run it on a single users surface first, because I want to see if they are losing connection to the network whilst being plugged into the floor. I don’t want to leave cmd open on their session all day because, well, users are users. So I ideally need to create a txt file so I can take a look through it and see if there are any drops. 

How should it look on the text doc? I want to be able to open it and be able to refresh it to see new lines. I definitely want the time and then the info that ping www.google.com -t would give next to each other. 

Something like this in a .bat file. Just don't name it ping.bat or the system will have a fit, as it is a existing command.

@ECHO OFF
:LOOPSTART
echo %time% >> c:\temp\filename.txt
ping 8.8.8.8 -n 1 >> c:\temp\filename.txt
timeout /t 5
GOTO LOOPSTART

 

Just start it with the task scheduler as another user (yourself?) and set it to run whether the user is logged in or not. Remember, you have to stop it yourself, or it will continue until restart or the log fills the harddrive ;)

Edited by Tegis
Link to comment
Share on other sites

12 hours ago, Tayls said:

I could run that on cmd, but I want to run it on a single users surface first, because I want to see if they are losing connection to the network whilst being plugged into the floor. I don’t want to leave cmd open on their session all day because, well, users are users. So I ideally need to create a txt file so I can take a look through it and see if there are any drops. . 

I'd monitor connections from the switch. You are making your life harder trying to do this from a user's device.

Link to comment
Share on other sites

×
×
  • Create New...
Â