Starting Perfmon on all Windows machines with a single Batch file
In one of our project we have more than 4 Windows servers. We use perfmon to monitor the resource utilization. Each time we run load test we start the perfmon on all the servers.
So created the below batch file to do the job.
So created the below batch file to do the job.
The batch file does the below:
- Create a directory with current date and time
- Start perfmon on all 4 AR servers
- Wait for 1 hr
- Copy the result file (.csv) from each server into the director created in step1.
- Stop perfmon on all 4 AR servers.
@echo off
for /f %%I in ('wmic os get localdatetime ^|find "20"') do set dt=%%I
REM dt format is now YYYYMMDDhhmmss...
REM set dt=%dt:~4,2%-%dt:~2,2%-%dt:~0,4%
set dt=%dt:~6,2%%dt:~4,2%%dt:~2,2%%dt:~8,2%%dt:~10,2%
echo %dt%
mkdir D:\Perfmon\Perfmon_%dt%
logman start "Counter" -s server1
logman start "Counter" -s server2
logman start "Counter" -s server3
logman start "Counter" -s server4
timeout /t 3600
copy \\server1\c$\PerfLogs\Admin\Counter\*%dt%*.csv D:\Perfmon\Perfmon_%dt%\.
copy \\server2\c$\PerfLogs\Admin\Counter\*%dt%*.csv D:\Perfmon\Perfmon_%dt%\.
copy \\server3\c$\PerfLogs\Admin\Counter\*%dt%*.csv D:\Perfmon\Perfmon_%dt%\.
copy \\server4\c$\PerfLogs\Admin\Counter\*%dt%*.csv D:\Perfmon\Perfmon_%dt%\.
logman stop "Counter" -s server1
logman stop "Counter" -s server2
logman stop "Counter" -s server3
logman stop "Counter" -s server4
Note: The Data collector with name "Counter" is already added or created in perfmon under "Data Collector Sets"-> "User Defined" on all the servers.
Note: The .csv file created was ending with ddMMyyyyhhmm format.
Note: The .csv file created was ending with ddMMyyyyhhmm format.
Useful information that i have found. don't stop sharing and Please keep updating us..... Thanks
ReplyDeleteReally thankful to you. We were looking for exact same answer.
ReplyDeleteWorthful testing tutorial. Appreciate a lot for taking up the pain to write such a quality content on testing tutorial. Just now I watched this similar testing tutorial and I think this will enhance the knowledge of other visitors for suretesting training institute in hyderabad
ReplyDeletethank your valuable content.we are very thankful to you.one of the recommended blog.which is very useful to new learners and professionals.content is very useful for hadoop learners
ReplyDeleteBest Spring Classroom Training Institute
Best Devops Classroom Training Institute
Best Corejava Classroom Training Institute
Best Advanced Classroom Training Institute
Best Hadoop Training Institute
Best PHP Training Institute
Nice Information
ReplyDelete"Pressure Vessel Design Course is one of the courses offered by Sanjary Academy in Hyderabad. We have offer professional
Engineering Course like Piping Design Course,QA / QC Course,document Controller course,pressure Vessel Design Course,
Welding Inspector Course, Quality Management Course, #Safety officer course."
Piping Design Course
Piping Design Course in India
Piping Design Course in Hyderabad
QA / QC Course
QA / QC Course in india
QA / QC Course in Hyderabad
Document Controller course
Pressure Vessel Design Course
Welding Inspector Course
Quality Management Course
Quality Management Course in india
Safety officer course
I am impressed. I don't think Ive met anyone who knows as much about this subject as you do. You are truly well informed and very intelligent. You wrote something that people could understand and made the subject intriguing for everyone. Really, great blog you have got here
ReplyDeleteBCOM 1st, 2nd & Final Year Exam Time Sheet 2020
Maharaja Surajmal Brij University BCOM 1st Year Exam Time Schedule 2020
I perceived a lots of new Technical things in this wonderful site.Unique information's are shared through it.Keep working Like this
ReplyDeleteJava training in chennai | Java training in annanagar | Java training in omr | Java training in porur | Java training in tambaram | Java training in velachery
http://www.happierit.com
ReplyDeletehttp://www.happierit.com
http://www.happierit.com
http://www.happierit.com
http://www.happierit.com
http://www.happierit.com
http://www.happierit.com
http://www.happierit.com
Thank you for sharing this useful article with us. This blog is a very helpful to me in future. Keep sharing informative articles with us.
ReplyDeletehttps://www.ahmedabadcomputereducation.com/course/laravel-training-course/
I am really happy to say it’s an interesting post to read . I learn new information from your article , you are doing a great job . Keep it up
ReplyDeleteAndroid Mobile App Development in Ahmedabad
ReplyDeleteWeb 3.0 India is the most trusted Web3 Blockchain Development and NFT Development Company in USA. We also provides ICO, STO development for cryptocurrency.
https://web30india.com/
Nice blog article you wrote for us , Thanks for sharing
ReplyDeleteJava training institute in hyderabad with real-time projects
very nice Article
ReplyDeletepyhton training in hyderabad
Useful information that I have found. don't stop sharing and Please keep updating
ReplyDeleteSelenium training in HYD
This comment has been removed by the author.
ReplyDelete