diff --git a/PSGallery/Private/Get-DonutHTML.ps1 b/PSGallery/Private/Get-DonutHTML.ps1 index 98b1d29..14234b1 100644 --- a/PSGallery/Private/Get-DonutHTML.ps1 +++ b/PSGallery/Private/Get-DonutHTML.ps1 @@ -27,6 +27,7 @@ function Get-DonutHTML { Name Version Date Change Detail David Brett 1.0 07/02/2018 Function Creation Adam Yarborough 1.1 12/06/2018 Change to return string + Alex Spicola 1.2 11/09/2018 Worker donut site name .EXAMPLE None Required #> @@ -40,6 +41,7 @@ function Get-DonutHTML { [parameter(Mandatory = $true, ValueFromPipeline = $true)]$DonutGoodColour, [parameter(Mandatory = $true, ValueFromPipeline = $true)]$DonutBadColour, [parameter(Mandatory = $true, ValueFromPipeline = $true)]$DonutStroke, + [parameter(Mandatory = $true, ValueFromPipeline = $true)]$SiteName, [parameter(Mandatory = $true, ValueFromPipeline = $true)]$SeriesName, [parameter(Mandatory = $true, ValueFromPipeline = $true)]$SeriesUpCount, [parameter(Mandatory = $true, ValueFromPipeline = $true)]$SeriesDownCount, @@ -62,12 +64,14 @@ function Get-DonutHTML { $HTML += "" if ( $Worker ) { - $HTML += "" - $HTML += "" + $HTML += "" + $HTML += "" + $HTML += "$SiteName $SeriesName" + $HTML += "" } else { $HTML += "" - $HTML += "" + $HTML += "" } $HTML += "$SeriesName" diff --git a/PSGallery/Private/New-HtmlReport.ps1 b/PSGallery/Private/New-HtmlReport.ps1 index bfabcf0..cbd1cb4 100755 --- a/PSGallery/Private/New-HtmlReport.ps1 +++ b/PSGallery/Private/New-HtmlReport.ps1 @@ -22,7 +22,8 @@ function New-HtmlReport { David Brett 1.4 26/06/2018 Bug Fixes and Code Cleaning Fixes #24 Fixes #40 - David Brett 1.5 21/08/2018 Bug fixes and naming clean up + David Brett 1.5 21/08/2018 Bug fixes and naming clean + Alex Spicola 1.6 11/09/2018 Worker donut site name, bug fixes .EXAMPLE None Required #> @@ -114,9 +115,9 @@ function New-HtmlReport { foreach ($SeriesResult in $Results) { if ("Worker" -ne $seriesresult.series) { $totalinf ++ - } + } } - $totalinf-- + if ($TotalInf -gt 1) {$totalinf--} else {$TotalInf = 1} $ColumnPercent = 100 / [int]$totalinf foreach ($SeriesResult in $Results) { @@ -125,6 +126,7 @@ function New-HtmlReport { $Width = $Height $Up = 0 $Down = 0 + $SiteName = "" # Blank XD site name, not used for these donuts $Series = $SeriesResult.Series if ($null -ne $series) { if ( "Worker" -ne $Series ) { @@ -144,7 +146,7 @@ function New-HtmlReport { "NetScaler" {$NewSeries = "Citrix ADC"; break} default {$NewSeries = $Series; break} } - Get-DonutHTML $Height $Width $UpColor $DownColor $DonutStroke $NewSeries $Up $Down | Out-File $HTMLOutputFileFull -Append + Get-DonutHTML $Height $Width $UpColor $DownColor $DonutStroke $SiteName $NewSeries $Up $Down | Out-File $HTMLOutputFileFull -Append "" | Out-File $HTMLOutputFileFull -Append } } @@ -172,6 +174,7 @@ function New-HtmlReport { foreach ($SeriesResult in $Results) { $DonutStroke = $ConfigObject.Global.WebData.WorkerDonutStroke $Height = $ConfigObject.Global.WebData.WorkerDonutSize + $ShowSiteName = $ConfigObject.Global.WebData.WorkerSiteName $Width = $Height $Series = $SeriesResult.Series @@ -189,7 +192,13 @@ function New-HtmlReport { default {$NewName = $Series; break} } "" | Out-File $HTMLOutputFileFull -Append - Get-DonutHTML $Height $Width $UpColor $DownColor $DonutStroke $NewName $Up $Down -Worker | Out-File $HTMLOutputFileFull -Append + if ($ShowSiteName -eq $true) { + $SiteName = $CheckData.Values.SiteName | Select-Object -Unique + Get-DonutHTML $Height $Width $UpColor $DownColor $DonutStroke $SiteName $NewName $Up $Down -Worker | Out-File $HTMLOutputFileFull -Append + } else { + $SiteName = "" + Get-DonutHTML $Height $Width $UpColor $DownColor $DonutStroke $SiteName $NewName $Up $Down -Worker | Out-File $HTMLOutputFileFull -Append + } "" | Out-File $HTMLOutputFileFull -Append } } diff --git a/Package/euc-monitoring-json-ref.txt b/Package/euc-monitoring-json-ref.txt index f206d22..0e4883a 100644 --- a/Package/euc-monitoring-json-ref.txt +++ b/Package/euc-monitoring-json-ref.txt @@ -15,6 +15,7 @@ "htmldatafile": "htmldata.txt", - Can leave as default "htmloutputfile": "index.html", - HTML Output File. can leave as default "refreshduration": 0, - HTML Automatic page refresh, in seconds. 0 for no refresh + "WorkerSiteName": false, - Display XD site name in server and desktkop worker donuts "UpColour": "rgba(221, 70, 70, 0.9)", - Color for Up Servers "DownColour": "rgba(67, 137, 203, 0.95)", - Color for Down Servers. "WorkerDonutStroke": 5, - Width for the Worker Donut Ring diff --git a/Package/euc-monitoring.json.template b/Package/euc-monitoring.json.template index 0dcd509..4fe7c30 100644 --- a/Package/euc-monitoring.json.template +++ b/Package/euc-monitoring.json.template @@ -15,6 +15,7 @@ "htmldatafile": "htmldata.txt", "htmloutputfile": "index.html", "refreshduration": 0, + "WorkerSiteName": false, "UpColour": "rgba(221, 70, 70, 0.9)", "DownColour": "rgba(67, 137, 203, 0.95)", "WorkerDonutStroke": 5, @@ -366,4 +367,4 @@ "SessionManagerProxy" ] } -} \ No newline at end of file +}