Skip to main content

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.

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.


  1. Useful information that i have found. don't stop sharing and Please keep updating us..... Thanks

  2. Really thankful to you. We were looking for exact same answer.

  3. Worthful 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

  4. thank your valuable content.we are very thankful to of the recommended blog.which is very useful to new learners and professionals.content is very useful for hadoop learners

    Best 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

  5. Thanks for sharing
    We are the best piping design course in Hyderabad, India. Sanjary academy Offers Piping Design Course and Best Piping Design Training Institute in Hyderabad. Piping Design Institute in India Piping Design Engineering.
    Piping Design Course
    Piping Design Course in india
    Piping Design Course in hyderabad

  6. Nice Information
    "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

  7. 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
    BCOM 1st, 2nd & Final Year Exam Time Sheet 2020
    Maharaja Surajmal Brij University BCOM 1st Year Exam Time Schedule 2020

  8. I perceived a lots of new Technical things in this wonderful site.Unique information's are shared through it.Keep working Like this
    Java training in chennai | Java training in annanagar | Java training in omr | Java training in porur | Java training in tambaram | Java training in velachery

  9. Tease me until I’m begging for it Hey, i am looking for an online sexual partner ;) Click on my boobs if you are interested (. )( .)


Post a Comment

Popular posts from this blog

Steps to Analyze AWR Report in Oracle

Steps to Analyze AWR Report in Oracle
AWR -Automaticworkload repository is a collection of persistentsystem performancestatisticsowned by SYS. It resides in SYSAUXtablespace. Bydefault snapshot are generated once every 60 min and maintained for 7 days. Each snapshot has a unique ID know as "snap_id". Snapshot detail can be found in "dba_hist_snapshot" view.
If we have Database performance issue and not the Database machine, then AWR Report is the place to look at. AWR is not used for real-time performance monitoring like the v$ tables. It is used for historical analysis of performance. AWR complements, but doesnot replace real-time monitoring.
Once AWR Report is generated in Oracle, the next task is to analyze it. By going through the AWR Report we can easily solve issues like slow database, high wait events, slow query and many more issues. Even though the report is lengthy, Analyzing or Reading relevant part of AWR Report can help to troubleshoot issues in easy and …

Recording Jmeter Scripts behind a proxy server

Recording Jmeter Scripts behind a proxy server
In one of the blog we saw the steps of recording Jmeter scripts using a proxy server.
JMeter has its own in-built Proxy Server, theHTTP(S) Test Script Recorder. This is only used for recording HTTP or HTTPS browser sessions as explained in below link.
The above steps will work properly if the internet connection is not behind a proxy and can be accessed directly.
If we are testing from behind a firewall/proxy server or if we the internet access is provided using proxy server then the above steps will fail and will not record any of the steps.
Steps to record in Jmeter if the internet is accessed via proxy:
1.Start Jmeter with the firewall/proxy server hostname and port number. To do so, Open a command prompt in windows and run the jmeter.bat file from a command line with the following parameters: -H [proxy server hostname or ip address]
-P [proxy s…