From 068113a13dc7f531583a6ac180e4351b4df6ebe4 Mon Sep 17 00:00:00 2001 From: aspicola2605 <37516732+aspicola2605@users.noreply.github.com> Date: Thu, 13 Sep 2018 16:02:21 -0400 Subject: [PATCH 1/8] New package files for worker site name --- Package/euc-monitoring-json-ref.txt | 1 + Package/euc-monitoring.json.template | 1 + 2 files changed, 2 insertions(+) diff --git a/Package/euc-monitoring-json-ref.txt b/Package/euc-monitoring-json-ref.txt index f206d22..7159730 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..3beb4a6 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, From b8d1996cf4588e40f54c9c2fcb3a877fc1244d74 Mon Sep 17 00:00:00 2001 From: aspicola2605 <37516732+aspicola2605@users.noreply.github.com> Date: Thu, 13 Sep 2018 16:03:06 -0400 Subject: [PATCH 2/8] Function files for worker site name/bug fixes --- PSGallery/Private/Get-DonutHTML.ps1 | 10 +++++++--- PSGallery/Private/New-HtmlReport.ps1 | 17 +++++++++++++---- 2 files changed, 20 insertions(+), 7 deletions(-) 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..b469c17 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.7 11/09/2018 Worker donut site name, bug fixes .EXAMPLE None Required #> @@ -116,7 +117,7 @@ function New-HtmlReport { $totalinf ++ } } - $totalinf-- + if ($TotalInf -gt 1) {$totalinf--} $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 -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 } } From e007a1b9608e04eb6eaf4ffc378f7c30c8cddae2 Mon Sep 17 00:00:00 2001 From: aspicola2605 <37516732+aspicola2605@users.noreply.github.com> Date: Thu, 13 Sep 2018 16:04:28 -0400 Subject: [PATCH 3/8] Update euc-monitoring-json-ref.txt --- Package/euc-monitoring-json-ref.txt | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/Package/euc-monitoring-json-ref.txt b/Package/euc-monitoring-json-ref.txt index 7159730..f1b8d6f 100644 --- a/Package/euc-monitoring-json-ref.txt +++ b/Package/euc-monitoring-json-ref.txt @@ -15,7 +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 + "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 @@ -347,4 +347,4 @@ "SessionManagerProxy" ] } -} \ No newline at end of file +} From 50bc04416b6bea0031d77710c0ed168606a42f9f Mon Sep 17 00:00:00 2001 From: aspicola2605 <37516732+aspicola2605@users.noreply.github.com> Date: Thu, 13 Sep 2018 16:04:45 -0400 Subject: [PATCH 4/8] Update euc-monitoring.json.template --- Package/euc-monitoring.json.template | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/Package/euc-monitoring.json.template b/Package/euc-monitoring.json.template index 3beb4a6..4fe7c30 100644 --- a/Package/euc-monitoring.json.template +++ b/Package/euc-monitoring.json.template @@ -15,7 +15,7 @@ "htmldatafile": "htmldata.txt", "htmloutputfile": "index.html", "refreshduration": 0, - "WorkerSiteName": false, + "WorkerSiteName": false, "UpColour": "rgba(221, 70, 70, 0.9)", "DownColour": "rgba(67, 137, 203, 0.95)", "WorkerDonutStroke": 5, @@ -367,4 +367,4 @@ "SessionManagerProxy" ] } -} \ No newline at end of file +} From 3303ca3bdc77e90eba99db382cb2f0e270d9a655 Mon Sep 17 00:00:00 2001 From: aspicola2605 <37516732+aspicola2605@users.noreply.github.com> Date: Thu, 13 Sep 2018 16:40:32 -0400 Subject: [PATCH 5/8] New-HtmlReport bug fix #2 --- PSGallery/Private/New-HtmlReport.ps1 | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/PSGallery/Private/New-HtmlReport.ps1 b/PSGallery/Private/New-HtmlReport.ps1 index b469c17..554d042 100755 --- a/PSGallery/Private/New-HtmlReport.ps1 +++ b/PSGallery/Private/New-HtmlReport.ps1 @@ -115,9 +115,9 @@ function New-HtmlReport { foreach ($SeriesResult in $Results) { if ("Worker" -ne $seriesresult.series) { $totalinf ++ - } + } } - if ($TotalInf -gt 1) {$totalinf--} + if ($TotalInf -gt 1) {$totalinf--} else {$TotalInf = 1} $ColumnPercent = 100 / [int]$totalinf foreach ($SeriesResult in $Results) { From 1ad736109937b1f91feef33de15be3a52e73f214 Mon Sep 17 00:00:00 2001 From: aspicola2605 <37516732+aspicola2605@users.noreply.github.com> Date: Thu, 13 Sep 2018 18:59:33 -0400 Subject: [PATCH 6/8] json reference update --- Package/euc-monitoring-json-ref.txt | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/Package/euc-monitoring-json-ref.txt b/Package/euc-monitoring-json-ref.txt index f1b8d6f..0e4883a 100644 --- a/Package/euc-monitoring-json-ref.txt +++ b/Package/euc-monitoring-json-ref.txt @@ -15,7 +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 + "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 @@ -347,4 +347,4 @@ "SessionManagerProxy" ] } -} +} \ No newline at end of file From b1a27421fc2e688536280e0773e8df3b2fd3ed8a Mon Sep 17 00:00:00 2001 From: aspicola2605 <37516732+aspicola2605@users.noreply.github.com> Date: Fri, 14 Sep 2018 13:05:48 -0400 Subject: [PATCH 7/8] Update version # --- PSGallery/Private/New-HtmlReport.ps1 | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/PSGallery/Private/New-HtmlReport.ps1 b/PSGallery/Private/New-HtmlReport.ps1 index 554d042..fcb8e79 100755 --- a/PSGallery/Private/New-HtmlReport.ps1 +++ b/PSGallery/Private/New-HtmlReport.ps1 @@ -23,7 +23,7 @@ function New-HtmlReport { Fixes #24 Fixes #40 David Brett 1.5 21/08/2018 Bug fixes and naming clean - Alex Spicola 1.7 11/09/2018 Worker donut site name, bug fixes + Alex Spicola 1.6 11/09/2018 Worker donut site name, bug fixes .EXAMPLE None Required #> From 4285c145bd387c2d36201e86a00d75e1b4592eb1 Mon Sep 17 00:00:00 2001 From: aspicola2605 <37516732+aspicola2605@users.noreply.github.com> Date: Fri, 14 Sep 2018 14:34:39 -0400 Subject: [PATCH 8/8] Correct appveyor error --- PSGallery/Private/New-HtmlReport.ps1 | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/PSGallery/Private/New-HtmlReport.ps1 b/PSGallery/Private/New-HtmlReport.ps1 index fcb8e79..cbd1cb4 100755 --- a/PSGallery/Private/New-HtmlReport.ps1 +++ b/PSGallery/Private/New-HtmlReport.ps1 @@ -193,7 +193,7 @@ function New-HtmlReport { } "" | Out-File $HTMLOutputFileFull -Append if ($ShowSiteName -eq $true) { - $SiteName = $CheckData.Values.SiteName | select -Unique + $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 = ""