-
Notifications
You must be signed in to change notification settings - Fork 31
Description
I get the following two errors every time when a MSSQL Check ist executed via REST API
EventID 2051:
Failed to execute API call
An API call could not be processed due to an internal exception.
Object dumps if available:
Cannot process argument transformation on parameter 'SqlPassword'. Cannot create object of type "System.Security.SecureString". "Length" is a ReadOnly property.
EventID 1553:
Failed to query Icinga check over internal REST-Api check handler
A service check could not be executed by using the internal REST-Api check handler. The check either ran into a timeout or could not be processed. Maybe the check was not registered to be allowed for being executed. Further details can be found below.
Object dumps if available:
The remote server returned an error: (500) Internal Server Error.
Invoke-IcingaCheckMSSQLHealthName Value
SqlPassword System.Security.SecureString
SqlUsername monitoring
Verbosity 3
SQL COmmands are whitelisted
PS C:\Windows\system32> Show-IcingaRESTApiCommands
API Endpoint "apichecks"
################Whitelisted: Invoke-IcingaCheck*, Invoke-IcingaCheckMSSQL*, Invoke-IcingaCheckMSSQLHealth
Blacklisted: None
Icinga service conf:
apply Service "MSSQL Health" {
import "generic-service"
check_command = "Invoke-IcingaCheckMSSQLHealth"
max_check_attempts = 3
check_interval = 5m
retry_interval = 5m
enable_flapping = true
command_endpoint = host_name
if (host.vars.IcingaCheckMSSQLHealth_Int32_Verbosity) {
vars.IcingaCheckMSSQLHealth_Int32_Verbosity = host.vars.IcingaCheckMSSQLHealth_Int32_Verbosity
} else {
vars.IcingaCheckMSSQLHealth_Int32_Verbosity = 3
}
if (host.vars.IcingaCheckMSSQLHealth_String_SqlUsername) {
vars.IcingaCheckMSSQLHealth_String_SqlUsername = host.vars.IcingaCheckMSSQLHealth_String_SqlUsername
} else {
vars.IcingaCheckMSSQLHealth_String_SqlUsername = "USER"
}
if (host.vars.IcingaCheckMSSQLHealth_Securestring_SqlPassword) {
vars.IcingaCheckMSSQLHealth_Securestring_SqlPassword = host.vars.IcingaCheckMSSQLHealth_Securestring_SqlPassword
} else {
vars.IcingaCheckMSSQLHealth_Securestring_SqlPassword = "PASSWD"
}
assign where host.vars.powershell_framework == true && host.vars.mon_mssql1 == true
}
How is ist possible to debug this? Or is there a missconfiguation? Manual executing works without these errors and without using REST API.
