feat(host-events): the event log's shutdowns, crashes, hardware and disk errors (NetOrk/netork#2897)

WindowsHostEventsMixin.get_host_events(since=None) reads, in one script, three
bounded queries over the window: the System log's rare events (Kernel-Power 41,
EventLog 6008, WER-SystemErrorReporting 1001, WHEA-Logger 18, disk 7, Ntfs 55)
with their messages, its frequent ones (WHEA-Logger 19/47, disk 153, Service
Control Manager 7031/7034) and the Application log's crashes (Application Error
1000). Each query catches NoMatchingEventsFound; one that fails names its kinds
unread, one read up to its bound names them capped.
This commit is contained in:
Christian Manivong committed 2026-12-01 12:53:13 +01:00
1 parent 84f6a3c3e3
commit 21a21383ff
5 files changed
+686 -2

No files matched your search

+3 -1
View File
@@ -13,8 +13,9 @@ from __future__ import annotations
import argparse
import getpass
import pathlib
import time
from napalm_windows import WindowsDriver, scheduled_tasks, services, time_sync
from napalm_windows import WindowsDriver, host_events, scheduled_tasks, services, time_sync
from napalm_windows import windows as mod
SCRIPTS = {
@@ -27,6 +28,7 @@ SCRIPTS = {
"listening": mod._PS_LISTENING,
"scheduled_tasks": scheduled_tasks._PS_SCHEDULED_TASKS,
"time_sync": time_sync._PS_TIME_SYNC,
"host_events": host_events.host_events_script(time.time() - 7 * 86400),
}
OUT = pathlib.Path(__file__).parent / "harvest-out"