Invoke-icingacheckhttpstatus only unknown

is it possible to get a warning or critical if the http Link is not reachable. I get only a unknown.

PS C:\WINDOWS\system32> Invoke-IcingaCheckHTTPStatus -URL http://test -StatusCode 200,105 -Warning 1 -Verbosity 3
[UNKNOWN] HTTP Status Check: 1 Unknown [UNKNOWN] HTTP Status Check http://test (All must be [OK])
_ [UNKNOWN] HTTP Status Check http://test (All must be [OK])
_ [OK] HTTP Content Check (Atleast 1 must be [OK])
_ [UNKNOWN] HTTP Response Time: 0us
_ [UNKNOWN] HTTP Status Code: The remote name could not be resolved: ‘test’
| ‘http_test.http_status’=The remote name could not be resolved: ‘test’;; ‘http_test.http_response_time’=0s;; ‘http_test.ht
tp_content_size’=0B;;
3

It is not reachable, because it cannot be resolved. In this case, a Unknown is a valid response (imho).
Test it with a valid URL and you should get a critical, when it is not reachable.

Here is a check from a existing website. When I stop the IIS. I get only a unknown.

This should indeed be a critical. Maybe @cstein kann clarify here?

hello, @el-dummy how it was solved for you? have the same issue.

Marcin

I have no solution. I think the check only triggers critical/warning only if the response time is bad.

Hi,
you have to add the flag: -ConnectionErrAsCrit
so UNKNOWN becomes CRITICAL as explained here:
Invoke-IcingaCheckHTTPStatus - Icinga for Windows

this feature was added very recently and released with icinga-powershell-plugins 1.10.0