Fix double colon if added by check

This commit is contained in:
Lord Hepipud 2021-05-31 15:39:52 +02:00
parent 67a8908cb2
commit eb81a12963

View file

@ -114,10 +114,17 @@ function New-IcingaCheck()
); );
} }
[bool]$AddColon = $TRUE;
if ([string]::IsNullOrEmpty($this.Name) -eq $FALSE -And $this.Name[$this.Name.Length - 1] -eq ':') {
$AddColon = $FALSE;
}
$this.__CheckOutput = [string]::Format( $this.__CheckOutput = [string]::Format(
'{0} {1}: {2}{3}', '{0} {1}{2} {3}{4}',
$IcingaEnums.IcingaExitCodeText[$this.__CheckState], $IcingaEnums.IcingaExitCodeText[$this.__CheckState],
$this.Name, $this.Name,
(&{ if ($AddColon) { return ':'; } else { return ''; } }),
$PluginThresholds, $PluginThresholds,
$TimeSpan $TimeSpan
); );