Luis Diaz
asked on
Windows Batch & VB Script: Report ping results into a txt file.
Hello experts, some users report bad performance of application that manage my team. In order to launch an action plan I would like to report ping information in a txt file in order to discard network issues.
The idea is that user run bat or vbscript and then a txt file will be generated with ping results.
In bat & vbs file I should be able to report:
1-Adress that I want to ping
2-Time scale and frame option in order to run ping during a certain period of time.
If you have some feedback or ideas about this please don’t hesitate to help me.
The idea is that user run bat or vbscript and then a txt file will be generated with ping results.
In bat & vbs file I should be able to report:
1-Adress that I want to ping
2-Time scale and frame option in order to run ping during a certain period of time.
If you have some feedback or ideas about this please don’t hesitate to help me.
Can you expand more on how you intend to use this? Will it be run by the user at their computer? Or from your computer?
Will you be pinging the server where the application resides?
Is this a web application, or client servers, or just a shared database?
Also, ping is a fairly crude tool, and not sure you will learn a ton. If it comes back very fast at the time they are seeing slow application performance, then that helps you focus on things on the server, like CPU usage, disk I/O, contention, etc. But if ping performs slow, then not sure that tells you a lot. There are a lot of variables that could affect the ping results...
»bp
Will you be pinging the server where the application resides?
Is this a web application, or client servers, or just a shared database?
Also, ping is a fairly crude tool, and not sure you will learn a ton. If it comes back very fast at the time they are seeing slow application performance, then that helps you focus on things on the server, like CPU usage, disk I/O, contention, etc. But if ping performs slow, then not sure that tells you a lot. There are a lot of variables that could affect the ping results...
»bp
ASKER
Can you expand more on how you intend to use this?Users located in specific site complain about performance issues. I would like to discard network issues as an immediate action. Thought ping is not a full indicator it will provide a picture about the issue.
Will it be run by the user at their computer? Or from your computer?It will be run by the user at the computer
Will you be pinging the server where the application resides?Yes
Is this a web application, or client servers, or just a shared database?
Web application
Also, ping is a fairly crude tool, and not sure you will learn a ton. If it comes back very fast at the time they are seeing slow application performance, then that helps you focus on things on the server, like CPU usage, disk I/O, contention, etc. But if ping performs slow, then not sure that tells you a lot. There are a lot of variables that could affect the ping results.I understand, however ping is the initial action to take.
If you can provide me your expertise feedback and how should I proceed after the ping execution it would be great. I am not asking a full strategy but just foundamental thinks that I should check such as network, computer info of the pc etc…
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
ASKER
Thank you very much for your feedback.
To properly resolve this issue I will adopt a benchmark approach. I will try to ping on the behalf of contributor + on the behalf of other contributors in the same site + on the behalf of of other contributors in other sites of the same country and in other countries. If I see that ping results is different between contributors located in the same date I can assume issue can come from contributor who raised the issue. If ping result is the same for all contributors in the same site but significantly different from contributors from other sites I can assume that there is a network issue related to this site.
I know that ping is not the most reliable tool however it will allows me in a first place to decline or push ahead some assumptions.
If you have another ideas, please let me know.
Thank you again for your help.
To properly resolve this issue I will adopt a benchmark approach. I will try to ping on the behalf of contributor + on the behalf of other contributors in the same site + on the behalf of of other contributors in other sites of the same country and in other countries. If I see that ping results is different between contributors located in the same date I can assume issue can come from contributor who raised the issue. If ping result is the same for all contributors in the same site but significantly different from contributors from other sites I can assume that there is a network issue related to this site.
I know that ping is not the most reliable tool however it will allows me in a first place to decline or push ahead some assumptions.
If you have another ideas, please let me know.
Thank you again for your help.
Open in new window
Replace the x with the amount of tries it should do and the website with your DNS name or IP address.
If you want to do it through Task Scheduler where you specify the time, you can change it to the below where you kill off the task after a certain time as -t will never quit on it's own.
Open in new window
You can also do it to a network path, provided that the account has access to write, like this.
Open in new window
%HOSTNAME% and %DATE% are variables already stored in the CMD shell, but it will take the local date on the system. So if you have multiple languages, it may show different dates.