2021-10-26 03:30:57 -04:00
|
|
|
function Start-IcingaForWindowsRESTThread()
|
|
|
|
|
{
|
|
|
|
|
param (
|
|
|
|
|
[int]$ThreadId = 0,
|
|
|
|
|
[switch]$RequireAuth = $FALSE
|
|
|
|
|
);
|
|
|
|
|
|
|
|
|
|
# Now create a new thread, assign a name and parse all required arguments to it.
|
|
|
|
|
# Last but not least start it directly
|
|
|
|
|
New-IcingaThreadInstance `
|
2021-12-09 11:42:06 -05:00
|
|
|
-Name 'CheckThread' `
|
2021-10-26 03:30:57 -04:00
|
|
|
-ThreadPool (New-IcingaThreadPool -MaxInstances 1) `
|
|
|
|
|
-Command 'New-IcingaForWindowsRESTThread' `
|
|
|
|
|
-CmdParameters @{
|
2021-12-09 11:42:06 -05:00
|
|
|
'RequireAuth' = $RequireAuth;
|
|
|
|
|
'ThreadId' = $ThreadId;
|
2021-10-26 03:30:57 -04:00
|
|
|
} `
|
2022-03-18 15:58:56 -04:00
|
|
|
-Start `
|
|
|
|
|
-CheckAliveState;
|
2021-10-26 03:30:57 -04:00
|
|
|
}
|