Given that you have defined the following in healthchecks.yml:
some-service-is-running:
name: some-service-is-running
local_script: is-running.ps1
interval: 10
the check that will be generated by CDA will look like:
"checks": {
"order-notification-service-is-running": {
"command": "C:\\temp\\e3c9cfb0-f92c-11e6-be86-8389fd3ece3c\\archive\\healthchecks\\sensu\\is-running.ps1",
"interval": 10
}
}
}
when running this check, Sensu client will always timeout and eventually, by the look of it, stop. this is because Sensu client doesn't know how to run PowerShell scripts out of the box. looking at other system checks, e.g. consul-deployment-agent, we need to define the check as follows for it to run properly:
"checks": {
"order-notification-service-is-running": {
"command": "powershell.exe -NonInteractive -NoProfile -ExecutionPolicy Bypass -file \"C:\\temp\\e3c9cfb0-f92c-11e6-be86-8389fd3ece3c\\archive\\healthchecks\\sensu\\is-running.ps1\"",
"interval": 10
}
}
}
now, because of the way we have to define checks using the yaml file specification, i.e. local_script or server_script + script_arguments, it means that Windows users cannot include the powershell.exe -NonInteractive -NoProfile -ExecutionPolicy Bypass -file bit of the command as this won't match a filename on disk. this validation is done in CDA before registering a check.
Given that you have defined the following in
healthchecks.yml:the check that will be generated by CDA will look like:
when running this check, Sensu client will always timeout and eventually, by the look of it, stop. this is because Sensu client doesn't know how to run PowerShell scripts out of the box. looking at other system checks, e.g. consul-deployment-agent, we need to define the check as follows for it to run properly:
now, because of the way we have to define checks using the yaml file specification, i.e.
local_scriptorserver_script+script_arguments, it means that Windows users cannot include thepowershell.exe -NonInteractive -NoProfile -ExecutionPolicy Bypass -filebit of the command as this won't match a filename on disk. this validation is done in CDA before registering a check.