L.6 Configuring the Swyx HealthMonitor
The Swyx HealthMonitor is a Windows service that must be installed separately in the VM. This section describes the installation and configuration of this service.
mkdir "$env:ProgramFiles\Swyx.Core.HealthMonitor"
Expand-Archive -Path Swyx.Core.HealthMonitor.zip -DestinationPath "$env:ProgramFiles\Swyx.Core.HealthMonitor"
./install-service.ps1
./install-service.ps1 -EnableHyperVSupport
The parameter "-EnableHyperVSupport" configures the Swyx HealthMonitor service to run with local administration rights. This is necessary because Microsoft Windows only allows administrators to use Hyper-V Heartbeat Integration Services interface.
The installation script has some optional parameters to customize the installation. In most cases, the default settings are sufficient. You can get a description of the options with the normal PowerShell help function:
get-help ./install-service.ps1 -full
As of Swyx Health Monitor 1.2 the steps in this section can be omitted for standard setups, because the file "appSettings.json" is adjusted automatically by the installation script.
Services that are monitored via HTTP instead of SIP have an HTTP instead of SIP URL in the "appSettings.json" file at "destination". If the service does not have a verifiable TLS certificate, you can disable the HealthMonitor TLS certificate check for monitoring. To do this, add the setting "skipTlsCheck": "false".
The installation script adjusts the service restart options of the Swyx services in Windows. A Swyx service that stops unexpectedly is restarted only once by Windows. The installation script only adjusts the services configured in "Probes" in appSettings.json. Therefore, run the installation script again when you add or remove probes.
The following example shows a typical configuration for a server with IP 10.0.0.1:
{
"HealthMonitorApp": {
"Prometheus": false,
"VSphereHeartbeat": true
"HyperVHeartbeat": false
},
"Probes": [
{
"Name": "server",
"Type": "Network",
"Configuration": {
"destination": "sip://10.0.0.1:5060",
"probingIntervalSeconds": 10,
"responseTimeoutMilliseconds": 5000
}
},
{
"Name": "uaCSTA",
"Type": "Network",
"Configuration": {
"destination": "sip://10.0.0.1:65012",
"probingIntervalSeconds": 10,
"responseTimeoutMilliseconds": 500
}
},
{
"Name": "linkmgr",
"Type": "Network",
"Configuration": {
"destination": "sip://10.0.0.1:65001",
"probingIntervalSeconds": 10,
"responseTimeoutMilliseconds": 500
}
},
{
"Name": "conferencemgr",
"Type": "Network",
"Configuration": {
"destination": "sip://10.0.0.1:5062",
"probingIntervalSeconds": 10
}
},
{
"Name": "phonemgr",
"Type": "Network",
"Configuration": {
"destination": "sip://10.0.0.1:65007",
"probingIntervalSeconds": 10
}
},
{
"Name": "swyxgate",
"Type": "Network",
"Configuration": {
"destination": "sip://10.0.0.1:5064",
"probingIntervalSeconds": 10
}
},
{
"Name": "ctiplus",
"Type": "Network",
"Configuration": {
"destination": "sip://10.0.0.1:65009",
"probingIntervalSeconds": 10
}
},
{
"Name": "faxserver",
"Type": "Network",
"Configuration": {
"destination": "sip://10.0.0.1:61000",
"probingIntervalSeconds": 10
}
},
{
"Name": "cds",
"Type": "Network",
"Configuration": {
"destination": "https://10.0.0.1:9100/ippbx/client/v1.0/login/systemhealth",
"probingIntervalSeconds": 10,
"responseTimeoutMilliseconds": 1000
}
}
],
"HealthRules": [
{
"ProbeName": "server",
"MetricName": "swyx_number_of_failed_probes",
"LessThanOrEqual": 3
},
{
"ProbeName": "uaCSTA",
"MetricName": "swyx_number_of_failed_probes",
"LessThanOrEqual": 2
},
{
"ProbeName": "linkmgr",
"MetricName": "swyx_number_of_failed_probes",
"LessThanOrEqual": 2
},
{
"ProbeName": "conferencemgr",
"MetricName": "swyx_number_of_failed_probes",
"LessThanOrEqual": 2
},
{
"ProbeName": "phonemgr",
"MetricName": "swyx_number_of_failed_probes",
"LessThanOrEqual": 2
},
{
"ProbeName": "swyxgate",
"MetricName": "swyx_number_of_failed_probes",
"LessThanOrEqual": 2
},
{
"ProbeName": "cds",
"MetricName": "swyx_number_of_failed_probes",
"LessThanOrEqual": 2
},
{
"ProbeName": "pns",
"MetricName": "swyx_number_of_failed_probes",
"LessThanOrEqual": 2
},
{
"ProbeName": "faxserver",
"MetricName": "swyx_number_of_failed_probes",
"LessThanOrEqual": 2
},
{
"ProbeName": "ctiplus",
"MetricName": "swyx_number_of_failed_probes",
"LessThanOrEqual": 2
},
{
"ProbeName": "ctiplus",
"MetricName": "swyx_number_of_failed_probes",
"LessThanOrEqual": 2
}
],
"Serilog": {
"MinimumLevel": {
"Default": "Information"
},
"WriteTo": [
{
"Name": "Console",
"Args": {
"outputTemplate":
"{Timestamp:dd HH:mm:ss.fff} {Level:u4} {ThreadId} {SourceContext} {Message}{NewLine}{Exception}",
"theme": "Serilog.Sinks.SystemConsole.Themes.AnsiConsoleTheme::Code, Serilog.Sinks.Console"
}
},
{
"Name": "File",
"Args": {
"path": "C:\\ProgramData\\Swyx\\Traces\\Swyx.Core.HealthMonitor.txt",
"rollingInterval": "Day",
"retainedFileCountLimit": 7,
"outputTemplate":
"{Timestamp:dd HH:mm:ss.fff} {Level:u4} {ThreadId} {SourceContext,-50} {Message}{NewLine}{Exception}"
}
}
],
"Enrich": ["FromLogContext", "WithThreadId"]
},
"AllowedHosts": "*"
}