Skip to content

Commit 8fce187

Browse files
authored
Merge pull request #138 from Icinga:fix/use_correct_conversion_functions_for_tcp_plugin
Fix TCP plugin, use Convert-IcingaPluginThresholds Instead of using `ConvertTo-SecondsFromIcingaThresholds` we should use `Convert-IcingaPluginThresholds` for converting our plugin thresholds for `Invoke-IcingaCheckTCP`.
2 parents 9ab2a01 + c86bb12 commit 8fce187

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

plugins/Invoke-IcingaCheckTCP.psm1

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -78,8 +78,8 @@ function Invoke-IcingaCheckTCP()
7878
$Verbosity = 0
7979
);
8080

81-
$Warning = ConvertTo-SecondsFromIcingaThresholds $Warning;
82-
$Critical = ConvertTo-SecondsFromIcingaThresholds $Critical;
81+
$Warning = Convert-IcingaPluginThresholds $Warning;
82+
$Critical = Convert-IcingaPluginThresholds $Critical;
8383
$ConnectionData = Measure-IcingaTCPConnection -Address $Address -Ports $Ports;
8484
$CheckPackage = New-IcingaCheckPackage -Name 'TCP Connections' -OperatorAnd -Verbose $Verbosity;
8585

@@ -106,7 +106,7 @@ function Invoke-IcingaCheckTCP()
106106
-Unit 's' `
107107
-LabelName ([string]::Format('port_{0}_time', $port));
108108

109-
$ConnectionTimeCheck.WarnOutOfRange($Warning).CritOutOfRange($Critical) | Out-Null;
109+
$ConnectionTimeCheck.WarnOutOfRange($Warning.Value).CritOutOfRange($Critical.Value) | Out-Null;
110110

111111
$ConnectionPackage.AddCheck($ConnectionCheck);
112112
$ConnectionPackage.AddCheck($ConnectionTimeCheck);

0 commit comments

Comments
 (0)