Excel report for memory, CPU and disk utilization report

Hello,

I have an script which gives me output of memory, CPU and disk utilization in excel. Whenever I run the script it gives output in different new file.
I want report should get generated in single file for multiple run times. So that I can take average utilization report for all these items.

Is there any way to modify the script to append this data in single file?
LVL 12
Satish AutiSenior System AdministratorAsked:
Who is Participating?
 
Gerald ConnollyConnect With a Mentor Commented:
Thats what i said!

If you remove the time element from the filename
sys=Day(Date) & MonthName(Month(Date)) & time

Open in new window

   goes to  
sys=Day(Date) & MonthName(Month(Date))

Open in new window

then you will get one file for every day

But my suggestion is that Convert this to end up with "Checklist-YYMMDD" so that the files sort by default into chronological order

so something like
"sys=Year(Date) & Month(Date) & Day(Date)"

Open in new window

or do away with the intermediate step
"mth=strDirectory & "\Checklist-" & Year(Date) & Month(Date) & Day(Date) & ".xls"

Open in new window

0
 
#AKS#Tech BloggggerrrCommented:
Could you please share the script you use, it will be easy to understand and propose the solution.

Thanks
1
 
Satish AutiSenior System AdministratorAuthor Commented:
File attached.
Checklist1.vbs
0
Cloud Class® Course: CompTIA Cloud+

The CompTIA Cloud+ Basic training course will teach you about cloud concepts and models, data storage, networking, and network infrastructure.

 
Gerald ConnollyConnect With a Mentor Commented:
strDirectory="D:\Checklist\Output"
.
.
.
hr=Hour(Now)
mi=Minute(Now)
se=Second(Now)
dn=Right(Now,2)
time=hr & mi & se & dn
sys=Day(Date) & MonthName(Month(Date)) & time
mth=strDirectory & "\Checklist(" & sys & ").xls"
Set objFSO=CreateObject("Scripting.FileSystemObject")
If objFSO.FileExists(mth) Then

Open in new window

so mth = "D:\Checklist\Output\Checklist(" + sys + ").xls"
sys appears to be a date TIME based, so will be unique every time it is used

Also i think you will find a benefit of using a YYYYMMDD format for a file name - they automatically sort into chronological order that way
0
 
Satish AutiSenior System AdministratorAuthor Commented:
Ok .. it is clear that code is already written there to edit the existing excel but its not happening.

Set objFSO=CreateObject("Scripting.FileSystemObject")
If objFSO.FileExists(mth) Then
      Set objExcel=CreateObject("Excel.Application")
      Set objWorkbook=objExcel.WorkBooks.Open(mth)
      Set objWorkbook=objExcel.ActiveWorkBook.WorkSheets("Sheet1")
      i=objExcel.Cells(250,250).Value
      count=objExcel.Cells(250,251).Value
Else
      Set objExcel=WScript.CreateObject("Excel.Application")
      Set objWorkbook=objExcel.Workbooks.Add()
      Set objWorkSheet=objWorkbook.Worksheets(1)
      i=2
      count=1

How do I set a name for excel file in script as it's automatically taking name depend upon a what time it runs like below. See the pic.
Capture.JPG
0
 
Gerald ConnollyCommented:
Simple mod to script
0
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

All Courses

From novice to tech pro — start learning today.