Assist in the creation of HTML report of the PowerShell script
Hello
I'm looking for help taking a script work and have it create an HTML report.
I found a script that LucD post by helping another poster to gather cluster information that I've tweaked to collect information that I'm looking for. The script works and will collect the information necessary for all 3 of our vCenter servers but I'm trying to get this information in a HTML report similar to what Alan was with vCheck5.
Below is the output of the script and have attached the script, etat_hebdomadaire - VMwareClusterResourceSummary.ps1 and an example of what I'm trying to archive, weekly report - VMware Cluster Resource Summary.htm.
Thanks for any help you can provide.
vCenter Server Name: vCenter1
Name of the data center: Data Center Office 1
Name of the cluster: Office Group 1
Number of guests: 8
Number of data warehouses: 19
Number of Virtual Machines: 625
Total of processor (Ghz): 314.98
Consumed current processor (Ghz): 143.69
Courses available processor (Ghz): 171.29
Minimum 7 days CPU usage (%): 13.90
7 days of use of the processor maximum (%): 53.09
7 days of CPU usage (%) average: 28.80
Total memory (GB): 1023.97
Current consumption memory (GB): 782.86
Current available memory (GB): 241.12
Minimum 7 days memory usage (%): 59.43
Day 7 use of the maximum memory (%): 75,41
7 days average memory usage (%): 66.38
Total space (GB): 14395.25
Current space (GB): 9948.26
Current available space (GB): 4446.99
Hello Arnold, creating such a report will involve a lot of HTML and CSS coding, which is not my strong btw
The best example is of course script vCheck to Alan.
In the attached script I borrowed / stole the code HTML and CSS of the script from Alan.
The result is far from what you are considering, but I hope that it will give you at least a framework for more customization.
Tags: VMware
Similar Questions
-
People,
I am trying to load and run the PowerShell script of PowerCLI Module to check the CPU, memory and storage overcommitment. VMware PowerCLI Blog - VMware Blogs but somehow it is always stopped with the error: cannot find the [ordered] type: make sure that the assembly containing this type is loaded.
Here are some of the diagnostic result:
$PSVersionTable
Value name
---- -----
PSVersion 2.0
PSCompatibleVersions {1.0, 2.0}
BuildVersion 6.1.7601.17514
PSRemotingProtocolVersion 2.1
WSManStackVersion 2.0
CLRVersion 4.0.30319.1026
SerializationVersion 1.1.0.1
Get-ChildItem ' HKLM:\SOFTWARE\Microsoft\NET frame Setup\NDP'-recurse |
Get-ItemProperty-name of the EA - 0 Version |
Where {$_.} PSChildName-match ' ^ (?) (S) \p {L} "} |"
Select PSChildName, Version
PSChildName Version
----------- -------
v2.0.50727 2.0.50727.5420
3.0.30729.5420 v3.0
Windows Communication Foundation 3.0.4506.5420
Windows Presentation Foundation 3.0.6920.5011
3.5.30729.5420 v3.5
Customer 4.0.30319
4.0.30319 full
Get-PowerCLIVersion
PowerCLI Version
----------------
VMware vSphere PowerCLI 5.8 Release 1 build 2057893
---------------
Versions of the snap
---------------
Build VMWare AutoDeploy PowerCLI component 5.5 1983942
Build VMWare ImageBuilder PowerCLI component 5.5 1983942
Build license of VMware PowerCLI component 5.5 1265954
Build VMware Storage PowerCLI component 5.8 2057894
Build VDS's VMware PowerCLI component 5.8 2031581
Build VMware vSphere PowerCLI component 5.8 2031581
I installed Windows6. 1 -KB2819745- x 64 - MultiPkg.msu to enable Powershell v4.0 on my Windows 7 laptop, but still the script cannot be executed with the above error message.
Any kind of aid and assistance would be greatly appreciated.
Thank you
Hello-
Ah, yes--it is that review.
Another option, because you are not able to go to .NET FX 4.5, is to remove the parts "[ordered]' of the code that you use. This type Accelerator makes the hash table a dictionary sorted. The effect to remove that from the code will be that the properties of the object that results will not be in the order in which they appear in the code.
And, another option would be to install PowerShell v3 (the version in which the '[ordered]' feature has been added'). That shouldn't require a FX .NET newer than what you showed as having already installed on this computer. However, as we have seen with the PSSnapin and PSv4 Exchange, you want to make sure that the PSSnapins / Modules you want to use are compatible with PowerShell v3.
-
Help with the Powershell script to collect logs from all domain controllers
I am writing a script to retrieve the last 5 days of application, security and log files from all domain controllers. The script runs, but fire the logs from the local server only. The variable $Computer has all of my DC so it's the fine mark. I guess it's a problem with my line ForEach-Object, but is not error. See the below script.
$log = 'application '.
$date = get-date-format MM-DD-YYYY
$now = get-date
$subtractDays = new-object System.TimeSpan 5,0,0,0,0
$then = $Now.Subtract ($subtractDays)
$Computers = get-ADDomainController-filter *.
ForEach-Object - InputObject $Computers - process {Get-EventLog - LogName $log - after $then - before $now - EntryType error | select EventID, MachineName, Message, Source, TimeGenerated |} ConvertTo-html | {Out-file $env:TEMP\Applicationlog.htm}
Invoke-Expression $env:TEMP\Applicationlog.htmThank you
Rich
Hello
To help with the repost the question script to the script Center Forum
http://social.technet.Microsoft.com/forums/scriptcenter/en-us/home
-
Run the powershell script in Workflow VCO
Hi guys,.
I'm pretty new to VCO and I am facing difficulties to get what I want. For you, this will be a Basic... but here's my question:
I have a WF that I use in the WFStubmachineprovisionning that can generate me a name of virtual machine based on the selection of the user while he asked for a virtual computer in the VRA.
The VM provisionned name looks like this: W203PKLXXX and I need to replace the XXX with a number that is available on the network.
To do this, I need to query the DNS to see if there is, if not, 002 001... And so on... until an available and I send the full name of the virtual machine to the WF Stubprovisionning.
This my first try to interact between VCO and a Powershell script. I can run script PS on my host configured, but do not know how to send variables to the custom WF that generates the name of the script of PS and send the name of VM from the script of the PS to the next step.
Can someone give me a sample of variable to manage? I can't find anything on the net
Just to tell you that I managed.
the PS has returned an XML object, not a string. I had to use the method getxml() javascript property, and parse the string to get the value I need
I also had to blind correctly (getxml) entry and exit (PS)
If needed I can send you a few screenshoot
-
How to run the powershell script of command with several parameters
Is there a way to run a powershell script from the dialog box run with several parameters? In addition, the path to the script contains spaces, for example, c:\powershell scripts\script.ps1.
Take a look at http://www.powershell.nu/2009/12/16/running-scripts-with-arguments-in-powershell/ which explains how to pass arguments to a script.
André
-
Run the PowerShell script?
flash.filesystem import. *;
import flash.desktop.NativeProcess;
import flash.desktop.NativeProcessStartupInfo;
var file:File = new File("C:\\Windows\\System32\\WindowsPowerShell\\v1.0\\powershell.exe");
var nativeProcessStartupInfo:NativeProcessStartupInfo = new NativeProcessStartupInfo();
nativeProcessStartupInfo.executable = file;
var args:Vector. < String > = new Vector. < String > ();
args.push("c:\\test\\sendTest.ps1");
nativeProcessStartupInfo.arguments = args;
process: NativeProcess var = new NativeProcess();
Process.Start (nativeProcessStartupInfo);
Try to get Powershell to run sendTest.ps1 in the c:\test folder. I get no error or anything else.
If I have this number at the command prompt:
c:\test\sendTest.ps1 PowerShell
It works very well. But I can't get the correct syntax to run it from the AIR.
Someone tell me what I am doing wrong?
You must set ExecutionPolicy argument:
var args:Vector.
= new Vector. (); args.push("-ExecutionPolicy"); args.push("Unrestricted"); args.push("c:\\test\\sendTest.ps1"); Without correct ExecutionPolicy, you get PowerShell PSSecurityException error. You can listen for events from native process of ProgressEvent.STANDARD_ERROR_DATA to see.
-
Hello
I have some related issues oppose executing this script to list physical NETWORK card speeds by NIC for each host. The error is:
The method call failed because http://System.Management.Automation.PSObject contains not one me
Taylor named "op_Addition.
Online: 12 char: 23
+ += $NicSpReportObj < < < < $NicSpReportObj
+ CategoryInfo: InvalidOperation: (op_Addition:String)], RuntimeException
+ FullyQualifiedErrorId: MethodNotFound
Hostname Teddy speed
esx14.domain.com pnic0 1000
It will list until I would be the last entry in the object but of course its not adding in the previous info (or deleting it may be).
If someone could take a look it would be great.
Thank you
Dan
Script (also attached):
$VMHosts = get-VMHost | Sort name | Get-View
$NicSpReport = @)
$NicSpReportObj = "" | Select-Object HostName, Teddy bear, speed
Foreach ($VMHost to $VMHosts)
{
$pnic = 0
{}
$Speed = $VMHost.Config.Network.Pnic [$pnic]. LinkSpeed.SpeedMb
$NicSpReportObj.HostName = $VMHost.Name
$NicSpReportObj.pNIC = ' teddy bear$ Teddy. "
$NicSpReportObj.Speed = $speed
$NicSpReportObj += $NicSpReportObj
{$pnic ++}
Until the ($pnic - eq ($VMHost.Config.Network.Pnic.Length))
}
$NicSpReport += $NicSpReportObj
$NicSpReport | FT - AutoSize
I have a little rewriting of your script. I hope it will do what you want now:
Get-VMHost | ForEach-Object { $VMHost = $_ $VMHost.Extensiondata.Config.Network.Pnic | ForEach-Object { $NicSpReportObj = "" | Select-Object HostName, pNIC, Speed $NicSpReportObj.HostName = $VMHost.Name $NicSpReportObj.pNIC = $_.Device $NicSpReportObj.Speed = $_.LinkSpeed.SpeedMb $NicSpReportObj } } | Sort-Object -property HostName,pNIC | Format-Table -AutoSize
Best regards, Robert
Update: moved the Sort-Object cmdlet at the end of the script to also perform a sort on the attribute of Teddy.
Post edited by: RvdNieuwendijk
-
Hi all
I'm currently building a VI that creates reports in html, using the report generation tools (LV2011). But the text in my reports contains non-English characters. I should the value of charset ISO-8859-9 by a meta tag in the head section of html code (as ). But because I can't add html code directly to the head of the article (or can I?), I tried to use the report police VI value. There is a cluster setting called font settings, and it has a named charset I16 element. Help file explains "charset is the character set to use for the text of the report. The default value is - 1. "but I can't change the character set, because I don't know what are the character set for the language codes.
How can I set charset in html reports, if possible?
Thank you!
I found a solution and wanted to post it here also. I tried reporting screws, add some HTML, css, javascript code and dom manipulation code. I found myself with a simpler solution, even if it isn't 'exactly the path '. I add tag meta charset as direct html code, just after the creation of html report:
Note: Set screw header and footer should be used with their "placement of the header" parameters "Add to the body", the value in order not to be written before meta charset.
Some css code may also be added with meta charset, if the user wants to use the css codes instead of set report police VI, such as:
As a rule of html, meta charset should be in the head section, but since it is not possible to insert code in the head with screw statement section, I'm inserting at the top of the body section. However, it works in Firefox and IE.
Kind regards...
-
PowerShell script and the Orchestrator
Hi guys
We managed to set up the PowerShell script to run a task in the Orchestrator, the only problem is that we cannot pass the input parameter
$vCOuser = "xxxxxxxx".
$vCOpass = "zzzzzzzz.
$vCOparm = "C:\orchestrator\Test.html".
# Se connect to vCO and generate proxy $vcoWS
$vcoWS = New-WebServiceProxy - Uri http:// < server >: 8280/vmware-vmo-webcontrol/webservice? WSDL
# Print the result
$vcoWS
# Find Workflow
$workflow = $vcoWS.getWorkflowsWithName ("create a simple XML document", $vCOuser, $vCOpass)
# Print the result
$workflow
foreach ($element in $workflow)
{
$element.id
#... and run
$workflowToken = $vcoWS.executeWorkflow ($element.id, $vCOuser, $vCOpass, inParameters)
# Print the result
$workflowToken
}
Any help would be appreciated
Hello!
You can specify an array of WorkflowtokenAttribute objects and pass it to the executeWorkflow method:
$inparams += New-Object -TypeName VCO.WorkflowTokenAttribute $inparams[0].name = "inputString" $inparams[0].type = "String" $inparams[0].value = "Hello World" $inparams # ... and exectue (use $null instead on $inparams if Workflow has no input parameters # ... und ausführen $workflowToken = $vcoWS.executeWorkflow($workflow.id, "vcoadmin1" , "VMware2010", $inparams) $workflowToken
See the complete example here:
http://www.vcoportal.de/2011/06/updated-calling-VCO-workflows-from-PowerShell/
http://www.vcoportal.de/examples/PowerShell-VCO/
Kind regards
Joerg
-
PowerShell / script PowerCLI is not execution of the stimulus package SRM
I posted this in the community of the Site Recovery Manager, but thought that the PowerCLI community may be able to help as well. *****
I can't run a script PowerShell to a recovery plan, even if I can't run interactively from the SRM of recovery server and command CMD run OK.
Here is the error I get:
Error: user designed legend "C:\Windows\system32\cmd.exe /c C:\test.cmd" has not returned in 300 seconds.
The recovery plan called test.cmd, which is basically redirected to the PowerShell script.
REM ===== test.cmd ===== @echo off echo > C:\1.txt C:\Windows\System32\WindowsPowerShell\v1.0\powershell.exe -NoLogo -ExecutionPolicy RemoteSigned -Command C:\test.ps1 echo > C:\3.txt REM ===== end of test.cmd =====
Test.cmd called test.ps1, that only creates a CSV file for troubleshooting.
# ===== test.ps1 ===== Add-PSSnapin VMware.VimAutomation.Core -ErrorAction SilentlyContinue # Load VMware PowerCLI functionality Write-Host foo | Export-CSV C:\2.txt exit # ===== end of test.ps1 =====
Note that I created the process text files to see where the script stops. When I run test.cmd of the stimulus package, 1. txt is created, but 2. txt and txt 3. are not created. When I run test.cmd interactively from the SRM of recovery server, all three text files are created.
My environment is 4.1 SRM and PowerCLI 4.1 build 332441 U1.Any help would be appreciated. Thank you.
Things to check.
(1) under which the account is the .cmd file and therefore the .ps1 file, executed in SRM?
Maybe the RS account does not have the same privileges
(2) I would like to start the PowerShell engine in the with the parameter - NoProfile .cmd file.
A general Council, try to use the cmdlets Start-Transcript and Stop-Transcript at the beginning and at the end of your PS script.
Have you ever tried to create a .txt file before loading the PowerCLI snap?
-
can't choose the printer when you print the HTML report
Hello
I lost many many hours trying to correctly print a report that consists only of a JPEG image.
After a conversation in the forum, I have concluded that the LabVIEW includes a printing Standard reports bug, because it cannot handle properly the margins and the scale of the image. But, when using Standard reports, I could choose which printer to use.
So, I use HTML reports smoothly to print the report, but the choice of the printer has a problem. No matter which printer is chosen by a Menu of the ring, it prints to a printer even all the time.
Could you please give me a tip for this problem?
I enclose the corresponding code:
-
I use Teststand 3.0, and I would like to have the comment field of each step of my movie file teststand appearing in my html report file.
I guess I'll have to change the model of teststand ReportGen_html, but I would like to have your opinion to do so in the most simple...
I have already changed it the SequencialModel for other purposes, but the ReportGen_html seems to be much more complicated to change...
Thanks in advance for your help (and sorry for the bad English)!
I converted the wire quotes as an example to 3.0.
The approach is quite similar to my suggestion with a difference: instead of using custom step types, the example uses substitutions of callback to copy the string.
Norbert
-
How can I change the name of the .png file saved when I create a HTML report?
I have a report generation .vi that reads in several graphics and adds the 'photo' in the .html report. Is it possible to control how LabVIEW named the graphics .png resulting?
I' worm attached a photo of the small piece of code and the generated automatically.
Thank you!
Hello
The naming convention is designed to ensure that no conflict is generated that this generation of report class is called. Below, I've attached a screenshot of the feature that defines the names of the images.
You can view this block diagram by double-clicking on and by opening the reporting tools. While you are free to modify this class to implement a new naming scheme, I have to insert the disclaimer that this process has bad effect on additional functions in the report generation tool. As you can see in this code, the names are randomly generated, then applied according to a random number. You might look into the implementation of a system that gets the label of the reference of the input control control and generates the path suitable for PNG images.
I really appreciate your time. Please post any additional questions.
Sincerely,
-
When it is added a step between flow control If-Then, Html report will indent the table say. How is can this indentation be deleted?
In the "AddSequenceResultToReport", I added a condition Parameters.Level == 0 'Add starting BLOCKQUOTE' markets and "Add ending BLOCKQUOTE. This aligns the table to the left but does not align the table generated for the steps in if condition (appearing in the screenshot).
In the screenshot of the attachment, how do I get a table without indentation and spacing between the tables?
Solved!. The sous-séquence which required changes have been ProcessBlockLevelInfo. Omitted, all the measures that had
and jumped to start a new table.
-
generation of HTML reports save to the same file VI
Hi all
IM creating a sample html report using labview6.1. My question is I want to save my html report file in the current directory where the vi is instead of giving some path like 'C:\Folder1\Folder2\. '... "etc. My intention is to put the VI in a zip file so that I can send it to my friend and when he runs it is easy to find the report from the VI and the report are in the same directory...
All the methods to do?
Steve.
Try this
Maybe you are looking for
-
I developed a script to process the .tdms file in DIAdem 11.1, now I deploy the script on the same PXI system that created the .tdms file. This system had DIAdem 11.0, but when I try to open (DataFileLoadSel) the file tdms in my script, I get the er
-
What is causing the error event ' BCM42RLY service failed to start due to the following error: the system cannot find the file specified "Event Id 7000
-
compromised administrator account
My administrator account has a virus and it cannot me access other programs when you are prompted for the password (while in the guest account). I can not even sign my administrator account it gives me a weird message and then turns off my computer.
-
Get the Windows Update_000036B3 error code
I can't install Windows Internet Explorer 9 release candidate for Windows Vista properly. Get the error code "Windows Update_000036B3" "Windows Update_dt000". How can I fix it?
-
I GET THIS MEESAGE WHEN I TRY TO RUN MY DELL DRIVER AND UTILITIES CD IN MY CD/DVD DRIVE HELP!