Open christophemelin opened 1 year ago
@christophemelin Health Checker isn't intended to run multiple instances of the script at the same time on the same machine.
You pass in a list of servers to the script. The current design is working towards making the script multi-threaded, so you don't need to run multiple instances of the script. This also avoids the need to run cmdlets within the script that can take a long time to complete against the organization that are coming into the script like checking on the status of AD replication against the environment.
Hi,
Thanks for your answer but i have the latest version of HealthChecker.ps1 and I don’t see any multi-threaded actions. I just see a loop on each server !!!
I have tried a modified version of my .cmd file to pass the list of exchange servers (6 servers) and It took six times longer to execute.
For information, I have found an old mail from Lukas Sassl @.**@.>. See attachment of August 2021) A little change had been made in the script and has been working fine during more than a year. I don't understand why this functional regression since January 2023
Kind regards,
Christophe MELIN Administrateur Messagerie
Ville et Eurométropole de Strasbourg Direction du numérique et systèmes d’information – Service informatique 1 parc de l'Étoile 67076 Strasbourg Cedex
Téléphone : +33 (0)3 68 98 60 52 Poste : 86052
[logo strasbourg.eu]
[logo facebook]https://www.facebook.com/strasbourg.eu[logo twitter]https://twitter.com/strasbourg[logo dailymotion]http://www.dailymotion.com/VilledeStrasbourg
De : David Paulson @.> Envoyé : samedi 11 mars 2023 20:46 À : microsoft/CSS-Exchange @.> Cc : MELIN Christophe @.>; Mention @.> Objet : Re: [microsoft/CSS-Exchange] [Issue] - Health Checker (Issue #1554)
@christophemelinhttps://smex-ctp.trendmicro.com:443/wis/clicktime/v1/query?url=https%3a%2f%2fgithub.com%2fchristophemelin&umid=44c417ea-e14c-4e31-994c-7853ca0bfb2e&auth=998ed01b09b0dc6a471db9f314fb53c7a8bc5a6a-a762f2793116757d77ccb9c14bb074eaf1d16afc Health Checker isn't intended to run multiple instances of the script at the same time on the same machine.
You pass in a list of servers to the script. The current design is working towards making the script multi-threaded, so you don't need to run multiple instances of the script. This also avoids the need to run cmdlets within the script that can take a long time to complete against the organization that are coming into the script like checking on the status of AD replication against the environment.
Ce message est établi à usage exclusif de son destinataire. Toute utilisation ou diffusion, partielle ou totale, doit être préalablement autorisée.
Tout message électronique est susceptible d'altération et son intégrité ne peut être assurée. L'expéditeur décline toute responsabilité au titre de ce message s'il a été modifié ou falsifié.
Si vous n'êtes pas destinataire de ce message, merci de le détruire et d'avertir l'expéditeur.
As I have provided, we are working towards that design.
Could be possible fix this issue by including fractions of seconds in the log file name. The execution must be happening so quick that we are having 2 sessions or more with the same second starting.
((Get-Date).ToString('yyyyMMddHHmmssffff'))
This could work as a workaround till we get to the multithread logic. Before we get to that stage, need to clean up some of the pending work items on Health Checker.
Hello,
Thanks for your answer. I have solved my problem by an other way.
When calling get-NewLoggerInstance :
$Script:Logger = Get-NewLoggerInstance -LogName "HealthChecker-Debug" -LogDirectory $Script:OutputFilePath
-AppendDateTime $false `
-ErrorAction SilentlyContinue
I just add the name of the server :
$Script:Logger = Get-NewLoggerInstance -LogName "HealthChecker-$($Script:Server)-Debug" -LogDirectory $Script:OutputFilePath
-AppendDateTime $false `
-ErrorAction SilentlyContinue
No risk about date or time, I am sure I have a log file per server. With the filename, I know which log file for which server !
Best regards Christophe MELIN
De : David Paulson @.> Envoyé : jeudi 5 octobre 2023 15:58 À : microsoft/CSS-Exchange @.> Cc : MELIN Christophe @.>; Mention @.> Objet : Re: [microsoft/CSS-Exchange] [Issue] - Health Checker (Issue #1554)
Could be possible fix this issue by including fractions of seconds in the log file name. The execution must be happening so quick that we are having 2 sessions or more with the same second starting.
((Get-Date).ToString('yyyyMMddHHmmssffff'))
This could work as a workaround till we get to the multithread logic. Before we get to that stage, need to clean up some of the pending work items on Health Checker.
Ce message est établi à usage exclusif de son destinataire. Toute utilisation ou diffusion, partielle ou totale, doit être préalablement autorisée.
Tout message électronique est susceptible d'altération et son intégrité ne peut être assurée. L'expéditeur décline toute responsabilité au titre de ce message s'il a été modifié ou falsifié.
Si vous n'êtes pas destinataire de ce message, merci de le détruire et d'avertir l'expéditeur.
version 23.01.17.2141 and newer
description : a script can't write in the debug file because the file is in use
context : Expected behavio I have 6 exchange servers on premise. I start the script to scan the 6 servers simultaneuously and it fails because of file in use.
this problem has already been solved by changing next line $Script:Logger = Get-NewLoggerInstance -LogName "HealthChecker-Debug"
to $Script:Logger = Get-NewLoggerInstance -LogName "HealthChecker-$($Script:Server)-Debug"
version 22.05.20.1132 to version 22.11.14.1812 were OK
Best regards, Christophe