You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
This change adds an external watchdog for windows. When enabled, any cf-agent
processes found running longer than 5 minutes are terminated.
Ticket: ENT-5538
Changelog: Title
Copy file name to clipboardExpand all lines: cfe_internal/core/watchdog/README.md
+14Lines changed: 14 additions & 0 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -50,6 +50,20 @@ If there is less than 500MB of free space, the watchdog will clean up old archiv
50
50
- Introduced check for too many concurrent cf-agent processes (3.15.0)
51
51
- Introduced check for integrity issues identified by cf-check (3.15.0)
52
52
53
+
## Windows Watchdog
54
+
55
+
The Windows watchdog is implemented as a powershell script rendered via mustache template.
56
+
57
+
When **enabled** the policy ensures that the watchdog script is scheduled for execution via the windows task scheduler.
58
+
59
+
When **disabled** the policy ensures that the there it no scheduled task named `CFEngine-watchdog`.
60
+
61
+
The watchdog logs to `$(sys.workdir)/watchdog.log` (`C:\Program Files\Cfengine\watchdog.log`). Note, this log file is **not** automatically rotated or purged.
62
+
63
+
**History:**
64
+
65
+
- Initially introduced with check to terminate any cf-agent processes that have been running for longer than 5 minutes. (3.17.0)
66
+
53
67
### Symptoms of pathology
54
68
55
69
The following conditions are included in the watchdog checks:
If ($long_running_cf_agent_count -ge $long_running_cf_agent_count_threshold) {
8
+
$DATESTAMP=Get-Date -Format "yyyy-MM-dd HH:mm"
9
+
10
+
Write-Output "${DATESTAMP}: Count of long running cf-agent ($long_running_cf_agent_count) has met the threshold ($long_running_cf_agent_count_threshold) of long running agents, remediation triggered." | Tee-Object -FilePath "$LOGFILE" -Append
11
+
Write-Output "${DATESTAMP}: Before remediation" | Tee-Object -FilePath "$LOGFILE" -Append
0 commit comments