What is the Health Watchdog Service?
The Sureview Health Watchdog service monitors the SureView Device Service and restarts it automatically if it stops running or stops working correctly. That includes the service failing, running into an issue that stops it processing, or being stopped accidentally.
There are advanced configuration options which are detailed below but for most use cases we recommend leaving the settings on their default values.
Configuration:
All configuration changes for the service, need to be done in the appsettings.json file.
To adjust the checking interval:-
If the intervals are too close together, or too far apart, you can adjust the amount of time between checks using the values below.
Default:
"DetectionWindowSeconds": 30,Adjusted (changed to 15 seconds):
"DetectionWindowSeconds": 15,
To adjust the failure rate before recovery:-
If you want to have it so that you can have the service restart as soon as it fails on a check, then you can do this by adjusting the parameter below.
Default:
"FailuresBeforeRestart": 3,Adjusted (restart on failure):
"FailuresBeforeRestart": 0,
Changing the amount of time for it to restart the service before checking:-
This is setup as a command timeout, so if the service hasn't started within this allotted time, it will re-attempt the kill / restart on the service to bring it back online (depending on your configuration).
Default:
"RestartWaitTimeoutSeconds": 30,Adjusted (to 15-seconds after check):
"RestartWaitTimeoutSeconds": 15,
To turn toggle on / off the monitoring:-
If you would like to disable the monitoring all together, you can set this variable to false to disable the checking.
Default:
"MonitoringEnabled": true,Adjusted:
"MonitoringEnabled": false,
Enabling camera checks:
If you want to setup the system to check a specific camera using an integration, this is possible by updating the configuration and if there is a failure on the camera check it will restart the service*
Once this is setup, it will ensure that it is receiving frames from the specified camera within the allotted time before declaring that it has failed - please ensure that this is updated relevant to your environment.
Default:
"MonitoredServices": [
{
"Name": "SVDevices",
"Port": 80,
"CameraCheck": {
"Enabled": false,
"IntervalSeconds": 300,
"FailuresBeforeRestart": 2,
"VideoWaitTimeoutSeconds": 15,
"File": "DevTest.dll",
"Type": "DevTest.TestDevice",
"UrlTemplate": "",
"PrefValue": "",
"Host": "",
"Port": "",
"User": "",
"Password": "",
"Extra": "",
"Input1": "2",
"Input2": "",
"DeviceExtra": "",
"Quality": "Medium",
"AlarmRecorder": "0",
"NewWorker": 1
}Adjusted (Camera Monitoring - EXAMPLE):
"MonitoredServices": [
{
"Name": "SVDevices",
"Port": 80,
"CameraCheck": {
"Enabled": true,
"IntervalSeconds": 300,
"FailuresBeforeRestart": 2,
"VideoWaitTimeoutSeconds": 30,
"File": "MilestoneMIP2021\\DevMilestoneMIP2021.dll",
"Type": "DevMilestoneMIP2021.MilestoneCam",
"UrlTemplate": "",
"PrefValue": "",
"Host": "192.168.1.200",
"Port": "443",
"User": "SureView",
"Password": "###",
"Extra": "",
"Input1": "2",
"Input2": "-1",
"DeviceExtra": "asd1124-asdc241-xsqr112-3ff2sf-2d2wss",
"Quality": "Medium",
"AlarmRecorder": "0",
"NewWorker": 1
}*We do not recommend setting this up by yourself as this could cause the service to continuously restart on a bad camera / incorrect configuration. Please speak with a member of the SureView team if you would like to look into setting this up.
Adding additional services to monitor:-
If you want to monitor multiple services, you can add these to the configuration with their corresponding port to be checked.
Default:
{ "Name": "SVDevices", "Port": 80, "CameraCheck": { "Enabled": false } },Adjusted (setup a secondary SVDevices Service):
{ "Name": "SVDevices", "Port": 80, "CameraCheck": { "Enabled": false } },
{ "Name": "SVDevices2", "Port": 8080, "CameraCheck": { "Enabled": false } }To view the service directly:
- Stop the service from running:
-
Go to the installation folder of the Health Watchdog service and open the SVHealthWatchdog.exe:
- A view of what it looks like when the terminal is working, and checking the services:
- What it should look like if there is an issue with the service that you are monitoring (SVDevices Service Crash):
Troubleshooting:
Services are failing and not recovering:
You will need to ensure that everything is setup to monitor the service in the appsettings.json, if the service isn't setup in here then it won't be monitored (Currently only Device Service is monitored).
If you have set it up, and all of the settings (failure rate, recovery time and so on...) are setup correctly, you can run the app locally as a console app - to do this:
- Stop the service from running
- Go to the installation folder for the integration
- Right click the SVHealthWatchDog.exe file and select 'Run as administrator'
Once you have it running, you will be able to see all of the calls that are being made by the service. If running the EXE as an administrator then recovers the service, there will be a permission issue the user account trying to run the service.
The Service is failing to run:
If the service is failing to run, this can be caused by 2 things:
- Incorrect user permissions to run the service or
- Syntax errors in the appsettings.json file
If both of these are working, then please ensure that your anti-virus (or device protection services) are allowing the service to run, as well as not stopping the service from running interval checks or starting services.
Further Support:
If it still isn't recovering the services, you are seeing errors in the console app, or you are having issues configurating the appsettings.json file - please contact SureView support, or your account manager, and we will find the best way to assist you with this; help@sureviewsystems.com.
Comments
0 comments
Article is closed for comments.