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.

Comments

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

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

    ReplyDelete
  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

    ReplyDelete
  4. thank 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


    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

    ReplyDelete

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 …

Using SQL Developer to create and view Tablespaces

Below are the steps Create and View Table Spaces settings using SQL Developer.
Required SQL developer version is version 3.0
To Create TableSpace :
Click on Menu View/DBA - DBA navigator window will appear.
In the DBA window add a new connection to the DB, and click connect. Then under storage option right click on Tablespaces and choose New Tablespace to create new one. Fill the Details as shown below:


To View the created table spaces: Under Storage, Select Data Files:
It will display the below: