Tuesday, October 04, 2011

Check Memory Processors LOGPARSER

Check memory processors, etc...




echo off
CLS
color 12

echo ####################################################
echo # Performance Analysis #
echo # Analyzes customer perfmon counter logs for PPS #
echo # By Nigel Glenwood #
echo ####################################################
echo

echo ^ > targets_perf.html
echo ^ >> targets_perf.html
echo ^ >> targets_perf.html
echo ^ >> targets_perf.html
echo ^Targets Live Performance Data >> targets_perf.html
echo ^ >> targets_perf.html
echo data refreshed approximately every 5 minutes >> targets_perf.html
echo ^ >> targets_perf.html





rem #####################################
REM Variable Declaration Section
rem #####################################
set async=aitpiis203
set mainsql=co1aitpsql500
set olap=co1aitpolap500
set iisone=aitpiis203

set app_name=targets


set loglocation=\\bakerx\D$\perflogs\targets\*.csv



rem EXTRACT_TOKEN(Strings, 0, '|')

REM send servername to this and it will create all graphs

rem #####################################################################################################
rem # M A I N #
rem #####################################################################################################



rem ########################################################################################################
rem first grab all the data and place into file for querying, this helps the graphs have the times
rem from left to right as most people would default to reading the graphs
rem ########################################################################################################

echo grabbing data to create initial subset that all other queries hit That are past 24 hours

rem past 24 Hours PROCESSOR


logparser "Select top 288 to_string([(PDH-CSV 4.0) (Pacific Standard Time)(480)]) AS DATE, avg( [\\%iisone%\PerformancePoint:SessionManagement\Total User Sessions]) AS %iisone%_Sessions, avg( [\\%async%\Processor(_Total)\%% Processor Time]) as ASYNCPROC, avg([\\%olap%\Processor(_Total)\%% Processor Time]) as OLAPPROC, avg([\\%mainsql%\Processor(_Total)\%% Processor Time]) as SQLPROC, avg([\\%iisone%\Processor(_Total)\%% Processor Time]) as IISPROC,avg( [\\%async%\Memory\%% Committed Bytes In Use]) AS ASYNCMemory from %loglocation% group by DATE order by DATE DESC" -i:csv -q -o:csv -headers:on > temporary2.csv


rem past 24 Hours MEMORY

logparser "Select top 288 to_string([(PDH-CSV 4.0) (Pacific Standard Time)(480)]) AS DATE, avg([\\%iisone%\PerformancePoint:SessionManagement\Total User Sessions]) AS %iisone%_Sessions , avg([\\aitpiis203\Memory\%% Committed Bytes In Use]) as IISMEM , avg([\\co1aitpolap500\Memory\%% Committed Bytes In Use]) as OLAPMEM, avg([\\co1aitpsql500\Memory\%% Committed Bytes In Use]) as SQLMEM from %loglocation% group by DATE order by DATE DESC" -i:csv -q -o:csv -headers:on > temporary_mem.csv


rem past 7 days

logparser "Select top 2016 to_string([(PDH-CSV 4.0) (Pacific Standard Time)(480)]) AS DATE, avg( [\\%iisone%\PerformancePoint:SessionManagement\Total User Sessions]) AS %iisone%_Sessions, avg( [\\%async%\Processor(_Total)\%% Processor Time]) as ASYNCPROC, avg([\\%olap%\Processor(_Total)\%% Processor Time]) as OLAPPROC, avg([\\%mainsql%\Processor(_Total)\%% Processor Time]) as SQLPROC, avg([\\%iisone%\Processor(_Total)\%% Processor Time]) as IISPROC,avg( [\\%async%\Memory\%% Committed Bytes In Use]) AS ASYNCMemory from %loglocation% group by DATE order by DATE DESC" -i:csv -q -o:csv -headers:on > temporary_week.csv


rem Past 2 Hours

logparser "Select top 26 to_string([(PDH-CSV 4.0) (Pacific Standard Time)(480)]) AS DATE, avg( [\\%iisone%\PerformancePoint:SessionManagement\Total User Sessions]) AS %iisone%_Sessions, avg( [\\%async%\Processor(_Total)\%% Processor Time]) as ASYNCPROC, avg([\\%olap%\Processor(_Total)\%% Processor Time]) as OLAPPROC, avg([\\%mainsql%\Processor(_Total)\%% Processor Time]) as SQLPROC, avg([\\%iisone%\Processor(_Total)\%% Processor Time]) as IISPROC,avg( [\\%async%\Memory\%% Committed Bytes In Use]) AS ASYNCMemory from %loglocation% group by DATE order by DATE DESC" -i:csv -q -o:csv -headers:on > temporary4.csv


rem Past 1 Hour

logparser "Select top 14 to_string([(PDH-CSV 4.0) (Pacific Standard Time)(480)]) AS DATE, avg( [\\%iisone%\PerformancePoint:SessionManagement\Total User Sessions]) AS %iisone%_Sessions, avg( [\\%async%\Processor(_Total)\%% Processor Time]) as ASYNCPROC, avg([\\%olap%\Processor(_Total)\%% Processor Time]) as OLAPPROC, avg([\\%mainsql%\Processor(_Total)\%% Processor Time]) as SQLPROC, avg([\\%iisone%\Processor(_Total)\%% Processor Time]) as IISPROC,avg( [\\%async%\Memory\%% Committed Bytes In Use]) AS ASYNCMemory from %loglocation% group by DATE order by DATE DESC" -i:csv -q -o:csv -headers:on > temporary5.csv



rem ########################################################################################################


rem #####################################################################################
rem # ALL Servers Total User Sessions and Percent Processor By Hour #
rem #####################################################################################


Echo All Servers Sessions and Processor By Hour
rem logparser "Select top 24 substr([(PDH-CSV 4.0) (Pacific Standard Time)(480)],0,2) AS MONTH, substr([(PDH-CSV 4.0) (Pacific Standard Time)(480)],3,2) AS DAY, substr([(PDH-CSV 4.0) (Pacific Standard Time)(480)],6,4) AS YEAR,substr([(PDH-CSV 4.0) (Pacific Standard Time)(480)],11,2) AS Hour, avg( [\\%iisone%\PerformancePoint:SessionManagement\Total User Sessions]) AS %iisone%_Sessions, avg( [\\%async%\Processor(_Total)\%% Processor Time]) as ASYNCPROC, avg([\\%olap%\Processor(_Total)\%% Processor Time]) as OLAPPROC, avg([\\%mainsql%\Processor(_Total)\%% Processor Time]) as SQLPROC, avg([\\%iisone%\Processor(_Total)\%% Processor Time]) as IISPROC from %loglocation% group by MONTH,DAY,YEAR, Hour order by MONTH,DAY ,YEAR, Hour DESC" -i:csv -q -o:csv -headers:on > temporary.csv
rem rem rem rem rem pause




rem rem rem rem rem pause




rem logparser "Select top 26 to_string([(PDH-CSV 4.0) (Pacific Standard Time)(480)]) AS DATE, avg( [\\%iisone%\PerformancePoint:SessionManagement\Total User Sessions]) AS %iisone%_Sessions, avg( [\\%async%\Processor(_Total)\%% Processor Time]) as ASYNCPROC, avg([\\%olap%\Processor(_Total)\%% Processor Time]) as OLAPPROC, avg([\\%mainsql%\Processor(_Total)\%% Processor Time]) as SQLPROC, avg([\\%iisone%\Processor(_Total)\%% Processor Time]) as IISPROC from %loglocation% group by DATE order by DATE DESC" -i:csv -q -o:csv -headers:on > temporary3.csv


rem creating chart Processor past 24 hours close up


logparser "Select DATE ,avg(aitpiis203_Sessions),avg(ASYNCPROC),avg(OLAPPROC),avg(SQLPROC),avg(IISPROC) into %app_name%usersessionsandprocessorbyHOUR.gif from temporary2.csv group by DATE order by DATE " -i:csv -q -charttype:line -groupSize:1024x800 -values:off -legend:on -chartTitle:"Targets PROCESSOR Usage Past 24 Hours Close Up View"


rem memory close up 24 hours


logparser "Select DATE ,avg(%iisone%_Sessions),avg(IISMEM),avg(OLAPMEM),avg(SQLMEM) into %app_name%usersessionsandprocessorbyHOUR_MEMORY.gif from temporary_mem.csv group by DATE order by DATE " -i:csv -q -charttype:line -groupSize:1024x800 -values:off -legend:on -chartTitle:"Targets MEMORY Usage Past 24 Hours Close Up View"

%iisone%_Sessions


rem line3d looks cool but not sure how good to read


logparser "Select DATE ,avg(aitpiis203_Sessions),avg(ASYNCPROC),avg(OLAPPROC),avg(SQLPROC),avg(IISPROC) into %app_name%usersessionsandprocessorbyHOUR3d_1.gif from temporary2.csv group by DATE order by DATE " -i:csv -q -charttype:line3d -groupSize:1024x800 -values:off -legend:on -config:chartconfig5.js -chartTitle:"Targets Usage Past 24 Hours Close Up View"

rem pause

logparser "Select DATE ,avg(aitpiis203_Sessions),avg(ASYNCPROC),avg(OLAPPROC),avg(SQLPROC),avg(IISPROC) into %app_name%usersessionsandprocessorbyHOUR3d_2.gif from temporary2.csv group by DATE order by DATE " -i:csv -q -charttype:line3d -groupSize:1024x800 -values:off -legend:on -config:chartconfig11.vbs -chartTitle:"Targets Usage Past 24 Hours Close Up View"

rem pause

logparser "Select DATE ,avg(aitpiis203_Sessions),avg(ASYNCPROC),avg(OLAPPROC),avg(SQLPROC),avg(IISPROC) into %app_name%usersessionsandprocessorbyHOUR3d_3.gif from temporary2.csv group by DATE order by DATE " -i:csv -q -charttype:line3d -groupSize:1024x800 -values:off -legend:on -chartTitle:"Targets Usage Past 24 Hours Close Up View"

rem pause

logparser "Select DATE ,avg(aitpiis203_Sessions),avg(ASYNCPROC),avg(OLAPPROC),avg(SQLPROC),avg(IISPROC) into %app_name%usersessionsandprocessorbyHOUR100.gif from temporary2.csv group by DATE order by DATE " -i:csv -q -charttype:line -groupSize:1024x800 -values:off -legend:on -config:chartconfig11.vbs -chartTitle:"Targets Usage Past 24 Hours Based on 100"

rem pause

logparser "Select DATE ,avg(aitpiis203_Sessions),avg(ASYNCPROC),avg(OLAPPROC),avg(SQLPROC),avg(IISPROC) into %app_name%usersessionsandprocessorbyHOURlast2Hours.gif from temporary4.csv group by DATE order by DATE " -i:csv -q -charttype:column3d -groupSize:1024x800 -values:off -legend:on -config:chartconfig11.vbs -chartTitle:"Targets Usage Past 2 Hours"

rem pause


rem rem rem rem rem pause





rem #####################################################################################
rem # ASYNC Percent Committed Bytes in Use #
rem #####################################################################################

echo ASYNC Memory

logparser "Select top 288 Date,avg(ASYNCMemory) into %app_name%async_memory.gif from temporary2.csv group by Date order by Date " -i:csv -q -charttype:line -groupSize:1024x800 -legend:off -config:chartconfig.js -chartTitle:"Async Memory Committed Bytes in Use Past 24 Hours"

rem rem rem rem rem pause

rem #####################################################################################
rem # SQL Server Total User Sessions and Percent Processor #
rem #####################################################################################

Echo Total User Sessions


logparser "Select Date, avg(SQLPROC), avg(aitpiis203_Sessions) into %app_name%usersessionsandSQL_processorpast60minutes.gif from temporary5.csv group by date order by Date " -i:csv -q -charttype:column3d -groupSize:1024x800 -legend:off -config:chartconfig.js -chartTitle:"Sql Processor VS PPS User Sessions Past 1 Hour"

rem rem rem rem rem pause





rem #####################################################################################
rem # ALL Servers Total User Sessions and Percent Processor By Minute #
rem #####################################################################################


Echo All Servers Sessions and Processor



logparser "Select top 288 Date, avg(aitpiis203_Sessions),avg(ASYNCPROC),avg(OLAPPROC),avg(SQLPROC),avg(IISPROC) into %app_name%usersessionsandprocessorALL.gif from temporary2.csv group by date order by Date " -i:csv -q -charttype:line -groupSize:1024x800 -legend:on -config:chartconfig11.vbs -chartTitle:"Targets Usage Past 24 Hours "

rem #####################################################################################
rem # System Usage Past 2 Hours #
rem #####################################################################################




logparser "Select Date, avg(ASYNCPROC),avg(OLAPPROC),avg(SQLPROC),avg(IISPROC), avg(%iisone%_Sessions) into %app_name%usersessionsandprocessorALL2hours.gif from temporary4.csv group by Date order by Date" -i:csv -q -charttype:line -groupSize:1024x800 -legend:on -config:chartconfig11.vbs -chartTitle:"Targets Usage Past 2 Hours "



rem rem rem rem rem pause

rem #####################################################################################
rem # ALL Servers Total User Sessions and Percent Processor Past 60 Minutes #
rem #####################################################################################

Echo All Servers Sessions and Processor Past 60 Minutes


logparser "Select Date, avg(ASYNCPROC),avg(OLAPPROC),avg(SQLPROC),avg(IISPROC) into %app_name%usersessionsandprocessorpast60minutes.gif from temporary5.csv group by date order by Date" -i:csv -q -charttype:line -groupSize:1024x768 -legend:on -chartTitle:"Users and Processor(Percentage) Usage Past 60 Minutes" -config:chartconfig5.js -chartTitle:"Targets Usage Past 1 Hour"

rem rem rem rem rem pause


rem #####################################################################################
rem # Max users of the system #
rem #####################################################################################

rem do not run this one all the time as its purpose is to run through the entire log files
rem of the system and come up with max users that have been on a certain system for its life
rem time, it would really just need to be run once a week for comparison


rem logparser "Select max([\\%iisone%\PerformancePoint:SessionManagement\Total User Sessions]) AS Maxusersessionsever from \\niglen1\scripts\services*.csv" -i:csv -q -o:csv > maxusers.csv

rem rem rem rem rem pause

rem #####################################################################################
rem # Total Users of System over all time #
rem #####################################################################################

rem logparser "Select [(PDH-CSV 4.0) (Pacific Standard Time)(480)] AS TIME, [\\%iisone%\PerformancePoint:SessionManagement\Total User Sessions] AS PPTotalUserSessions into usersessions.gif from \\NIGLEN1\services_logs_all\*.csv order by TIME desc" -i:csv -q -charttype:column3d -groupSize:1024x768 -legend:off

rem #####################################################################################
rem # Sessions and IIS Processor #
rem #####################################################################################

Echo IIS Sessions and Processor By all

logparser "Select top 288 Date, avg(aitpiis203_Sessions),avg(IISPROC) into %app_name%usersessionsiisprocessor.gif from temporary2.csv group by date order by Date" -i:csv -q -charttype:column3d -groupSize:1024x768 -legend:off -config:chartconfig11.vbs -chartTitle:"Targets PPS Users VS IIS Processor past 24 Hours"


rem rem rem rem rem pause

rem #####################################################################################
rem # average iis processor and users all time #
rem #####################################################################################

rem logparser "Select avg([\\%iisone%\PerformancePoint:SessionManagement\Total User Sessions]) AS PPTotalUserSessions, avg([\\%iisone%\Processor(_Total)\%% Processor Time]) as IISPROC into usersessionsiisprocessoravgerage.gif from \\NIGLEN1\services_logs_all\*.csv" -i:csv -q -charttype:column3d -groupSize:1024x768 -legend:off

rem #####################################################################################
rem # async memory past 1 HOUR #
rem #####################################################################################

echo async memory past hour

logparser "Select Date, avg(ASYNCMemory) into %app_name%asyncmemorypast10minutes.gif from temporary5.csv group by date order by Date " -i:csv -q -charttype:column3d -groupSize:1024x768 -legend:off -chartTitle:"Targets ASYNC Usage Past 1 Hour"


rem ### past 7 days usage ###


logparser "Select DATE ,avg(aitpiis203_Sessions),avg(ASYNCPROC),avg(OLAPPROC),avg(SQLPROC),avg(IISPROC) into %app_name%usersessionsandprocessorbyHOUR100_week.gif from temporary_week.csv group by DATE order by DATE " -i:csv -q -charttype:line -groupSize:1024x800 -values:off -legend:on -config:chartconfig11.vbs -chartTitle:"Targets Usage Past 7 Days Based on 100"

logparser "Select DATE ,avg(aitpiis203_Sessions),avg(ASYNCPROC),avg(OLAPPROC),avg(SQLPROC),avg(IISPROC) into %app_name%usersessionsandprocessorbyHOUR100_week_close.gif from temporary_week.csv group by DATE order by DATE " -i:csv -q -charttype:line -groupSize:2024x600 -values:off -legend:on -chartTitle:"Targets Usage Past 7 Days Close Up View"




rem #####################################################################################
rem # Build A WEb Page Based on Images we Just Created #
rem #####################################################################################


echo ^ >> targets_perf.html
echo ^ >> targets_perf.html
echo ^ >> targets_perf.html
echo ^ >> targets_perf.html
echo ^ >> targets_perf.html
echo ^ >> targets_perf.html
echo ^ >> targets_perf.html
echo ^ >> targets_perf.html
echo ^ >> targets_perf.html
echo ^ >> targets_perf.html
echo ^ >> targets_perf.html
echo ^ >> targets_perf.html
echo ^ >> targets_perf.html
echo ^ >> targets_perf.html
echo ^ >> targets_perf.html
echo ^ >> targets_perf.html
echo ^ >> targets_perf.html
echo ^ >> targets_perf.html
echo ^ >> targets_perf.html
echo ^ >> targets_perf.html
echo ^ >> targets_perf.html
echo ^ >> targets_perf.html
echo ^ >> targets_perf.html
echo ^ >> targets_perf.html
echo ^ >> targets_perf.html
echo ^ >> targets_perf.html


echo ^ >> targets_perf.html
echo ^Created %date% %time% >> targets_perf.html



rem rem rem rem rem pause

rem #####################################################################################################
rem # E N D M A I N #
rem #####################################################################################################


ROBOCOPY C:\Users\niglen\Documents\Scripts\targets_perf_analyze\ \\bakerx\d$\mumar *.html /zb /R:3 /Log:nigellog2%random%.txt
ROBOCOPY C:\Users\niglen\Documents\Scripts\targets_perf_analyze\ \\bakerx\d$\mumar *.gif /zb /R:3 /Log:nigellog2%random%.txt

0 Comments:

Post a Comment

<< Home