In addition to --pattern argument supported in logcounter binary, I'd like to have a --revert-pattern argument, which decrease the counter when matched.
The reason I need the this feature is to skip counting restarts initiated deliberately by system administrators (e.g. systemctl restart containerd). Otherwise, NPD would post a node condition that causes noise.
systemctl restart containerd results in two logs in journald "Stopping containerd container runtime..." and later "Starting containerd container runtime..." so the counter value should not be changed after matching both pattern and revert-pattern
systemctl restart containerd is rather safe to be considered deliberate operations that should be disregarded as availability issues. Health checks to restart containerd are done by executing systemctl kill --kill-who=main containerd, which doesn't result in journald log Stopping containerd container runtime...
In addition to
--pattern
argument supported in logcounter binary, I'd like to have a--revert-pattern
argument, which decrease the counter when matched.The reason I need the this feature is to skip counting restarts initiated deliberately by system administrators (e.g. systemctl restart containerd). Otherwise, NPD would post a node condition that causes noise.
Notes:
systemctl restart containerd
results in two logs in journald "Stopping containerd container runtime..." and later "Starting containerd container runtime..." so the counter value should not be changed after matching both pattern and revert-patternsystemctl restart containerd
is rather safe to be considered deliberate operations that should be disregarded as availability issues. Health checks to restart containerd are done by executingsystemctl kill --kill-who=main containerd
, which doesn't result in journald logStopping containerd container runtime...