Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Excluded Catalogs should be not processed #56

Open
sacha81 opened this Issue Apr 24, 2018 · 12 comments

Comments

Projects
None yet
3 participants
@sacha81
Copy link
Owner

sacha81 commented Apr 24, 2018

Excluded Catalogs should not only be skipped in the report instead it should not be processed to avoid wasting execution time. (Thanks for the input Saravana)

@piyushks86

This comment has been minimized.

Copy link

piyushks86 commented Apr 24, 2018

Hi Sacha,

Can we exclude a particular delivery group and all servers in that delivery group from the report?

Regards
Piyush

@piyushks86

This comment has been minimized.

Copy link

piyushks86 commented Apr 24, 2018

I am using version 1.2.2

Regards
Piyush

@sacha81

This comment has been minimized.

Copy link
Owner Author

sacha81 commented Apr 24, 2018

the current version is 1.3.4, but this don't have the function for a DeliveryGroup, just for Catalogs (Line 42-48 in XA-and-XD-HealthCheck_Parameters.xml )

Or you can work with tags (Line 49-55 in XA-and-XD-HealthCheck_Parameters.xml )

Both just excludes in the Report, but is needs anyway time for the check. Hope I have some day time to improve this.

@Im-Saravana

This comment has been minimized.

Copy link

Im-Saravana commented Apr 26, 2018

Hi Sacha,

Thanks for looking into this. Today had some time and tried with below snippet and it's working fine. If you are okay with that mean, I can merge it with the PowerShell script.

MyTestScript

if ((Get-PSSnapin "Citrix.Broker.Admin." -EA silentlycontinue) -eq $null) {
try { Add-PSSnapin Citrix.Broker.Admin.
-ErrorAction Stop }
catch { write-error "Error Get-PSSnapin Citrix.Broker.Admin.* Powershell snapin"; Return }
}
$AdminAddress = "localhost"
$maxmachines=500
clear
$CatalogResults = @{}
$Catalogs = Get-BrokerCatalog -AdminAddress $AdminAddress
$ExcludedCatalogs='MachineCatalog1','Machinecatalog2'

foreach ($Catalog in $Catalogs) {
$tests = @{}

#Name of MachineCatalog
$CatalogName = $Catalog | %{ $_.Name }

if ($ExcludedCatalogs -like "$CatalogName" )
{
"$CatalogName is excluded folder hence skipping"
}
else
{
$XAmachines = Get-BrokerMachine -MaxRecordCount $maxmachines -MachineName "*" -CatalogName $CatalogName -AdminAddress $AdminAddress #| Where-Object {$.SessionSupport -eq "MultiSession" -and @(compare $.tags $ExcludedTags -IncludeEqual | ? {$_.sideindicator -eq '=='}).count -eq 0}
foreach ($XAmachine in $XAmachines) {
$tests = @{}

$machineDNS = $XAmachine | %{ $_.DNSName }
Write-Host "Server $machineDNS in $CatalogName" #$XAmachine
}
}

}

@Im-Saravana

This comment has been minimized.

Copy link

Im-Saravana commented Apr 26, 2018

Hi Sacha,

Attached script is working fine and it is not processing the excluded catalog, however, need to check the excluded tag and catalog name. can you please check the line 1238, needs to correct it for tagging. can you please check the syntax.

I commented my changes in #skip (line: 1218-1246)

XA-and-XD-HealthCheck_exclude.txt

@sacha81

This comment has been minimized.

Copy link
Owner Author

sacha81 commented Apr 26, 2018

something is wrong in the script, I only see one XenApp catalog when I run your version.
Seems with your line 1239 you just check one single catalog.

@Im-Saravana

This comment has been minimized.

Copy link

Im-Saravana commented Apr 30, 2018

Ah! I will do the test again.

@Im-Saravana

This comment has been minimized.

Copy link

Im-Saravana commented Apr 30, 2018

just moved the line #1236 and #1223 to 1220, Issue resolved,. The problem was with the data set resetting inside the loop ($allXenAppResults = @{}) so last catalog server checks only saving in the result.

Attached the corrected script. Also on line 1238 if you are making changes on adding Catalog name verification or tagging would fix the tag exclusions. My scripting language is not good enough to work on that line.

XA-and-XD-HealthCheck_exclude.txt

@sacha81

This comment has been minimized.

Copy link
Owner Author

sacha81 commented Apr 30, 2018

there is still something wrong - now I have an empty catalogs table. sorry that I currently have more time to support on this.

@Im-Saravana

This comment has been minimized.

Copy link

Im-Saravana commented May 1, 2018

It's working fine for me and I have tested with 2 different Farms. Can you please check the log.

Also, make sure you are not excluding all the catalogs.

@sacha81

This comment has been minimized.

Copy link
Owner Author

sacha81 commented May 15, 2018

I just tested successfully and merged into the master branch - tagging work now. Please test now again against your environment.

@Im-Saravana

This comment has been minimized.

Copy link

Im-Saravana commented Jun 13, 2018

Apologies for the late response, I was on a vacation. All looks fine! Thanks Sacha :)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.