Link to home
Start Free TrialLog in
Avatar of patron
patronFlag for India

asked on

Script to automate weekly /monthly performance monitoring Report in excel

Looking for Script/Free tool to to automate weekly /monthly email Report in excel format
Where we need Servers Availability Report including OS Type , Service status ,CPU ,Memory ,Page File ,Disk utilization
with Last Reboot Tracking

Please advice for best  solution to be implemented without Cost if possible.

Thanks in  Advance
Avatar of David Favor
David Favor
Flag of United States of America image

Each of these are of a very different data... category, related to volatility... rate of change...

For example, OS type only changes when a machine or a container is installed, so once during it's lifetime.

Memory usage relates to processes which start, then die.

CPU usage relates to processes which start, then die... also long running Kernel threads.

Paging + Disk Utilization are also very different.

Better to just log all your data into a text based log file, as trying to write Excel data natively can be massively slow + could produce such high over head as to skew your actual data, like CPU usage or disk utilization... as writing Excel data is complex, because of the files internal structure, which is very different than plain text files.

One approach...

1) Log each set of data to a text based log file.

2) Rotate the log files at midnight (logrotate does this on every Linux machine).

3) After rotation is finished + new data is now logging to the next text file, transform the previous log file into an Excel file.
Avatar of patron

ASKER

Thanks David,

any possibility if we can have separate script /solution for same ?

any free tool for such automation ?
are you looking for an Exchange report?
Avatar of patron

ASKER

No ,we are looking  for our  infra running in a domain with 80% windows and 20 % linux machines.

Will be great if we can achieve the same for windows  server machines in domain like 2003 ,2008.2016.2019
Or if max we can fetch from VMware vCenter ?
Avatar of patron

ASKER

Not able to run it  and can we get the extract for all server in domain but not for dc only ?
Upgrade to Powershell 5. You can run against all computers
Avatar of patron

ASKER

I do have PowerShell 5 installed
Name                           Value
----                           -----
PSVersion                      5.1.14393.3053
PSEdition                      Desktop
PSCompatibleVersions           {1.0, 2.0, 3.0, 4.0...}
BuildVersion                   10.0.14393.3053
CLRVersion                     4.0.30319.42000
WSManStackVersion              3.0
PSRemotingProtocolVersion      2.3
SerializationVersion           1.1.0.1
Avatar of patron

ASKER

please assist if we can achieve the requested data for all boxes
in domain
Avatar of patron

ASKER

@Shaun Vermaak , please help as am getting blank report with ps version as mentioned above ?

The 'class' keyword is not supported in this version of the language
Very strange indeed. Please send full error
Avatar of patron

ASKER

At line:2 char:1
+ class Computer
+ ~~~~~
The 'class' keyword is not supported in this version of the language.
    + CategoryInfo          : ParserError: (:) [], ParseException
    + FullyQualifiedErrorId : ReservedKeywordNotAllowed
    + PSComputerName           XXYYZZ5


Get-Get-Content : Cannot bind argument to parameter 'Path' because it is null.
At C:\ABC\XYZ\Audit.ps1:56 char:41
+ $latestComputerAudit      = Get-Content $latestFile | ConvertFrom-Jso ...
+                                         ~~~~~~~~~~~
    + CategoryInfo          : InvalidData: (:) [Get-Content], ParameterBindingValidationException
    + FullyQualifiedErrorId : ParameterArgumentValidationErrorNullNotAllowed,Microsoft.PowerShell.Commands.GetContentCommand
 
Test-DnsServer : The term 'Test-DnsServer' is not recognized as the name of a cmdlet, function, script file, or operable program. Check the spelling
of the name, or if a path was included, verify that the path is correct and try again.
At C:\ABC\XYZ\Audit.ps1:97 char:13
+ $dnsTest = (Test-DnsServer -IPAddress $DomainController.IPv4Address). ...
+             ~~~~~~~~~~~~~~
    + CategoryInfo          : ObjectNotFound: (Test-DnsServer:String) [], CommandNotFoundException
    + FullyQualifiedErrorId : CommandNotFoundException
report.JPG
ASKER CERTIFIED SOLUTION
Avatar of patron
patron
Flag of India image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial