scan_host_logs
Reads recent ESXi host syslog entries and returns lines matching error, warning, or critical patterns, so you can find why a host is in trouble when vCenter events do not explain it.
Instructions
[READ] Scan recent ESXi host syslog lines for error/warning patterns.
Reads the last lines entries of selected logs (default hostd/vmkernel/vpxa) via the
diagnostic system and returns only the lines matching known trouble patterns
(error, fail, critical, panic, lost access, timeout, …). Severity follows the
level ESXi wrote on the line (Cr/Er/Wa/In…, raw token in log_level); a
critical keyword still wins. By default findings are grouped by pattern —
each item has count, hosts, first_seen/last_seen (log time), severity,
source (host_log:<key>), pattern and one sample; lines_matched is the
ungrouped count. group=false returns one row per line (severity, source,
message, time, observed_at, entity, log_level, log_time). time is the log
timestamp (null when absent); observed_at is when this scan read the line.
Returns the list envelope {items,
returned, limit, total, truncated, hint}. total is
null on purpose — this is "errors within the scanned window", not all errors
ever. logs_unavailable lists every host/log that could NOT be read, with
the reason (e.g. the account lacks Global.Diagnostics); empty items means
nothing matched only when logs_unavailable is empty too.
Use this when get_events or investigate_host show a host in trouble
but not why: vCenter events and ESXi syslog are different sources. Filter
with host_name to keep the scan fast on large clusters; a name that
matches no host returns an error (get the exact name from list_esxi_hosts),
not an empty result. Every call reads the last lines lines afresh.
Tool call template
This tool declares no required parameters. Add optional parameters from the input schema as needed.
{
"id": 1,
"jsonrpc": "2.0",
"method": "tools/call",
"params": {
"arguments": {},
"name": "scan_host_logs"
}
}Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| group | No | Group repeated lines by pattern (default true). One call on a lab returned 353 lines, 195 of them one statistics-provider message. | |
| lines | No | How many recent lines per log to scan (default 500, at least 1). | |
| target | No | vCenter/ESXi target from config (default if omitted). | |
| log_keys | No | 1–16 distinct diagnostic keys, e.g. ["hostd", "vobd"]. Omit for defaults. Availability depends on the target; unsupported keys appear in logs_unavailable. File paths are not accepted. | |
| host_name | No | Filter to a single host by exact name (None = all hosts). |