From 397ff3dd96661a52bbf1aea646de700d35bc6481 Mon Sep 17 00:00:00 2001 From: TheWitness Date: Thu, 3 Dec 2026 11:52:31 -0500 Subject: [PATCH 1/2] feat(recommendations): add a curated Linux catalogue with recommended actions Add docs/linux-curated.json.gz: 70 hand-written pattern recommendations, each with an explanation and a recommended action, for the most important Linux kernel and service messages (memory and OOM, lockups, hung tasks and crashes, machine-check and EDAC errors, thermal events, block, SATA, SCSI and NVMe errors, ext4, XFS and Btrfs, software RAID, SMART, multipath, NFS, iSCSI, links, bonding, NICs, conntrack, SYN floods, time synchronisation, sshd, sudo, PAM, SELinux, AppArmor, audit, systemd unit failures and crashes, and journald and rsyslog message loss). The source is contrib/recommendations/linux-curated.json, written for this plugin under its GPL; each record carries sample messages that the unit tests replay through the plugin matcher, and references kernel, man page or project documentation. Among matching pattern recommendations, the details flyout now shows those with a recommended action first, so curated advice wins over the description-only Wazuh records whichever catalogue was imported first. Patterns are now stored exactly as written instead of having surrounding spaces trimmed, because whitespace is significant in a regular expression. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com> --- CHANGELOG.md | 2 + NOTICE | 3 + README.md | 27 +- contrib/recommendations/build_catalogues.py | 9 +- contrib/recommendations/linux-curated.json | 1439 +++++++++++++++++++ docs/RECOMMENDATION_SOURCES.md | 37 + docs/linux-curated.json.gz | Bin 0 -> 15832 bytes docs/linux-curated.json.gz.license | 2 + includes/recommendations.php | 25 +- locales/po/cacti.pot | 4 +- syslog_recommendations.php | 4 +- tests/Unit/RecommendationsTest.php | 59 +- 12 files changed, 1589 insertions(+), 22 deletions(-) create mode 100644 contrib/recommendations/linux-curated.json create mode 100644 docs/linux-curated.json.gz create mode 100644 docs/linux-curated.json.gz.license diff --git a/CHANGELOG.md b/CHANGELOG.md index 80894c99..e3a1733d 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -8,6 +8,8 @@ * docs: Add a NOTICE file and a SPDX `.license` file for every recommendation catalogue, and `copyright`, `license`, `license_url` and `source` fields in each catalogue's JSON. The vendor-derived catalogues are marked as separate works aggregated with the plugin and not licensed under the GPL; the NVIDIA catalogue's Cumulus Linux records are identified as CC BY-NC-SA 4.0 * change: The Cisco recommendation catalogue (docs/cisco.json.gz) is no longer loaded automatically on install or upgrade; every catalogue is now imported only on request. Records an earlier upgrade loaded are kept +* feature: Add a manually importable, hand-written Linux recommendation catalogue in docs/linux-curated.json.gz: 70 pattern recommendations with recommended actions for kernel memory, lockup, crash, hardware, storage, filesystem, RAID, network, time, authentication, security-module, systemd and logging messages, built from contrib/recommendations/linux-curated.json, whose sample messages the unit tests replay +* feature: Among matching pattern recommendations, the details flyout now shows those with a recommended action first, so curated advice wins over description-only records whichever catalogue was imported first; patterns are now stored exactly as written instead of having surrounding spaces trimmed * feature: Add a manually importable Linux pattern recommendation catalogue in docs/linux-wazuh.json.gz with 411 records converted from 315 rules of the Wazuh 4.14.11 ruleset (GPL-2.0), covering core Linux services, mail, network services and databases; contrib/recommendations/extract_wazuh_rules.py converts the rules and decoders, and build_catalogues.py now keeps the regex and program fields * docs: Add a Recommendation sources and licensing table to the README naming, for every bundled catalogue, its vendor, source, copyright holder and license, and how it was obtained * feature: Add pattern recommendations. A recommendation may carry a PCRE pattern (`regex`) and an optional syslog program (`program`, which may start or end with a `*` wildcard); it is then matched by the pattern instead of its identifier, after identifier matches, and applies to every sender except a Cacti device recognised as a different vendor. Patterns are validated on save and import (they must compile, be at most 1,024 characters and not match an empty message), run under a reduced PCRE backtracking limit, and are loaded once per request (at most 2,000, within PHP's compiled-pattern cache). Flagging a page of messages runs at most 200,000 pattern evaluations, and a failed pattern load reports that recommendations could not be loaded. The Recommendations page gains Pattern and Program fields, a Pattern column and a Match By filter; import and export carry the new fields only for records that use them. Upgrades add the `regex` and `program` columns to `syslog_recommendations` diff --git a/NOTICE b/NOTICE index 5b5d09e7..5d846034 100644 --- a/NOTICE +++ b/NOTICE @@ -24,6 +24,9 @@ Openly licensed catalogues, distributed under their own licenses: Trend Micro, Inc. (OSSEC). GPL-2.0-only, so the "or later" option of the plugin's license does not extend to this file. + docs/linux-curated.json.gz Written for this plugin (source: + contrib/recommendations/linux-curated.json). + Copyright The Cacti Group. GPL-2.0-or-later. Vendor-derived catalogues: diff --git a/README.md b/README.md index 31ef76c6..9a2f1b17 100644 --- a/README.md +++ b/README.md @@ -850,13 +850,16 @@ matched by that regular expression instead, and its identifier only names it that does not compile, contains control characters or line breaks, is longer than 1,024 characters, or matches an empty message (and therefore every message) is rejected, as is a program without a pattern. -* Pattern recommendations are tried after identifier recommendations, oldest - first. At most 2,000 of them are used, which keeps them within PHP's cache of - compiled patterns. A pattern that needs excessive backtracking on a message is - treated as not matching it. When a page of messages is flagged, pattern - checks stop after 200,000 pattern evaluations, so a very large page (such as - Show All) cannot stall the request; rows beyond that point show only - identifier matches, and opening a message still lists its pattern matches. +* Pattern recommendations are shown after identifier recommendations. Among + matching patterns, those with a recommended action come first, then the + oldest, so curated advice is preferred over description-only records + whichever catalogue was imported first. At most 2,000 of them are used, which + keeps them within PHP's cache of compiled patterns. A pattern that needs + excessive backtracking on a message is treated as not matching it. When a + page of messages is flagged, pattern checks stop after 200,000 pattern + evaluations, so a very large page (such as Show All) cannot stall the + request; rows beyond that point show only identifier matches, and opening a + message still lists its pattern matches. * A pattern recommendation with the same vendor, message and explanation as one already matched is skipped, so a recommendation split into several patterns (for example one per program) is listed once. @@ -916,6 +919,7 @@ lists the source documents, versions and retrieval dates of each file, and | `docs/mikrotik.json.gz` | MikroTik | 11 | RouterOS has no message IDs and MikroTik publishes no message catalogue; only documented messages that carry a distinctive word are included (for example `hashtype`, `auto-initialization`, `hw-limit`, `bpdu-guard`, `CTSYNC`, `deassigned`). | | `docs/linux.json.gz` | Linux | 102 | systemd's journal message catalog (systemd v262.2), keyed on the 32-digit hexadecimal journal `MESSAGE_ID`, such as `be02cf6855d2428ba40df7e9d022f03d` for a failed unit start. Covers units, PID 1, journald, logind, core dumps, the OOM killer, shutdown and time changes. Only matches when the forwarder appends the ID; see [Linux and systemd message IDs](#linux-and-systemd-message-ids). | | `docs/linux-wazuh.json.gz` | Linux | 411 | [Pattern recommendations](#pattern-recommendations) converted from the Wazuh 4.14.11 ruleset: core Linux (syslog, kernel, sshd, PAM, su, sudo, systemd, auditd, AppArmor, firewalld, Docker, USB), mail (Postfix, Sendmail, Exim, Dovecot, Courier and others), network services (BIND, Unbound, FTP servers, Samba, Apache, nginx, Squid, OpenVPN and others) and databases and applications (MySQL, MariaDB, PostgreSQL, MongoDB, Redis, ClamAV, Puppet, FreeIPA). Matched by message text and program, so no forwarder change is needed. Explanations are Wazuh's one-line rule descriptions with its classification; there are no recommended actions. | +| `docs/linux-curated.json.gz` | Linux | 70 | Hand-written pattern recommendations **with recommended actions** for the most important Linux kernel and service messages: out-of-memory kills, soft and hard lockups, hung tasks, RCU stalls, panics and oopses, machine-check and EDAC memory errors, thermal events, block, SATA, SCSI and NVMe errors, ext4, XFS and Btrfs errors, read-only remounts, full filesystems, software RAID, SMART, multipath, NFS and iSCSI, link, bonding, NIC and connection-tracking problems, time synchronisation, sshd, sudo, PAM, SELinux, AppArmor and audit events, systemd unit failures and crashes, and journald and rsyslog message loss. Import it together with `docs/linux-wazuh.json.gz`: recommendations with an action are shown first. | Numeric identifiers, such as HPE event IDs, Fortinet log IDs and FRRouting error codes, only match messages from a Cacti device whose vendor is recognised @@ -1015,9 +1019,11 @@ it applies to and where its records come from. **Copyright and license** names who owns the source material and the terms it is published under. **How it was obtained** summarises how the records were produced. -Two catalogues come from openly licensed sources: the systemd catalogue -(LGPL-2.1-or-later) and the Wazuh-derived catalogue (GPL-2.0 only, so the -plugin's "or later" option does not extend to that file). Those records keep +Three catalogues are openly licensed: the systemd catalogue +(LGPL-2.1-or-later), the Wazuh-derived catalogue (GPL-2.0 only, so the +plugin's "or later" option does not extend to that file), and the curated +Linux catalogue, which was written for this plugin and is covered by its own +GPL-2.0-or-later. Those records keep their source's license and copyright notices. All the others are condensed from vendors' public documentation, which remains the copyright of the vendor under the website terms linked below. They are **not covered by this plugin's GPL**: @@ -1051,6 +1057,7 @@ advice. Source documents, versions and retrieval dates are listed in | Juniper | `docs/juniper.json.gz` | Juniper System Log Explorer (EX Series `ESWD` messages) | © Juniper Networks, Inc.; proprietary documentation, [Juniper Legal Notices](https://www.juniper.net/us/en/legal-notices.html) | Hand-curated from 14 EX Series entries in Juniper's public System Log Explorer. | | Linux | `docs/linux.json.gz` | systemd journal message catalog (systemd v262.2) | systemd contributors; open source, [LGPL-2.1-or-later](https://github.com/systemd/systemd/blob/v262.2/catalog/systemd.catalog.in) | Converted from systemd's `catalog/systemd.catalog.in` with `contrib/recommendations/extract_systemd_catalog.py`. | | Linux | `docs/linux-wazuh.json.gz` | Wazuh ruleset 4.14.11 (rules and decoders, based on OSSEC) | © Wazuh Inc., portions © Trend Micro Inc.; open source, [GPL-2.0](https://github.com/wazuh/wazuh/blob/v4.14.11/LICENSE) | Converted from the Wazuh rule and decoder XML with `contrib/recommendations/extract_wazuh_rules.py`. | +| Linux | `docs/linux-curated.json.gz` | Written for this plugin; each record's `reference` links to the Linux kernel, man page or project documentation it relies on | © The Cacti Group; open source, [GPL-2.0-or-later](LICENSE), the plugin's own license | Written for this plugin from the linked documentation and kept, with sample messages that the unit tests check, in `contrib/recommendations/linux-curated.json`. | | MikroTik | `docs/mikrotik.json.gz` | RouterOS documentation pages on help.mikrotik.com | MikroTik; no license or terms are stated for the documentation | Hand-picked from messages documented on public RouterOS help pages. | | Nokia | `docs/nokia.json.gz` | SR OS 25.10 Log Events Guide | © Nokia; proprietary documentation, [Nokia Terms of Use](https://www.nokia.com/notices/terms/) | Extracted from the public SR OS Log Events Guide HTML pages. | | NVIDIA | `docs/nvidia.json.gz` | Cumulus Linux 5.18 switchd and FRRouting Log Message References, Xid errors, Fabric Manager SXid errors | © NVIDIA Corporation & affiliates. The Cumulus Linux switchd and FRRouting records come from NVIDIA networking documentation licensed [CC BY-NC-SA 4.0](https://docs.nvidia.com/networking-ethernet-software/license/) (non-commercial sharing with attribution, under the same license; not GPL-compatible). The Xid and SXid records come from documentation under the [NVIDIA Terms of Service](https://www.nvidia.com/en-us/about-nvidia/terms-of-service/). The FRRouting `[EC nnnnnnnn]` code numbers are defined by the GPL-2.0-or-later FRRouting software. | Extracted from NVIDIA's public Cumulus Linux, Xid and Fabric Manager documentation. | diff --git a/contrib/recommendations/build_catalogues.py b/contrib/recommendations/build_catalogues.py index 86545fba..96d1c980 100755 --- a/contrib/recommendations/build_catalogues.py +++ b/contrib/recommendations/build_catalogues.py @@ -22,11 +22,12 @@ the plugin's docs/ directory. Usage: build_catalogues.py VENDOR < extracted/.json - VENDOR is one of: arista cisco dell fortinet hpe huawei juniper linux linux-wazuh mikrotik nokia nvidia - paloalto + VENDOR is one of: arista cisco dell fortinet hpe huawei juniper linux linux-curated linux-wazuh mikrotik + nokia nvidia paloalto For linux, the extracted JSON comes from extract_systemd_catalog.py; for -linux-wazuh, from extract_wazuh_rules.py. cisco and juniper have no extractor; +linux-wazuh, from extract_wazuh_rules.py. linux-curated is built from the +hand-written contrib/recommendations/linux-curated.json. cisco and juniper have no extractor; refresh their licensing metadata without touching their records with build_catalogues.py --metadata-only cisco (it reads docs/cisco.json.gz itself). @@ -64,6 +65,8 @@ 'linux': ('systemd contributors', 'LGPL-2.1-or-later', 'https://github.com/systemd/systemd/blob/v262.2/LICENSE.LGPL2.1', 'https://github.com/systemd/systemd/blob/v262.2/catalog/systemd.catalog.in'), + 'linux-curated': ('The Cacti Group', 'GPL-2.0-or-later', 'https://github.com/Cacti/plugin_syslog/blob/develop/LICENSE', + 'Written for the Cacti syslog plugin: contrib/recommendations/linux-curated.json'), 'linux-wazuh': ('Wazuh, Inc.; Trend Micro, Inc. (OSSEC)', 'GPL-2.0-only', 'https://github.com/wazuh/wazuh/blob/v4.14.11/LICENSE', 'https://github.com/wazuh/wazuh/tree/v4.14.11/ruleset'), diff --git a/contrib/recommendations/linux-curated.json b/contrib/recommendations/linux-curated.json new file mode 100644 index 00000000..785bcfac --- /dev/null +++ b/contrib/recommendations/linux-curated.json @@ -0,0 +1,1439 @@ +{ + "format": "syslog-recommendations", + "version": 1, + "_comment": "Source of docs/linux-curated.json.gz, written for the Cacti syslog plugin (GPL-2.0-or-later). Each record lists sample messages under \"samples\"; the unit tests check that every sample finds its record. Build with: build_catalogues.py linux-curated < contrib/recommendations/linux-curated.json", + "recommendations": [ + { + "vendor": "Linux", + "identifier": "linux-oom-kill", + "component": "memory", + "severity": 3, + "message": "Out of memory: Killed process () ...", + "explanation": "The kernel could not satisfy a memory allocation in the allowed memory domain (the whole system, or a cpuset or NUMA policy) and its OOM killer terminated the named process to recover. The killed process is chosen by its memory use and oom_score_adj, so it is often the largest consumer rather than the cause.", + "recommended_action": "Read the full OOM report with journalctl -k or dmesg: the oom-kill:constraint= line shows whether the whole system or a cpuset/NUMA policy ran out, and the task list shows memory per process. Check whether the workload outgrew the host or a process is leaking memory, and compare with your memory graphs. Add memory or swap, reduce the workload, or cap the offending service with MemoryMax= in its systemd unit. Protect critical daemons with OOMScoreAdjust= instead of disabling the OOM killer.", + "reference": "https://docs.kernel.org/admin-guide/sysctl/vm.html", + "regex": "^(?:\\[\\s*[0-9.]+\\]\\s*)?Out of memory(?: \\([^)]*\\))?: Kill(?:ed)? process", + "program": "kernel", + "samples": [ + { + "program": "kernel", + "message": "Out of memory: Killed process 4242 (java) total-vm:8123456kB, anon-rss:7900000kB, file-rss:0kB, shmem-rss:0kB, UID:1000 pgtables:16000kB oom_score_adj:0" + }, + { + "program": "kernel", + "message": "[123456.789012] Out of memory: Kill process 2321 (mysqld) score 812 or sacrifice child" + }, + { + "program": "kernel", + "message": "Out of memory (oom_kill_allocating_task): Killed process 777 (stress) total-vm:4096kB" + } + ] + }, + { + "vendor": "Linux", + "identifier": "linux-cgroup-oom", + "component": "memory", + "severity": 4, + "message": "Memory cgroup out of memory: Killed process () ...", + "explanation": "A process was killed because its control group (a systemd service, container or pod) reached its own memory limit. The host itself may still have free memory.", + "recommended_action": "Identify the unit or container that owns the process (systemctl status , or the container runtime). Raise the limit (MemoryMax= for systemd units, the memory limit of the container) if the workload legitimately needs more, otherwise fix the leak or reduce the working set. Repeated kills of the same service usually mean the limit is too low.", + "reference": "https://docs.kernel.org/admin-guide/cgroup-v2.html", + "regex": "Memory cgroup out of memory: Kill(?:ed)? process", + "program": "kernel", + "samples": [ + { + "program": "kernel", + "message": "Memory cgroup out of memory: Killed process 31337 (node) total-vm:2201004kB, anon-rss:1048576kB, file-rss:3000kB, shmem-rss:0kB, UID:999 pgtables:2600kB oom_score_adj:0" + } + ] + }, + { + "vendor": "Linux", + "identifier": "linux-oom-no-killable", + "component": "memory", + "severity": 2, + "message": "Out of memory and no killable processes...", + "explanation": "The OOM killer found no process it is allowed to kill. For a system-wide out-of-memory condition the kernel normally panics next, so the host may reboot or hang; it does not panic for a memory cgroup limit or a SysRq-triggered OOM.", + "recommended_action": "Check whether a panic or reboot followed (uptime, journalctl --list-boots, the console or BMC log) before treating it as a crash, and review the memory usage that led to it. Look for processes protected with oom_score_adj=-1000 or OOMScoreAdjust=-1000 that grew too large, and for kernel memory leaks (slab usage in /proc/meminfo). Add memory or reduce the workload.", + "reference": "https://docs.kernel.org/admin-guide/sysctl/vm.html", + "regex": "Out of memory and no killable processes", + "program": "kernel", + "samples": [ + { + "program": "kernel", + "message": "Out of memory and no killable processes..." + } + ] + }, + { + "vendor": "Linux", + "identifier": "linux-page-allocation-failure", + "component": "memory", + "severity": 4, + "message": ": page allocation failure: order:, mode:", + "explanation": "The kernel could not find a free block of contiguous memory of the requested order (2^order pages). This usually means memory is fragmented rather than exhausted, and often comes from network or storage drivers allocating large buffers.", + "recommended_action": "Check free memory and fragmentation (/proc/buddyinfo). Raising vm.min_free_kbytes gives the kernel more headroom for atomic allocations; a one-off message can be ignored, but repeated failures that coincide with packet drops or I/O errors should be investigated with the driver vendor. Updating the kernel and driver often helps.", + "reference": "https://docs.kernel.org/admin-guide/sysctl/vm.html", + "regex": "page allocation failure: order:\\d+", + "program": "kernel", + "samples": [ + { + "program": "kernel", + "message": "kworker/u16:2: page allocation failure: order:4, mode:0x40cc0(GFP_KERNEL|__GFP_COMP), nodemask=(null),cpuset=/,mems_allowed=0" + } + ] + }, + { + "vendor": "Linux", + "identifier": "linux-soft-lockup", + "component": "cpu", + "severity": 3, + "message": "watchdog: BUG: soft lockup - CPU# stuck for s! [:]", + "explanation": "A CPU ran kernel code for longer than the watchdog threshold (about 20 seconds by default) without scheduling other tasks. Common causes are driver bugs, heavy lock contention, or, on virtual machines, a hypervisor that did not run the vCPU (CPU steal or an overcommitted host).", + "recommended_action": "On a virtual machine, check the hypervisor for CPU overcommit, steal time or a paused or migrating VM first. On bare metal, read the stack trace that follows the message (journalctl -k) to find the driver or subsystem involved, update the kernel and firmware, and report repeated traces to your distribution. If the host becomes unresponsive, consider kernel.softlockup_panic with kdump to capture a crash dump.", + "reference": "https://docs.kernel.org/admin-guide/lockup-watchdogs.html", + "regex": "BUG: soft lockup - CPU#\\d+ stuck for \\d+s", + "program": "kernel", + "samples": [ + { + "program": "kernel", + "message": "watchdog: BUG: soft lockup - CPU#3 stuck for 22s! [kworker/3:1:12345]" + } + ] + }, + { + "vendor": "Linux", + "identifier": "linux-hard-lockup", + "component": "cpu", + "severity": 2, + "message": "Watchdog detected hard LOCKUP on cpu ", + "explanation": "A CPU stopped responding to interrupts for more than about 10 seconds. This is more serious than a soft lockup and usually points to a hardware, firmware or low-level driver problem.", + "recommended_action": "Capture the stack trace that follows (journalctl -k, or the serial console). Update BIOS/firmware and the kernel, check the hardware event log (IPMI SEL or the BMC) for CPU or memory errors, and run hardware diagnostics. Configure kdump so a hang can be analysed.", + "reference": "https://docs.kernel.org/admin-guide/lockup-watchdogs.html", + "regex": "(?i)Watchdog detected hard LOCKUP on cpu", + "program": "kernel", + "samples": [ + { + "program": "kernel", + "message": "Watchdog detected hard LOCKUP on cpu 2" + } + ] + }, + { + "vendor": "Linux", + "identifier": "linux-hung-task", + "component": "cpu", + "severity": 4, + "message": "INFO: task : blocked for more than seconds.", + "explanation": "A task has been waiting in uninterruptible sleep (state D) for longer than kernel.hung_task_timeout_secs, usually 120 seconds. It is almost always waiting for I/O: a slow or failed disk, a stuck SAN or multipath path, or an unreachable NFS server.", + "recommended_action": "Look for storage errors around the same time (I/O errors, SCSI or NVMe timeouts, multipath failures, NFS not responding). Check disk latency with iostat -x and the health of the underlying storage. The stack trace printed after the message shows which subsystem the task is waiting in.", + "reference": "https://docs.kernel.org/admin-guide/sysctl/kernel.html", + "regex": "INFO: task .+:\\d+ blocked for more than \\d+ seconds", + "program": "kernel", + "samples": [ + { + "program": "kernel", + "message": "INFO: task jbd2/dm-0-8:512 blocked for more than 120 seconds." + }, + { + "program": "kernel", + "message": "INFO: task kworker/u8:1:3121 blocked for more than 241 seconds." + }, + { + "program": "kernel", + "message": "INFO: task Web Content:1234 blocked for more than 122 seconds." + } + ] + }, + { + "vendor": "Linux", + "identifier": "linux-rcu-stall", + "component": "cpu", + "severity": 3, + "message": "rcu: INFO: rcu_sched detected stalls on CPUs/tasks: ...", + "explanation": "The RCU subsystem detected that a CPU did not pass through a quiescent state for a long time (21 seconds by default). Causes are similar to soft lockups: a CPU looping in the kernel, interrupt storms, or a virtual machine that was not scheduled.", + "recommended_action": "Check the hypervisor for CPU overcommit or a paused VM. Read the stack traces that follow to identify the code involved, update the kernel and drivers, and correlate with other lockup or hardware messages.", + "reference": "https://docs.kernel.org/RCU/stallwarn.html", + "regex": "rcu_\\w+ (?:self-)?detected stalls? on CPU", + "program": "kernel", + "samples": [ + { + "program": "kernel", + "message": "rcu: INFO: rcu_sched detected stalls on CPUs/tasks:" + }, + { + "program": "kernel", + "message": "INFO: rcu_preempt self-detected stall on CPU" + } + ] + }, + { + "vendor": "Linux", + "identifier": "linux-kernel-panic", + "component": "cpu", + "severity": 0, + "message": "Kernel panic - not syncing: ", + "explanation": "The kernel hit an unrecoverable error and stopped. The text after \"not syncing\" gives the reason. The host will reboot only if kernel.panic is set; otherwise it stays down.", + "recommended_action": "Confirm the host is back and collect the full panic text (netconsole, serial console or the BMC). Configure kdump to capture a crash dump for analysis. Common causes are hardware faults, out of memory with nothing to kill, a missing root filesystem after a kernel update, and driver bugs.", + "reference": "https://docs.kernel.org/admin-guide/bug-hunting.html", + "regex": "Kernel panic - not syncing", + "program": "kernel", + "samples": [ + { + "program": "kernel", + "message": "Kernel panic - not syncing: Fatal exception in interrupt" + } + ] + }, + { + "vendor": "Linux", + "identifier": "linux-kernel-oops", + "component": "cpu", + "severity": 2, + "message": "BUG: unable to handle page fault for address ... / general protection fault / kernel BUG at ...", + "explanation": "The kernel detected an invalid memory access or an internal consistency check failed (an oops). The faulting task is killed, but the kernel may be left in an unstable state.", + "recommended_action": "Save the full oops text including the call trace (journalctl -k -b -1 after a reboot). Note the module named in the trace, update the kernel and that driver, and check memory with a hardware diagnostic if oopses appear in unrelated places. Plan a reboot, because the kernel may be inconsistent after an oops.", + "reference": "https://docs.kernel.org/admin-guide/bug-hunting.html", + "regex": "BUG: (?:unable to handle (?:kernel )?(?:paging request|page fault|NULL pointer dereference)|kernel NULL pointer dereference)|general protection fault|kernel BUG at \\S+:\\d+", + "program": "kernel", + "samples": [ + { + "program": "kernel", + "message": "BUG: unable to handle page fault for address: ffffffffc0a1b000" + }, + { + "program": "kernel", + "message": "BUG: kernel NULL pointer dereference, address: 0000000000000008" + }, + { + "program": "kernel", + "message": "general protection fault, probably for non-canonical address 0xdead000000000100: 0000 [#1] SMP NOPTI" + }, + { + "program": "kernel", + "message": "kernel BUG at mm/slub.c:4042!" + } + ] + }, + { + "vendor": "Linux", + "identifier": "linux-segfault", + "component": "process", + "severity": 4, + "message": "[]: segfault at
ip
sp
error in ", + "explanation": "A user-space program accessed memory it is not allowed to and was killed with SIGSEGV. The message names the program and, after \"in\", the binary or library where it crashed.", + "recommended_action": "Identify the program and whether it was restarted (systemctl status, coredumpctl list). Collect a core dump with systemd-coredump or ulimit -c, and update the program and the library named in the message. Crashes in many unrelated programs suggest faulty memory.", + "reference": "https://man7.org/linux/man-pages/man5/core.5.html", + "regex": "\\[\\d+\\]: segfault at [0-9a-f]+ ip [0-9a-f]+", + "program": "kernel", + "samples": [ + { + "program": "kernel", + "message": "php-fpm[23456]: segfault at 0 ip 000055d1c8e4b2a0 sp 00007ffd2b6f1e70 error 4 in php-fpm[55d1c8c00000+3a0000]" + } + ] + }, + { + "vendor": "Linux", + "identifier": "linux-cpu-throttled", + "component": "hardware", + "severity": 4, + "message": "CPU: Core temperature above threshold, cpu clock throttled (total events = )", + "explanation": "The CPU reached its thermal limit and lowered its clock speed to cool down, which reduces performance.", + "recommended_action": "Check fans, airflow, dust and data-centre inlet temperature, and the BMC sensor readings (ipmitool sdr). Verify the heat sink is seated correctly. Occasional events under full load are normal on some laptops and desktops, but servers should not throttle.", + "reference": "https://docs.kernel.org/admin-guide/thermal/index.html", + "regex": "(?:Core|Package) temperature above threshold, cpu clock throttled", + "program": "kernel", + "samples": [ + { + "program": "kernel", + "message": "CPU3: Core temperature above threshold, cpu clock throttled (total events = 1)" + }, + { + "program": "kernel", + "message": "CPU0: Package temperature above threshold, cpu clock throttled (total events = 57)" + } + ] + }, + { + "vendor": "Linux", + "identifier": "linux-critical-temperature", + "component": "hardware", + "severity": 1, + "message": "thermal thermal_zone: critical temperature reached ( C), shutting down", + "explanation": "A thermal zone reached its critical trip point and the kernel is shutting the system down to protect the hardware.", + "recommended_action": "Do not just power the host back on: find the cause first (failed fan, blocked airflow, cooling failure in the room). Check the BMC sensor and event logs, and the room or rack temperature monitoring.", + "reference": "https://docs.kernel.org/driver-api/thermal/sysfs-api.html", + "regex": "critical temperature reached", + "program": "kernel", + "samples": [ + { + "program": "kernel", + "message": "thermal thermal_zone0: critical temperature reached (105 C), shutting down" + } + ] + }, + { + "vendor": "Linux", + "identifier": "linux-machine-check", + "component": "hardware", + "severity": 2, + "message": "mce: [Hardware Error]: ...", + "explanation": "The CPU reported a machine check: a hardware error in the processor, its caches, the memory controller or the system bus. Corrected errors are logged for information; uncorrected ones can crash processes or the whole system.", + "recommended_action": "Decode the event with rasdaemon (ras-mc-ctl --errors) or mcelog. Check the BMC event log for the failing component, update BIOS and microcode, and replace the CPU or memory module the errors point to if they repeat.", + "reference": "https://docs.kernel.org/arch/x86/x86_64/machinecheck.html", + "regex": "mce: \\[Hardware Error\\]|\\[Hardware Error\\]: (?:CPU \\d+: )?Machine Check", + "program": "kernel", + "samples": [ + { + "program": "kernel", + "message": "mce: [Hardware Error]: Machine check events logged" + }, + { + "program": "kernel", + "message": "mce: [Hardware Error]: CPU 1: Machine Check: 0 Bank 5: be00000000800400" + } + ] + }, + { + "vendor": "Linux", + "identifier": "linux-edac-corrected", + "component": "hardware", + "severity": 4, + "message": "EDAC MC: CE on ", + "explanation": "The memory controller corrected a memory error (CE) with ECC. The data was not damaged, but a growing number of corrected errors on the same DIMM predicts an uncorrectable failure.", + "recommended_action": "Note the DIMM location in the message and track the count with ras-mc-ctl --summary or edac-util. If corrected errors keep increasing on the same module, schedule its replacement. Make sure the system firmware and BMC show the same module.", + "reference": "https://docs.kernel.org/driver-api/edac.html", + "regex": "EDAC MC\\d+: \\d+ CE\\b", + "program": "kernel", + "samples": [ + { + "program": "kernel", + "message": "EDAC MC0: 1 CE memory read error on CPU_SrcID#0_Ha#0_Chan#1_DIMM#0 (channel:1 slot:0 page:0x123456 offset:0x0 grain:32 syndrome:0x0)" + } + ] + }, + { + "vendor": "Linux", + "identifier": "linux-edac-uncorrected", + "component": "hardware", + "severity": 1, + "message": "EDAC MC: UE on ", + "explanation": "The memory controller found a memory error that ECC could not correct (UE). Data in memory was damaged; the kernel may have killed processes or panicked.", + "recommended_action": "Replace the DIMM named in the message as soon as possible and check the BMC event log. Verify the integrity of data written around that time and restart the affected services.", + "reference": "https://docs.kernel.org/driver-api/edac.html", + "regex": "EDAC MC\\d+: \\d+ UE\\b", + "program": "kernel", + "samples": [ + { + "program": "kernel", + "message": "EDAC MC1: 1 UE memory read error on CPU_SrcID#1_Ha#0_Chan#2_DIMM#1 (channel:2 slot:1 page:0x9abcde offset:0x0 grain:32)" + } + ] + }, + { + "vendor": "Linux", + "identifier": "linux-block-io-error", + "component": "storage", + "severity": 3, + "message": "I/O error, dev , sector ...", + "explanation": "A read or write to a block device failed after the driver gave up retrying. The device may be failing, disconnected, or a SAN path may have dropped.", + "recommended_action": "Check the device health (smartctl -a /dev/ or nvme smart-log), cabling and controller, and look for SCSI, ATA, NVMe or multipath messages just before this one. If the device is part of RAID or LVM mirroring, check that the array is still redundant. Back up data from a disk that keeps reporting I/O errors and replace it.", + "reference": "https://docs.kernel.org/admin-guide/blockdev/index.html", + "regex": "I/O error, dev \\S+, sector \\d+", + "program": "kernel", + "samples": [ + { + "program": "kernel", + "message": "blk_update_request: I/O error, dev sda, sector 12345678 op 0x0:(READ) flags 0x0 phys_seg 1 prio class 0" + }, + { + "program": "kernel", + "message": "I/O error, dev nvme0n1, sector 1953521664 op 0x1:(WRITE) flags 0x8800 phys_seg 1 prio class 2" + } + ] + }, + { + "vendor": "Linux", + "identifier": "linux-buffer-io-error", + "component": "storage", + "severity": 3, + "message": "Buffer I/O error on dev , logical block , ...", + "explanation": "A filesystem or block layer read or write through the page cache failed. It follows a lower-level I/O error on the same device.", + "recommended_action": "Treat it like the underlying I/O error: check the device with smartctl, the cabling or SAN path, and the kernel messages just before. Run a filesystem check once the device is healthy.", + "reference": "https://docs.kernel.org/admin-guide/blockdev/index.html", + "regex": "Buffer I/O error on dev(?:ice)? \\S+", + "program": "kernel", + "samples": [ + { + "program": "kernel", + "message": "Buffer I/O error on dev sdb1, logical block 0, async page read" + } + ] + }, + { + "vendor": "Linux", + "identifier": "linux-ata-exception", + "component": "storage", + "severity": 4, + "message": "ata.: exception Emask SAct SErr action ", + "explanation": "A SATA device or link reported an error and the libata driver is recovering, often by resetting the link. Single events can come from cable or power glitches; repeated ones point to a failing disk, cable or port.", + "recommended_action": "Check the disk with smartctl -a (look at CRC errors, reallocated and pending sectors), reseat or replace the SATA cable, and try another port. Look at the lines that follow for the failed command and whether the link came back.", + "reference": "https://docs.kernel.org/admin-guide/blockdev/index.html", + "regex": "ata\\d+(?:\\.\\d+)?: exception Emask", + "program": "kernel", + "samples": [ + { + "program": "kernel", + "message": "ata1.00: exception Emask 0x0 SAct 0x0 SErr 0x0 action 0x6 frozen" + }, + { + "program": "kernel", + "message": "ata3: exception Emask 0x10 SAct 0x0 SErr 0x4050000 action 0xe frozen" + } + ] + }, + { + "vendor": "Linux", + "identifier": "linux-scsi-medium-error", + "component": "storage", + "severity": 3, + "message": "sd : [sdX] Sense Key : Medium Error [current]", + "explanation": "The disk reported that it could not read data from its media: an unreadable sector. The disk is starting to fail.", + "recommended_action": "Run smartctl -a on the disk and check the reallocated and pending sector counts. Make sure RAID redundancy is intact, back up the data and replace the disk. A RAID scrub or rebuild may rewrite the bad sector, but repeated medium errors mean the disk should be replaced.", + "reference": "https://manpages.debian.org/stable/smartmontools/smartd.8.en.html", + "regex": "Sense Key : Medium Error", + "program": "kernel", + "samples": [ + { + "program": "kernel", + "message": "sd 0:0:0:0: [sda] tag#7 Sense Key : Medium Error [current]" + } + ] + }, + { + "vendor": "Linux", + "identifier": "linux-nvme-timeout", + "component": "storage", + "severity": 3, + "message": "nvme nvme: I/O QID timeout, aborting", + "explanation": "An NVMe command did not complete in time and the driver is aborting it, possibly followed by a controller reset. Causes include drive firmware bugs, power-state transitions, PCIe link problems and failing drives.", + "recommended_action": "Check nvme smart-log /dev/nvme for media errors and critical warnings, update the drive firmware and the kernel, and look for PCIe AER errors. If the timeouts follow idle periods, try disabling deep power states (nvme_core.default_ps_max_latency_us=0).", + "reference": "https://manpages.debian.org/stable/nvme-cli/nvme-smart-log.1.en.html", + "regex": "nvme nvme\\d+: I/O (?:tag )?\\d+\\b.*\\bQID \\d+ timeout\\b", + "program": "kernel", + "samples": [ + { + "program": "kernel", + "message": "nvme nvme0: I/O 123 QID 4 timeout, aborting" + }, + { + "program": "kernel", + "message": "nvme nvme0: I/O tag 123 (007b) opcode 0x2 (I/O Cmd) QID 4 timeout, aborting" + } + ] + }, + { + "vendor": "Linux", + "identifier": "linux-nvme-controller-down", + "component": "storage", + "severity": 2, + "message": "nvme nvme: controller is down; will reset", + "explanation": "The NVMe controller stopped responding. The driver will try to reset it; if that fails the device is removed and all I/O to it fails.", + "recommended_action": "Check whether the device is still present (nvme list), its SMART log and the PCIe AER messages. Update drive firmware and the kernel, reseat the drive, and replace it if it drops out again.", + "reference": "https://manpages.debian.org/stable/nvme-cli/nvme-smart-log.1.en.html", + "regex": "nvme nvme\\d+: (?:controller is down|Device not ready|Removing after probe failure)", + "program": "kernel", + "samples": [ + { + "program": "kernel", + "message": "nvme nvme0: controller is down; will reset: CSTS=0xffffffff, PCI_STATUS=0xffff" + }, + { + "program": "kernel", + "message": "nvme nvme1: Removing after probe failure status: -19" + } + ] + }, + { + "vendor": "Linux", + "identifier": "linux-ext4-error", + "component": "filesystem", + "severity": 3, + "message": "EXT4-fs error (device ): :: ...", + "explanation": "ext4 found an inconsistency in its on-disk structures. Depending on the errors= mount option it continues, remounts read-only or panics.", + "recommended_action": "Check for I/O errors on the same device first. Schedule a filesystem check (unmount and run e2fsck -f, or fsck at the next boot for the root filesystem) and make sure backups are current. Repeated errors on a healthy disk can point to memory or controller problems.", + "reference": "https://docs.kernel.org/admin-guide/ext4.html", + "regex": "EXT4-fs error \\(device \\S+\\)", + "program": "kernel", + "samples": [ + { + "program": "kernel", + "message": "EXT4-fs error (device sda1): ext4_lookup:1700: inode #2: comm ls: deleted inode referenced: 131073" + } + ] + }, + { + "vendor": "Linux", + "identifier": "linux-fs-read-only", + "component": "filesystem", + "severity": 2, + "message": "EXT4-fs (): Remounting filesystem read-only", + "explanation": "The filesystem was switched to read-only after an error, to prevent further damage. Applications writing to it will now fail.", + "recommended_action": "Find the error that caused it (filesystem or I/O errors just before). Check the device health, then unmount and repair the filesystem with e2fsck (or fsck for other filesystems) before remounting read-write. A reboot alone will not fix the underlying problem.", + "reference": "https://man7.org/linux/man-pages/man8/e2fsck.8.html", + "regex": "(?i)Remounting filesystem read-only", + "program": "kernel", + "samples": [ + { + "program": "kernel", + "message": "EXT4-fs (dm-0): Remounting filesystem read-only" + } + ] + }, + { + "vendor": "Linux", + "identifier": "linux-xfs-corruption", + "component": "filesystem", + "severity": 2, + "message": "XFS (): Corruption detected. Unmount and run xfs_repair", + "explanation": "XFS found corrupted metadata. It may shut the filesystem down to prevent further damage.", + "recommended_action": "Check for I/O errors on the device first. Unmount the filesystem and run xfs_repair (run xfs_repair -n first to see what it would change). If the log must be replayed and the filesystem cannot be mounted, xfs_repair -L discards the log as a last resort; restore from backup if repair loses data.", + "reference": "https://man7.org/linux/man-pages/man8/xfs_repair.8.html", + "regex": "XFS \\(\\S+\\): (?:Metadata )?[Cc]orruption detected", + "program": "kernel", + "samples": [ + { + "program": "kernel", + "message": "XFS (dm-0): Corruption detected. Unmount and run xfs_repair" + }, + { + "program": "kernel", + "message": "XFS (sdb1): Metadata corruption detected at xfs_da3_node_read_verify+0x10a/0x120 [xfs], xfs_da3_node block 0x78" + } + ] + }, + { + "vendor": "Linux", + "identifier": "linux-xfs-shutdown", + "component": "filesystem", + "severity": 2, + "message": "XFS (): Filesystem has been shut down due to log error", + "explanation": "XFS shut the filesystem down after an I/O or corruption error. All access returns errors until it is unmounted and remounted.", + "recommended_action": "Find the I/O or corruption error that preceded the shutdown and fix the storage first. Then unmount, run xfs_repair if needed, and remount. Applications using the filesystem will need restarting.", + "reference": "https://docs.kernel.org/admin-guide/xfs.html", + "regex": "XFS \\(\\S+\\): (?:Filesystem has been shut down|[Ll]og I/O [Ee]rror|.*Shutting down filesystem)", + "program": "kernel", + "samples": [ + { + "program": "kernel", + "message": "XFS (sdb1): Filesystem has been shut down due to log error (0x2)." + }, + { + "program": "kernel", + "message": "XFS (dm-2): log I/O error -5" + }, + { + "program": "kernel", + "message": "XFS (sdb1): Metadata I/O Error (0x1) detected at xfs_trans_read_buf_map+0x2a0/0x2f0 [xfs] (fs/xfs/xfs_trans_buf.c:296). Shutting down filesystem." + } + ] + }, + { + "vendor": "Linux", + "identifier": "linux-btrfs-error", + "component": "filesystem", + "severity": 3, + "message": "BTRFS error (device ): ...", + "explanation": "Btrfs reported an error, such as a checksum failure, an I/O error or a corrupted tree block. The device error counters are shown as wr, rd, flush, corrupt and gen.", + "recommended_action": "Run btrfs device stats on the filesystem to see which device and counter is growing, and check that device with smartctl. With a redundant profile (RAID1/10), run btrfs scrub to repair from the good copy. Replace failing devices with btrfs replace.", + "reference": "https://btrfs.readthedocs.io/en/latest/btrfs-device.html", + "regex": "BTRFS (?:error|critical) \\(device \\S+", + "program": "kernel", + "samples": [ + { + "program": "kernel", + "message": "BTRFS error (device sda2): bdev /dev/sda2 errs: wr 0, rd 1, flush 0, corrupt 0, gen 0" + }, + { + "program": "kernel", + "message": "BTRFS critical (device dm-0): corrupt leaf: root=2 block=30408704 slot=6" + } + ] + }, + { + "vendor": "Linux", + "identifier": "linux-no-space", + "component": "filesystem", + "severity": 3, + "message": "... No space left on device", + "explanation": "A write failed because a filesystem is full, or has run out of inodes.", + "recommended_action": "Find the full filesystem with df -h and df -i. Free space by removing old logs, packages caches, core dumps or snapshots, and find large directories with du -xh --max-depth=1. Add capacity or set up log rotation and alerts on filesystem usage before it fills again.", + "reference": "https://man7.org/linux/man-pages/man1/df.1.html", + "regex": "No space left on device", + "program": "", + "samples": [ + { + "program": "postgres", + "message": "could not write to file \"pg_wal/xlogtemp.1234\": No space left on device" + }, + { + "program": "rsyslogd", + "message": "file '/var/log/messages': write error - see https://www.rsyslog.com/solving-rsyslog-write-errors/ for help OS error: No space left on device" + } + ] + }, + { + "vendor": "Linux", + "identifier": "linux-md-disk-failure", + "component": "raid", + "severity": 2, + "message": "md/raid:md: Disk failure on , disabling device.", + "explanation": "Linux software RAID removed a member disk after it failed. The array is now degraded and has less (or no) redundancy.", + "recommended_action": "Check the array with cat /proc/mdstat and mdadm --detail /dev/md. Check the failed disk with smartctl and replace it: mdadm --remove the old member, then mdadm --add the new one and watch the rebuild. Do not reboot or remove other disks until the rebuild completes.", + "reference": "https://docs.kernel.org/admin-guide/md.html", + "regex": "md/raid(?:\\d+)?:[^:\\s]+: Disk failure on \\S+, disabling device", + "program": "kernel", + "samples": [ + { + "program": "kernel", + "message": "md/raid1:md0: Disk failure on sdb1, disabling device." + }, + { + "program": "kernel", + "message": "md/raid:md1: Disk failure on sdc1, disabling device." + } + ] + }, + { + "vendor": "Linux", + "identifier": "linux-mdadm-event", + "component": "raid", + "severity": 2, + "message": " event detected on md device /dev/md", + "explanation": "mdadm --monitor reported that a software RAID array is degraded, a member failed, or an array disappeared.", + "recommended_action": "Run mdadm --detail /dev/md and cat /proc/mdstat to see which member is missing or faulty. Replace the failed disk and add the new one with mdadm --add. Configure MAILADDR in mdadm.conf so failures are also emailed.", + "reference": "https://man7.org/linux/man-pages/man8/mdadm.8.html", + "regex": "(?:DegradedArray|Fail|FailSpare|DeviceDisappeared) event detected on md device", + "program": "mdadm", + "samples": [ + { + "program": "mdadm", + "message": "DegradedArray event detected on md device /dev/md0" + }, + { + "program": "mdadm", + "message": "Fail event detected on md device /dev/md1, component device /dev/sdb2" + } + ] + }, + { + "vendor": "Linux", + "identifier": "linux-smart-pending-sectors", + "component": "storage", + "severity": 4, + "message": "Device: /dev/ [SAT], Currently unreadable (pending) sectors", + "explanation": "smartd reports sectors the disk could not read (pending) or that failed offline testing. These sectors may hold lost data and the disk is degrading.", + "recommended_action": "Run smartctl -a /dev/ and a long self-test (smartctl -t long). Make sure RAID redundancy and backups are in place. A growing count means the disk should be replaced.", + "reference": "https://manpages.debian.org/stable/smartmontools/smartd.8.en.html", + "regex": "(?:Currently unreadable \\(pending\\) sectors|Offline uncorrectable sectors)", + "program": "smartd", + "samples": [ + { + "program": "smartd", + "message": "Device: /dev/sda [SAT], 8 Currently unreadable (pending) sectors" + }, + { + "program": "smartd", + "message": "Device: /dev/sdb [SAT], 2 Offline uncorrectable sectors" + } + ] + }, + { + "vendor": "Linux", + "identifier": "linux-smart-failure", + "component": "storage", + "severity": 2, + "message": "Device: /dev/, FAILED SMART self-check. BACK UP DATA NOW!", + "explanation": "The disk itself reports that its overall health check failed. Failure is likely soon.", + "recommended_action": "Back up the data on the disk now and replace it. If it is in a RAID array, replace it before a second disk fails. smartctl -a shows the attribute that failed.", + "reference": "https://manpages.debian.org/stable/smartmontools/smartd.8.en.html", + "regex": "FAILED SMART self-check|SMART Failure", + "program": "smartd", + "samples": [ + { + "program": "smartd", + "message": "Device: /dev/sdc [SAT], FAILED SMART self-check. BACK UP DATA NOW!" + }, + { + "program": "smartd", + "message": "Device: /dev/sda [SAT], SMART Failure: HARDWARE IMPENDING FAILURE GENERAL HARD DRIVE FAILURE" + } + ] + }, + { + "vendor": "Linux", + "identifier": "linux-multipath-no-paths", + "component": "storage", + "severity": 1, + "message": ": remaining active paths: 0", + "explanation": "All paths to a multipath device have failed. I/O will queue or fail depending on no_path_retry, and applications using the device will hang or get errors.", + "recommended_action": "Check the SAN fabric, HBA links, switch ports and the storage array for the LUN. Run multipath -ll to see path states. Once a path returns, multipathd reinstates it automatically; check for hung tasks afterwards.", + "reference": "https://manpages.debian.org/stable/multipath-tools/multipathd.8.en.html", + "regex": "remaining active paths: 0", + "program": "multipathd", + "samples": [ + { + "program": "multipathd", + "message": "mpatha: remaining active paths: 0" + } + ] + }, + { + "vendor": "Linux", + "identifier": "linux-multipath-path-failed", + "component": "storage", + "severity": 4, + "message": "checker failed path in map ", + "explanation": "One path to a multipath device failed. I/O continues on the remaining paths, but redundancy is reduced.", + "recommended_action": "Run multipath -ll to see which path is down and check the corresponding HBA port, cable, switch port and array controller. Repeated failing and reinstating (path flapping) usually points to a bad cable, SFP or switch port.", + "reference": "https://manpages.debian.org/stable/multipath-tools/multipathd.8.en.html", + "regex": "(?:mark as failed|checker failed path)", + "program": "multipathd", + "samples": [ + { + "program": "multipathd", + "message": "checker failed path 8:32 in map mpatha" + }, + { + "program": "multipathd", + "message": "sdc: mark as failed" + } + ] + }, + { + "vendor": "Linux", + "identifier": "linux-nfs-not-responding", + "component": "storage", + "severity": 3, + "message": "nfs: server not responding, still trying", + "explanation": "An NFS server stopped answering. Processes accessing the mount (hard mounts) block until it returns, which can look like a hung host.", + "recommended_action": "Check that the server is up and reachable (ping, rpcinfo -p , showmount -e), and the network path between them. When it returns the client logs \"server OK\". Consider monitoring the NFS server directly.", + "reference": "https://man7.org/linux/man-pages/man5/nfs.5.html", + "regex": "nfs: server \\S+ not responding", + "program": "kernel", + "samples": [ + { + "program": "kernel", + "message": "nfs: server nfs01.example.com not responding, still trying" + } + ] + }, + { + "vendor": "Linux", + "identifier": "linux-iscsi-conn-error", + "component": "storage", + "severity": 3, + "message": "connection:: detected conn error ()", + "explanation": "The iSCSI initiator lost its connection to a target. I/O is retried after reconnecting; if the session does not recover within the replacement timeout, I/O fails.", + "recommended_action": "Check the network path to the target (link, MTU, switch) and the target itself. Run iscsiadm -m session -P 3 to see the session state. Repeated errors with multipath configured should also show path failures in multipathd.", + "reference": "https://manpages.debian.org/stable/open-iscsi/iscsiadm.8.en.html", + "regex": "detected conn error \\(\\d+\\)", + "program": "kernel", + "samples": [ + { + "program": "kernel", + "message": " connection1:0: detected conn error (1020)" + } + ] + }, + { + "vendor": "Linux", + "identifier": "linux-nic-link-down", + "component": "network", + "severity": 4, + "message": " : : NIC Link is Down", + "explanation": "A network interface lost its physical link. Traffic on it stops until the link comes back.", + "recommended_action": "Check the cable, transceiver (SFP) and switch port, and the switch log for the same port. If the link goes up and down repeatedly, look at ethtool -S for errors and try another cable or port. On bonded interfaces, check that the bond still has an active member.", + "reference": "https://man7.org/linux/man-pages/man8/ethtool.8.html", + "regex": "(?i): (?:NIC(?: \\S+)? )?Link is Down\\b", + "program": "kernel", + "samples": [ + { + "program": "kernel", + "message": "e1000e 0000:00:19.0 eth0: NIC Link is Down" + }, + { + "program": "kernel", + "message": "mlx5_core 0000:3b:00.0 ens1f0: Link is Down" + }, + { + "program": "kernel", + "message": "tg3 0000:02:00.0 eth0: Link is down" + }, + { + "program": "kernel", + "message": "bnx2 0000:01:00.0 eth0: NIC Copper Link is Down" + } + ] + }, + { + "vendor": "Linux", + "identifier": "linux-bond-member-down", + "component": "network", + "severity": 4, + "message": ": (slave ): link status definitely down, disabling slave", + "explanation": "A member of a bonded interface lost its link and was taken out of the bond. The bond keeps working on its other members but with less redundancy.", + "recommended_action": "Check the member interface (cable, switch port) as for any link-down event, and cat /proc/net/bonding/ to see the remaining active members.", + "reference": "https://docs.kernel.org/networking/bonding.html", + "regex": "link status definitely down", + "program": "kernel", + "samples": [ + { + "program": "kernel", + "message": "bond0: (slave eth1): link status definitely down, disabling slave" + }, + { + "program": "kernel", + "message": "bond0: link status definitely down for interface eth1, disabling it" + } + ] + }, + { + "vendor": "Linux", + "identifier": "linux-bond-no-active", + "component": "network", + "severity": 1, + "message": ": now running without any active interface!", + "explanation": "Every member of a bonded interface is down. The host has lost network connectivity on that bond.", + "recommended_action": "Use the console or BMC to reach the host. Check all member links and their switch ports, and cat /proc/net/bonding/. If the switch side uses LACP, check that the port channel is up.", + "reference": "https://docs.kernel.org/networking/bonding.html", + "regex": "now running without any active interface", + "program": "kernel", + "samples": [ + { + "program": "kernel", + "message": "bond0: now running without any active interface!" + } + ] + }, + { + "vendor": "Linux", + "identifier": "linux-netdev-watchdog", + "component": "network", + "severity": 3, + "message": "NETDEV WATCHDOG: (): transmit queue timed out", + "explanation": "A network card stopped transmitting packets and the kernel will reset it. Traffic is interrupted during the reset.", + "recommended_action": "Update the network driver, the NIC firmware and the kernel. Check for related driver messages (for example \"Detected Hardware Unit Hang\") and PCIe errors. If it repeats, try disabling offloads with ethtool -K or moving the card to another slot.", + "reference": "https://man7.org/linux/man-pages/man8/ethtool.8.html", + "regex": "NETDEV WATCHDOG: (?:\\S+ \\(\\S+\\)|CPU: \\d+): transmit queue \\d+ timed out", + "program": "kernel", + "samples": [ + { + "program": "kernel", + "message": "NETDEV WATCHDOG: eth0 (e1000e): transmit queue 0 timed out" + }, + { + "program": "kernel", + "message": "e1000e 0000:00:1f.6 eno1: NETDEV WATCHDOG: CPU: 3: transmit queue 0 timed out 5000 ms" + } + ] + }, + { + "vendor": "Linux", + "identifier": "linux-nic-hardware-hang", + "component": "network", + "severity": 3, + "message": " : Detected Hardware Unit Hang", + "explanation": "The Intel e1000e or igb driver detected that the NIC stopped processing its transmit ring. The driver resets the adapter.", + "recommended_action": "Update the driver and NIC firmware. Known workarounds for some e1000e chips are to disable TCP segmentation offload (ethtool -K tso off gso off) or to turn off energy-efficient Ethernet.", + "reference": "https://man7.org/linux/man-pages/man8/ethtool.8.html", + "regex": "Detected Hardware Unit Hang", + "program": "kernel", + "samples": [ + { + "program": "kernel", + "message": "e1000e 0000:00:1f.6 eno1: Detected Hardware Unit Hang:" + } + ] + }, + { + "vendor": "Linux", + "identifier": "linux-conntrack-full", + "component": "network", + "severity": 2, + "message": "nf_conntrack: nf_conntrack: table full, dropping packet", + "explanation": "The netfilter connection tracking table is full, so new connections are dropped. Typical on busy firewalls, NAT gateways, load balancers and hosts under a connection flood.", + "recommended_action": "Compare the current and maximum counts (sysctl net.netfilter.nf_conntrack_count net.netfilter.nf_conntrack_max). Raise nf_conntrack_max (and the hash table size) if the traffic is legitimate, shorten timeouts for idle connections, or exclude high-volume traffic from tracking with NOTRACK rules. Investigate if the load is an attack.", + "reference": "https://docs.kernel.org/networking/nf_conntrack-sysctl.html", + "regex": "nf_conntrack: table full, dropping packet", + "program": "kernel", + "samples": [ + { + "program": "kernel", + "message": "nf_conntrack: nf_conntrack: table full, dropping packet" + } + ] + }, + { + "vendor": "Linux", + "identifier": "linux-syn-flood", + "component": "network", + "severity": 4, + "message": "TCP: request_sock_TCP: Possible SYN flooding on port . Sending cookies.", + "explanation": "A listening socket's SYN backlog overflowed. The message ends with Sending cookies when the kernel answered with SYN cookies, or Dropping request when cookies are disabled or unavailable and new connection attempts were dropped. It can be an attack or simply more connection attempts than the application accepts.", + "recommended_action": "Check the connection rate to the port and its sources (ss -ltn shows the backlog). If the traffic is legitimate, raise the application listen backlog and net.core.somaxconn and net.ipv4.tcp_max_syn_backlog. If it is an attack, rate-limit or filter at the firewall or upstream.", + "reference": "https://docs.kernel.org/networking/ip-sysctl.html", + "regex": "Possible SYN flooding on port", + "program": "kernel", + "samples": [ + { + "program": "kernel", + "message": "TCP: request_sock_TCP: Possible SYN flooding on port 443. Sending cookies. Check SNMP counters." + }, + { + "program": "kernel", + "message": "TCP: request_sock_TCP: Possible SYN flooding on port 8080. Dropping request. Check SNMP counters." + } + ] + }, + { + "vendor": "Linux", + "identifier": "linux-neighbour-overflow", + "component": "network", + "severity": 3, + "message": "neighbour: arp_cache: neighbor table overflow!", + "explanation": "The ARP or IPv6 neighbour cache is full, so the host cannot resolve new neighbours and connections to them fail. Common on hosts or routers attached to very large subnets, or with many containers.", + "recommended_action": "Raise net.ipv4.neigh.default.gc_thresh1/2/3 (and the IPv6 equivalents) to fit the number of neighbours, or reduce the size of the attached subnets.", + "reference": "https://docs.kernel.org/networking/ip-sysctl.html", + "regex": "neighbo(?:u)?r table overflow", + "program": "kernel", + "samples": [ + { + "program": "kernel", + "message": "neighbour: arp_cache: neighbor table overflow!" + } + ] + }, + { + "vendor": "Linux", + "identifier": "linux-tcp-out-of-memory", + "component": "network", + "severity": 3, + "message": "TCP: out of memory -- consider tuning tcp_mem", + "explanation": "TCP socket buffers reached the net.ipv4.tcp_mem limit, so the kernel is dropping or limiting connections. Often caused by many connections with full buffers (slow clients or a stalled application).", + "recommended_action": "Check socket memory with ss -tm and /proc/net/sockstat. Find the application that holds the buffers and fix it, or raise net.ipv4.tcp_mem if the host has enough memory.", + "reference": "https://docs.kernel.org/networking/ip-sysctl.html", + "regex": "TCP: out of memory -- consider tuning tcp_mem", + "program": "kernel", + "samples": [ + { + "program": "kernel", + "message": "TCP: out of memory -- consider tuning tcp_mem" + } + ] + }, + { + "vendor": "Linux", + "identifier": "linux-ipv6-duplicate-address", + "component": "network", + "severity": 4, + "message": "IPv6: : IPv6 duplicate address
used by detected!", + "explanation": "Duplicate address detection found another host using the same IPv6 address, so the address was not configured.", + "recommended_action": "Find the other host from the MAC address in the message (switch MAC table or neighbour cache) and fix the address assignment (static configuration or DHCPv6 reservations).", + "reference": "https://docs.kernel.org/networking/ip-sysctl.html", + "regex": "duplicate address \\S+ (?:used by \\S+ )?detected", + "program": "kernel", + "samples": [ + { + "program": "kernel", + "message": "IPv6: eth0: IPv6 duplicate address 2001:db8::10 used by 52:54:00:12:34:56 detected!" + } + ] + }, + { + "vendor": "Linux", + "identifier": "linux-martian", + "component": "network", + "severity": 5, + "message": "IPv4: martian source
from
, on dev ", + "explanation": "The kernel received a packet with an impossible source or destination address for the interface it arrived on, and dropped it (only logged when log_martians is enabled). Usually a routing or addressing mistake, sometimes spoofing.", + "recommended_action": "Check the routing tables and the addressing on the neighbouring network, and whether asymmetric routing is expected (then adjust rp_filter). If the messages are expected noise, set log_martians to 0 for both net.ipv4.conf.all and the affected interface (net.ipv4.conf..log_martians); logging stays on while either is enabled.", + "reference": "https://docs.kernel.org/networking/ip-sysctl.html", + "regex": "martian (?:source|destination)", + "program": "kernel", + "samples": [ + { + "program": "kernel", + "message": "IPv4: martian source 10.0.0.1 from 192.168.1.5, on dev eth0" + } + ] + }, + { + "vendor": "Linux", + "identifier": "linux-chrony-no-sources", + "component": "time", + "severity": 3, + "message": "Can't synchronise: no selectable sources", + "explanation": "chronyd has no usable time source, so the system clock is free-running and will drift. Time-sensitive services (Kerberos, TLS, clustered databases, log correlation) can fail.", + "recommended_action": "Run chronyc sources -v and chronyc tracking. Check that the configured servers resolve and are reachable on UDP 123 through any firewall, and that enough of them agree. Add more or closer sources if needed.", + "reference": "https://chrony-project.org/doc/4.6/chronyd.html", + "regex": "Can't synchronise: |No suitable source for synchronisation", + "program": "chronyd", + "samples": [ + { + "program": "chronyd", + "message": "Can't synchronise: no selectable sources" + }, + { + "program": "chronyd", + "message": "Can't synchronise: not enough selectable sources" + }, + { + "program": "chronyd", + "message": "No suitable source for synchronisation" + } + ] + }, + { + "vendor": "Linux", + "identifier": "linux-chrony-clock-wrong", + "component": "time", + "severity": 4, + "message": "System clock wrong by seconds", + "explanation": "chronyd found the system clock far from the correct time and is about to step or slew it. Large steps can disturb applications that assume time moves smoothly.", + "recommended_action": "Find out why the clock was wrong: a VM restored from a snapshot or resumed, a dead RTC battery, or a host that ran unsynchronised. Configure makestep in chrony.conf so large offsets are corrected only at boot.", + "reference": "https://chrony-project.org/doc/4.6/chrony.conf.html", + "regex": "System clock wrong by -?[0-9.]+ seconds", + "program": "chronyd", + "samples": [ + { + "program": "chronyd", + "message": "System clock wrong by 3600.123456 seconds" + }, + { + "program": "chronyd", + "message": "System clock wrong by -12.402003 seconds, adjustment started" + } + ] + }, + { + "vendor": "Linux", + "identifier": "linux-ntpd-no-sys-peer", + "component": "time", + "severity": 3, + "message": "
no_sys_peer", + "explanation": "ntpd lost its system peer: none of its servers is currently selected, so the clock is no longer disciplined and will drift.", + "recommended_action": "Run ntpq -p to see the state of each server, and check DNS and UDP 123 reachability and whether the servers agree. Consider moving to chrony, which most distributions now use by default.", + "reference": "https://www.ntp.org/documentation/4.2.8-series/ntpd/", + "regex": "\\bno_sys_peer\\b", + "program": "ntpd", + "samples": [ + { + "program": "ntpd", + "message": "0.0.0.0 c617 07 no_sys_peer" + } + ] + }, + { + "vendor": "Linux", + "identifier": "linux-clocksource-unstable", + "component": "time", + "severity": 4, + "message": "clocksource: timekeeping watchdog on CPU: Marking clocksource '' as unstable because the skew is too large", + "explanation": "The kernel found its clock source (often the TSC) drifting against another clock and switched to a slower one. Common on virtual machines or after firmware changes; time-related system calls become slower.", + "recommended_action": "On virtual machines check the hypervisor configuration and host load. On bare metal update BIOS and check power-management settings. Confirm the current source in /sys/devices/system/clocksource/clocksource0/current_clocksource.", + "reference": "https://docs.kernel.org/timers/timekeeping.html", + "regex": "Marking clocksource '\\S+' as unstable", + "program": "kernel", + "samples": [ + { + "program": "kernel", + "message": "clocksource: timekeeping watchdog on CPU1: Marking clocksource 'tsc' as unstable because the skew is too large:" + } + ] + }, + { + "vendor": "Linux", + "identifier": "linux-sshd-failed-password", + "component": "security", + "severity": 5, + "message": "Failed password for [invalid user] from
port ssh2", + "explanation": "An SSH password login failed. A few from known addresses are typing mistakes; many from different or foreign addresses are a brute-force attempt.", + "recommended_action": "Check the volume and sources (journalctl -u sshd, lastb). Disable password authentication (PasswordAuthentication no) in favour of keys, restrict access with AllowUsers or firewall rules, and block repeat offenders with fail2ban or sshguard. Make sure root cannot log in with a password.", + "reference": "https://man7.org/linux/man-pages/man5/sshd_config.5.html", + "regex": "Failed password for (?:invalid user )?\\S+ from \\S+ port \\d+", + "program": "sshd*", + "samples": [ + { + "program": "sshd", + "message": "Failed password for root from 203.0.113.7 port 52344 ssh2" + }, + { + "program": "sshd-session", + "message": "Failed password for invalid user oracle from 198.51.100.23 port 40122 ssh2" + } + ] + }, + { + "vendor": "Linux", + "identifier": "linux-sshd-max-auth", + "component": "security", + "severity": 4, + "message": "error: maximum authentication attempts exceeded for from
port ssh2 [preauth]", + "explanation": "An SSH client tried more authentication methods or passwords than MaxAuthTries allows in one connection and was disconnected. Typical of brute-force tools, and also of clients that offer many keys.", + "recommended_action": "If the source is unknown, block it (fail2ban, firewall). For legitimate users with many keys in their agent, configure IdentitiesOnly and the right IdentityFile on the client.", + "reference": "https://man7.org/linux/man-pages/man5/sshd_config.5.html", + "regex": "maximum authentication attempts exceeded for", + "program": "sshd*", + "samples": [ + { + "program": "sshd", + "message": "error: maximum authentication attempts exceeded for root from 203.0.113.7 port 51022 ssh2 [preauth]" + } + ] + }, + { + "vendor": "Linux", + "identifier": "linux-sshd-root-login", + "component": "security", + "severity": 5, + "message": "Accepted for root from
port ssh2", + "explanation": "Someone logged in directly as root over SSH. Direct root logins make actions hard to attribute to a person.", + "recommended_action": "Confirm the login was expected. Prefer personal accounts with sudo and set PermitRootLogin no (or prohibit-password) in sshd_config.", + "reference": "https://man7.org/linux/man-pages/man5/sshd_config.5.html", + "regex": "Accepted \\S+ for root from", + "program": "sshd*", + "samples": [ + { + "program": "sshd", + "message": "Accepted publickey for root from 192.0.2.10 port 55100 ssh2: RSA SHA256:abcdefghijklmnopqrstuvwxyz0123456789ABCD" + } + ] + }, + { + "vendor": "Linux", + "identifier": "linux-sudo-incorrect-password", + "component": "security", + "severity": 5, + "message": " : incorrect password attempts ; TTY= ; PWD= ; USER=root ; COMMAND=", + "explanation": "A user entered a wrong password for sudo. Repeated failures can mean a forgotten password or someone trying to guess it.", + "recommended_action": "Confirm with the user. If unexpected, check the session that ran sudo (TTY and source of the login) and lock the account while investigating.", + "reference": "https://man7.org/linux/man-pages/man5/sudoers.5.html", + "regex": "incorrect password attempts?", + "program": "sudo", + "samples": [ + { + "program": "sudo", + "message": "alice : 3 incorrect password attempts ; TTY=pts/0 ; PWD=/home/alice ; USER=root ; COMMAND=/bin/bash" + } + ] + }, + { + "vendor": "Linux", + "identifier": "linux-sudo-not-in-sudoers", + "component": "security", + "severity": 4, + "message": " : user NOT in sudoers ; TTY= ; PWD= ; USER=root ; COMMAND=", + "explanation": "A user who has no sudo rights tried to run a command with sudo.", + "recommended_action": "Confirm whether the user should have sudo rights; if so, add them through a group or a file in /etc/sudoers.d (edit with visudo). If not, find out why the attempt was made.", + "reference": "https://man7.org/linux/man-pages/man5/sudoers.5.html", + "regex": "user NOT in sudoers", + "program": "sudo", + "samples": [ + { + "program": "sudo", + "message": "bob : user NOT in sudoers ; TTY=pts/1 ; PWD=/home/bob ; USER=root ; COMMAND=/usr/bin/su" + } + ] + }, + { + "vendor": "Linux", + "identifier": "linux-faillock-locked", + "component": "security", + "severity": 4, + "message": "pam_faillock(:auth): Consecutive login failures for user account temporarily locked", + "explanation": "pam_faillock locked an account after too many failed logins. The user cannot log in until the unlock time passes or an administrator resets it.", + "recommended_action": "Check the failures with faillock --user . If they were the user, reset with faillock --user --reset. If not, treat it as an attack on the account and check the sources of the failed logins.", + "reference": "https://man7.org/linux/man-pages/man8/pam_faillock.8.html", + "regex": "Consecutive login failures for user \\S+ account temporarily locked", + "program": "", + "samples": [ + { + "program": "sshd", + "message": "pam_faillock(sshd:auth): Consecutive login failures for user jdoe account temporarily locked" + } + ] + }, + { + "vendor": "Linux", + "identifier": "linux-selinux-avc-denied", + "component": "security", + "severity": 5, + "message": "avc: denied { } for pid= comm=\"\" ... scontext=... tcontext=... tclass=...", + "explanation": "SELinux blocked an access because policy does not allow it. In permissive mode (permissive=1) it is only logged.", + "recommended_action": "Run ausearch -m avc -ts recent and sealert or audit2why to see why. Usually the fix is a correct file label (restorecon -Rv ) or an SELinux boolean (setsebool), not disabling SELinux. Create a local policy module with audit2allow only after confirming the access is legitimate.", + "reference": "https://docs.kernel.org/admin-guide/LSM/SELinux.html", + "regex": "avc:\\s+denied\\s+\\{", + "program": "", + "samples": [ + { + "program": "kernel", + "message": "audit: type=1400 audit(1733243200.123:456): avc: denied { read } for pid=1234 comm=\"httpd\" name=\"index.html\" dev=\"dm-0\" ino=12345 scontext=system_u:system_r:httpd_t:s0 tcontext=unconfined_u:object_r:user_home_t:s0 tclass=file permissive=0" + } + ] + }, + { + "vendor": "Linux", + "identifier": "linux-apparmor-denied", + "component": "security", + "severity": 5, + "message": "apparmor=\"DENIED\" operation=\"\" profile=\"\" name=\"\" ...", + "explanation": "AppArmor blocked an access by a confined program because its profile does not allow it.", + "recommended_action": "Check the profile named in the message (aa-status lists them). If the access is legitimate, add it to the profile or a local include under /etc/apparmor.d/local/ and reload it; aa-logprof can suggest the rule. Put the profile in complain mode only temporarily while testing.", + "reference": "https://docs.kernel.org/admin-guide/LSM/apparmor.html", + "regex": "apparmor=\"DENIED\"", + "program": "", + "samples": [ + { + "program": "kernel", + "message": "audit: type=1400 audit(1733243200.456:789): apparmor=\"DENIED\" operation=\"open\" profile=\"/usr/sbin/named\" name=\"/etc/bind/extra.conf\" pid=812 comm=\"named\" requested_mask=\"r\" denied_mask=\"r\" fsuid=110 ouid=0" + } + ] + }, + { + "vendor": "Linux", + "identifier": "linux-audit-backlog", + "component": "security", + "severity": 3, + "message": "audit: audit_backlog= > audit_backlog_limit=", + "explanation": "The kernel audit queue is full because auditd is not reading events fast enough. Events are lost, or with failure mode 2 the system panics.", + "recommended_action": "Raise the backlog with auditctl -b (or -b in audit.rules), reduce noisy audit rules, and check that auditd is running and its disk is not full or slow. Check auditctl -s for the lost counter.", + "reference": "https://man7.org/linux/man-pages/man8/auditctl.8.html", + "regex": "audit: (?:backlog limit exceeded|audit_backlog=\\d+ > audit_backlog_limit=)", + "program": "kernel", + "samples": [ + { + "program": "kernel", + "message": "audit: audit_backlog=8193 > audit_backlog_limit=8192" + }, + { + "program": "kernel", + "message": "audit: backlog limit exceeded" + } + ] + }, + { + "vendor": "Linux", + "identifier": "linux-systemd-unit-failed", + "component": "systemd", + "severity": 3, + "message": ": Failed with result ''. / Failed to start .", + "explanation": "A systemd unit failed. The result tells how: exit-code (the program exited with an error), signal or core-dump (it crashed), timeout (it did not start or stop in time), oom-kill, or start-limit-hit.", + "recommended_action": "Run systemctl status and journalctl -u -b to see the program's own error messages just before the failure. Fix the configuration or dependency it reports, then systemctl restart . Use systemctl --failed to list all failed units.", + "reference": "https://man7.org/linux/man-pages/man5/systemd.service.5.html", + "regex": "\\S+\\.(?:service|socket|mount|timer|path|scope): Failed with result '[^']+'|^Failed to start \\S", + "program": "systemd", + "samples": [ + { + "program": "systemd", + "message": "nginx.service: Failed with result 'exit-code'." + }, + { + "program": "systemd", + "message": "Failed to start nginx.service - A high performance web server and a reverse proxy server." + } + ] + }, + { + "vendor": "Linux", + "identifier": "linux-systemd-restart-loop", + "component": "systemd", + "severity": 3, + "message": ": Start request repeated too quickly.", + "explanation": "A unit failed and was restarted so many times in a short period that systemd stopped trying (start limit hit). The service stays down.", + "recommended_action": "Find the real failure in journalctl -u before the repeated restarts and fix it. Then run systemctl reset-failed and start it again. Adjust StartLimitIntervalSec= and StartLimitBurst= only if the defaults do not suit the service.", + "reference": "https://man7.org/linux/man-pages/man5/systemd.unit.5.html", + "regex": "Start request repeated too quickly", + "program": "systemd", + "samples": [ + { + "program": "systemd", + "message": "nginx.service: Start request repeated too quickly." + } + ] + }, + { + "vendor": "Linux", + "identifier": "linux-systemd-main-crashed", + "component": "systemd", + "severity": 3, + "message": ": Main process exited, code=dumped, status=/", + "explanation": "The main process of a systemd service was killed by a signal or crashed and dumped core (for example status=11/SEGV or status=6/ABRT). status=9/KILL often means the OOM killer or a manual kill.", + "recommended_action": "Check coredumpctl list and coredumpctl info for a crash, and journalctl -k for an OOM kill around the same time. Update the program and report reproducible crashes upstream.", + "reference": "https://man7.org/linux/man-pages/man8/systemd-coredump.8.html", + "regex": "Main process exited, code=(?:dumped|killed), status=", + "program": "systemd", + "samples": [ + { + "program": "systemd", + "message": "php-fpm.service: Main process exited, code=dumped, status=11/SEGV" + }, + { + "program": "systemd", + "message": "mysqld.service: Main process exited, code=killed, status=9/KILL" + } + ] + }, + { + "vendor": "Linux", + "identifier": "linux-coredump", + "component": "process", + "severity": 4, + "message": "Process () of user dumped core.", + "explanation": "A program crashed and systemd-coredump recorded it. Depending on its Storage= setting the core itself may have been stored or only its metadata.", + "recommended_action": "Use coredumpctl info to see the stack trace and whether a core is available, and coredumpctl gdb for detail. Update the program, and report reproducible crashes with the stack trace.", + "reference": "https://man7.org/linux/man-pages/man8/systemd-coredump.8.html", + "regex": "Process \\d+ \\(.*\\) of user \\d+ dumped core", + "program": "systemd-coredump", + "samples": [ + { + "program": "systemd-coredump", + "message": "Process 23456 (php-fpm) of user 0 dumped core." + }, + { + "program": "systemd-coredump", + "message": "Process 3456 (Web Content) of user 1000 dumped core." + } + ] + }, + { + "vendor": "Linux", + "identifier": "linux-journald-suppressed", + "component": "logging", + "severity": 5, + "message": "Suppressed messages from ", + "explanation": "journald rate-limited a service that logged too many messages in a short time, and discarded the excess. Those messages are also missing from syslog and from Cacti.", + "recommended_action": "Find out why the service is so verbose (a debug log level or an error loop) and fix it. If the volume is legitimate, raise RateLimitBurst= (or shorten RateLimitIntervalSec=) in journald.conf, or LogRateLimitBurst= for that unit; an interval of 0 turns rate limiting off. Raising the interval alone makes the limit stricter.", + "reference": "https://man7.org/linux/man-pages/man5/journald.conf.5.html", + "regex": "Suppressed \\d+ messages from", + "program": "systemd-journald", + "samples": [ + { + "program": "systemd-journald", + "message": "Suppressed 1234 messages from nginx.service" + } + ] + }, + { + "vendor": "Linux", + "identifier": "linux-rsyslog-ratelimit", + "component": "logging", + "severity": 4, + "message": " from : begin to drop messages due to rate-limiting", + "explanation": "rsyslog rate-limited an input (a local process through imuxsock, or the journal through imjournal) and is dropping messages, so they are missing from the logs forwarded to Cacti. rsyslog reports how many were lost when the limit ends.", + "recommended_action": "Find the source in the message and reduce its logging. If the volume is legitimate, raise the burst or shorten the interval on the input: SysSock.RateLimit.Burst and SysSock.RateLimit.Interval for imuxsock, or Ratelimit.Burst and Ratelimit.Interval for imjournal. An interval of 0 disables rate limiting; raising the interval alone makes the limit stricter.", + "reference": "https://www.rsyslog.com/doc/configuration/modules/imuxsock.html", + "regex": "begins? to drop messages(?: from pid \\d+)? due to rate-limiting", + "program": "rsyslogd*", + "samples": [ + { + "program": "rsyslogd", + "message": "imuxsock[1234]: imuxsock begins to drop messages from pid 5678 due to rate-limiting" + }, + { + "program": "rsyslogd", + "message": "imjournal: begin to drop messages due to rate-limiting" + }, + { + "program": "rsyslogd-2177", + "message": "imuxsock[1234]: imuxsock from : begin to drop messages due to rate-limiting" + } + ] + }, + { + "vendor": "Linux", + "identifier": "linux-rsyslog-action-suspended", + "component": "logging", + "severity": 3, + "message": "action '' suspended (module ''), retry . There should be messages before this one giving the reason for suspension.", + "explanation": "An rsyslog output, such as forwarding to the Cacti syslog server or writing to a database, failed and rsyslog suspended it. Messages are queued or lost until it resumes.", + "recommended_action": "Read the preceding rsyslog messages for the cause (connection refused, DNS failure, database error) and check that the destination is reachable and listening. To keep messages through an outage, give the action a disk-assisted queue and set action.resumeRetryCount=\"-1\" (the default 0 discards messages once the action fails), then monitor the queue size. Check for \"action ... resumed\" afterwards.", + "reference": "https://www.rsyslog.com/doc/configuration/actions.html", + "regex": "action '[^']+' suspended", + "program": "rsyslogd*", + "samples": [ + { + "program": "rsyslogd", + "message": "action 'action-1-builtin:omfwd' suspended (module 'builtin:omfwd'), retry 0. There should be messages before this one giving the reason for suspension." + }, + { + "program": "rsyslogd-2007", + "message": "action 'action-0-ommysql' suspended (module 'ommysql'), next retry is Tue Dec 3 10:46:47 2026, retry nbr 0." + } + ] + }, + { + "vendor": "Linux", + "identifier": "linux-too-many-open-files", + "component": "process", + "severity": 3, + "message": "... (24: Too many open files)", + "explanation": "A process reached its limit of open file descriptors (EMFILE), so it cannot open files or accept connections.", + "recommended_action": "Check the process limit (cat /proc//limits) and how many descriptors it uses (ls /proc//fd | wc -l). Raise LimitNOFILE= in the systemd unit, or nofile in limits.conf for login sessions, if the usage is legitimate; otherwise look for a descriptor leak.", + "reference": "https://man7.org/linux/man-pages/man2/setrlimit.2.html", + "regex": "Too many open files(?! in system)", + "program": "", + "samples": [ + { + "program": "nginx", + "message": "2024/12/03 10:46:17 [crit] 1234#1234: accept4() failed (24: Too many open files)" + }, + { + "program": "java", + "message": "java.net.SocketException: Too many open files" + } + ] + }, + { + "vendor": "Linux", + "identifier": "linux-file-max", + "component": "process", + "severity": 2, + "message": "VFS: file-max limit reached / ... Too many open files in system", + "explanation": "The system-wide limit on open files (fs.file-max) was reached (ENFILE). Any process trying to open a file now fails, whatever its own limit.", + "recommended_action": "Check usage with cat /proc/sys/fs/file-nr and find the processes holding the most descriptors (lsof | awk '{print $2}' | sort | uniq -c | sort -n). Fix the leak or raise fs.file-max with sysctl.", + "reference": "https://docs.kernel.org/admin-guide/sysctl/fs.html", + "regex": "VFS: file-max limit \\d+ reached|Too many open files in system", + "program": "", + "samples": [ + { + "program": "kernel", + "message": "VFS: file-max limit 9223372036854775807 reached" + }, + { + "program": "httpd", + "message": "(23)Too many open files in system: AH00090: could not open file /var/www/html/index.html" + } + ] + }, + { + "vendor": "Linux", + "identifier": "linux-pids-limit", + "component": "process", + "severity": 3, + "message": "cgroup: fork rejected by pids controller in ", + "explanation": "A control group (a service, user session or container) reached its TasksMax / pids limit, so creating new processes or threads failed.", + "recommended_action": "Find the cgroup in the message and check whether the service is leaking threads or processes. If the workload is legitimate, raise TasksMax= for the unit, DefaultTasksMax= in system.conf, or for user sessions TasksMax= in a drop-in such as /etc/systemd/system/user-.slice.d/tasks.conf.", + "reference": "https://man7.org/linux/man-pages/man5/systemd.resource-control.5.html", + "regex": "fork rejected by pids controller in", + "program": "kernel", + "samples": [ + { + "program": "kernel", + "message": "cgroup: fork rejected by pids controller in /system.slice/tomcat.service" + } + ] + } + ] +} diff --git a/docs/RECOMMENDATION_SOURCES.md b/docs/RECOMMENDATION_SOURCES.md index 3080087e..22718c2a 100644 --- a/docs/RECOMMENDATION_SOURCES.md +++ b/docs/RECOMMENDATION_SOURCES.md @@ -307,6 +307,43 @@ The converted rule files are listed by group in `GROUPS` in `extract_wazuh_rules - OS_Regex does not backtrack, but PCRE does, so a converted pattern can match slightly more than the original rule. - The descriptions are short, and no recommended actions are provided. + `docs/linux-curated.json.gz` adds actions for the most important messages. + +## Linux (curated) + +**Records: 70** hand-written pattern recommendations, every one with an explanation and a recommended action. +They were written for this plugin, are covered by its GPL-2.0-or-later license, and are maintained in +`contrib/recommendations/linux-curated.json`. Each record's `reference` links to the Linux kernel documentation, +man page or project documentation it relies on (docs.kernel.org, man7.org, manpages.debian.org, chrony, +ntp.org, rsyslog, btrfs). The links were checked on 2026-12-03. + +Build: + +```shell +contrib/recommendations/build_catalogues.py linux-curated < contrib/recommendations/linux-curated.json +``` + +| Area | Records | +|---|---| +| Memory: OOM kills (system and cgroup), OOM with nothing to kill, page allocation failures | 4 | +| CPU and crashes: soft and hard lockups, hung tasks, RCU stalls, panics, oopses, segfaults | 7 | +| Hardware: thermal throttling and critical temperature, machine checks, EDAC corrected and uncorrected errors | 5 | +| Storage: block, buffer, SATA, SCSI medium and NVMe errors, SMART, multipath, NFS, iSCSI | 12 | +| Filesystems and RAID: ext4, XFS and Btrfs errors, read-only remounts, full filesystems, md and mdadm events | 8 | +| Network: link down, bonding, transmit timeouts, NIC hangs, conntrack, SYN floods, neighbour and TCP memory, duplicate addresses, martians | 11 | +| Time: chrony, ntpd, unstable clock source | 4 | +| Security: sshd, sudo, pam_faillock, SELinux, AppArmor, audit backlog | 9 | +| Services and logging: systemd unit failures, restart loops, crashes, core dumps, journald and rsyslog message loss, file and process limits | 10 | + +- **Identifier:** `linux-`, such as `linux-oom-kill`. +- **Pattern and program:** written against the message as the plugin stores it, without the syslog header. + Kernel messages use the program `kernel`. Patterns allow for the optional `[seconds.micro]` timestamp some + kernel messages carry, and `sshd*` also matches `sshd-session`. +- **Samples:** every record lists one or more realistic messages under `samples` (113 in total), including the + format variants of current kernels and daemons. The build drops them, and the unit tests check that each sample + finds its own record first, and that the shipped file equals the source without its samples. +- **Order:** the plugin shows pattern recommendations with an action before those without, so importing this + catalogue together with `docs/linux-wazuh.json.gz` puts this advice first. ## MikroTik diff --git a/docs/linux-curated.json.gz b/docs/linux-curated.json.gz new file mode 100644 index 0000000000000000000000000000000000000000..876650fd058e40d52be6b602116d3918905723ef GIT binary patch literal 15832 zcmV;}Jtx8+iwFP!00002|IK}SbKBOn@Bimh?Bjc9Og01=yJ>HaEZd_7d`fb{~qP@MUhOV{Nl%HY!1Uwm6)H3yq?P& zX)=nlGRE&ey?+xt?SCKSMUaM7T(llIuZt89O{;2N?hOW$q?*>lKCNNEV-DtNJxQ{2 zS>0fm=EFf0U&d)ZAG~>ec>MPCSjH>!x)||%zZOYV#hIb4naZtA1~4+*o*Cs?RV2f~ z(sl=FlGWG2s4i%wQUAA+HqFB?AIqNkOkW%GFaDR0D2ws}^S{9m{1*R^L~&Ln<0R%E zW&Av!1s6%0Hc!#$^E{&`@z5-u<;9};v7`;trWW+upWTkzZp5co~L2Pd$Lz~5f@pU(gD?JWU{<6CH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Y2CNJd5?*COC{CEPFl8&u!5jqf{8 zf7l~>Lz$}Uj8QsBl51h4-s=nqavN>8(@27jo@Eio$eVsr~(Ca zSqrlRCM7F&)@*B|K~x?IuFw`hVL$Un>5R+1oxZE?1(~^X{FYGxLf4{^v0bP(529hJ z$Z%#-i7aRW2<~Q9iN{PXZ94=J*kT(>gBVEl9Mk`>%B)aDHH&;~ic7An*0gd%4z`ch zq;QW3KfX8(-S(~fvlh@SU5r?oD^%i@&Jwn z0Ys0Kt9k=(RN`bitCTnqq?YRss7VKKC?GD=O3sZe$LV^ghh!^6-_-W(E}uKGPZ+_G z$VAQ04tN?&b)o)KIgB i3lS(dthdQ*0d}{Cj?lkf{^Q^O@&5o?M*||l<^TZNfMC=B literal 0 HcmV?d00001 diff --git a/docs/linux-curated.json.gz.license b/docs/linux-curated.json.gz.license new file mode 100644 index 00000000..e9ee3d64 --- /dev/null +++ b/docs/linux-curated.json.gz.license @@ -0,0 +1,2 @@ +SPDX-FileCopyrightText: The Cacti Group +SPDX-License-Identifier: GPL-2.0-or-later diff --git a/includes/recommendations.php b/includes/recommendations.php index dbc648cf..08a1bd21 100644 --- a/includes/recommendations.php +++ b/includes/recommendations.php @@ -216,7 +216,9 @@ function syslog_recommendation_normalize(array $input, ?string &$reason = null): return null; } - $regex = is_scalar($input['regex'] ?? null) ? trim((string) $input['regex']) : ''; + // A pattern is kept exactly as written: surrounding spaces can be part of it. + $regex = is_scalar($input['regex'] ?? null) ? (string) $input['regex'] : ''; + $regex = trim($regex) === '' ? '' : $regex; $program = syslog_recommendation_text($input['program'] ?? '', 65); if ($regex !== '') { @@ -1039,7 +1041,9 @@ function syslog_recommendation_pattern_ids(string $message, string $program, str * @param string $program The syslog program of the message, if known. * * @return list> The matching rows: identifier matches, - * longest identifier first, then pattern matches. + * longest identifier first, then pattern + * matches, those with a recommended action + * first and otherwise oldest first. */ function syslog_recommendations_lookup(string $message, int $limit = 3, string $host = '', string $program = ''): array { $limit = max(1, $limit); @@ -1078,7 +1082,9 @@ function syslog_recommendations_lookup(string $message, int $limit = 3, string $ $rows = is_array($rows) ? $rows : []; } - $ids = syslog_recommendation_pattern_ids($message, $program, $recognised, $limit - count($rows)); + $remaining = $limit - count($rows); + $patterns = syslog_recommendation_patterns(); + $ids = $remaining > 0 && $patterns ? syslog_recommendation_pattern_ids($message, $program, $recognised, count($patterns)) : []; if ($ids) { $matched = syslog_db_fetch_assoc_prepared( @@ -1094,11 +1100,22 @@ function syslog_recommendations_lookup(string $message, int $limit = 3, string $ $by_id[(int) $row['id']] = $row; } + // Matches that say what to do come first, whatever order the + // catalogues were imported in; otherwise oldest first. + $with_action = []; + $without_action = []; + foreach ($ids as $id) { if (isset($by_id[$id])) { - $rows[] = $by_id[$id]; + if (trim((string) $by_id[$id]['recommended_action']) !== '') { + $with_action[] = $by_id[$id]; + } else { + $without_action[] = $by_id[$id]; + } } } + + $rows = array_merge($rows, array_slice(array_merge($with_action, $without_action), 0, $remaining)); } return $rows; diff --git a/locales/po/cacti.pot b/locales/po/cacti.pot index 109a54a6..e567236e 100644 --- a/locales/po/cacti.pot +++ b/locales/po/cacti.pot @@ -8,7 +8,7 @@ msgid "" msgstr "" "Project-Id-Version: Cacti \n" "Report-Msgid-Bugs-To: developers@cacti.net\n" -"POT-Creation-Date: 2026-12-03 11:25-0500\n" +"POT-Creation-Date: 2026-12-03 11:51-0500\n" "PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n" "Last-Translator: Cacti Developers >\n" "Language-Team: Cacti Developers \n" @@ -3682,7 +3682,7 @@ msgid "Identifiers that contain other characters, such as the # slo msgstr "" #: syslog_recommendations.php -msgid "A recommendation with a Pattern is matched by that regular expression instead of by its identifier, and only against messages from its Program when one is set. It applies to every sender except a Cacti device recognised as a different vendor. Pattern recommendations are tried after identifier recommendations, oldest first, when fewer than three identifiers match." +msgid "A recommendation with a Pattern is matched by that regular expression instead of by its identifier, and only against messages from its Program when one is set. It applies to every sender except a Cacti device recognised as a different vendor. Pattern recommendations are shown after identifier recommendations, when fewer than three identifiers match; those with a recommended action come first, then the oldest." msgstr "" #: syslog_recommendations.php diff --git a/syslog_recommendations.php b/syslog_recommendations.php index 94888a42..7edf09a6 100644 --- a/syslog_recommendations.php +++ b/syslog_recommendations.php @@ -171,7 +171,7 @@ function recommendation_save(): void { $input = []; foreach (['vendor', 'identifier', 'component', 'severity', 'message', 'explanation', 'recommended_action', 'reference', 'regex', 'program'] as $field) { - $input[$field] = trim((string) get_nfilter_request_var($field)); + $input[$field] = $field === 'regex' ? (string) get_nfilter_request_var($field) : trim((string) get_nfilter_request_var($field)); } $reason = null; $record = syslog_recommendation_normalize($input, $reason); @@ -528,7 +528,7 @@ function recommendation_matching_help(): void { __('A leading % is literal, not a wildcard, and must match the message word as written. An identifier %LINK-3-UPDOWN matches the message word %LINK-3-UPDOWN, not LINK-3-UPDOWN; an identifier without the prefix matches only the unprefixed word.', 'syslog'), __('When the syslog host is a Cacti device whose vendor is recognised from its SNMP system description or device template, and recommendations exist for that vendor, only that vendor\'s recommendations and those without a vendor are checked. Otherwise all vendors are checked, but an identifier made only of digits matches only recommendations without a vendor. When several recommendations match, the longest identifiers are shown first, up to three.', 'syslog'), __('Identifiers that contain other characters, such as the # slot placeholder or the | alternatives in some vendor documentation (for example %ASA|PIX-3-331001), are kept and exported but can never match. Set Can Match to No to list them, and edit them into the exact code, for example %ASA-3-331001.', 'syslog'), - __('A recommendation with a Pattern is matched by that regular expression instead of by its identifier, and only against messages from its Program when one is set. It applies to every sender except a Cacti device recognised as a different vendor. Pattern recommendations are tried after identifier recommendations, oldest first, when fewer than three identifiers match.', 'syslog') + __('A recommendation with a Pattern is matched by that regular expression instead of by its identifier, and only against messages from its Program when one is set. It applies to every sender except a Cacti device recognised as a different vendor. Pattern recommendations are shown after identifier recommendations, when fewer than three identifiers match; those with a recommended action come first, then the oldest.', 'syslog') ]; print "
" . __('How Recommendations Are Matched', 'syslog') . '
    '; diff --git a/tests/Unit/RecommendationsTest.php b/tests/Unit/RecommendationsTest.php index 8eb3527e..da522b75 100644 --- a/tests/Unit/RecommendationsTest.php +++ b/tests/Unit/RecommendationsTest.php @@ -318,7 +318,8 @@ function recommendation_sample(array $override = []): array { 'Palo Alto Networks' => ['paloalto.json.gz', 'Palo Alto Networks', 364], 'MikroTik' => ['mikrotik.json.gz', 'MikroTik', 11], 'Linux' => ['linux.json.gz', 'Linux', 102], - 'Linux (Wazuh)' => ['linux-wazuh.json.gz', 'Linux', 411] + 'Linux (Wazuh)' => ['linux-wazuh.json.gz', 'Linux', 411], + 'Linux (curated)' => ['linux-curated.json.gz', 'Linux', 70] ]); it('streams compressed exports across database pages without changing the filters or records', function () { @@ -831,6 +832,7 @@ function recommendation_pattern_db(array $records, array $devices = []): PDO { 'program wildcards' => [['regex' => 'x', 'program' => '*postfix*'], null], 'inner wildcard' => [['regex' => 'x', 'program' => 'post*fix'], 'wildcard at its start or end'], 'pattern only' => [['regex' => '(?i)out of memory'], null], + 'surrounding spaces' => [['regex' => ' CE '], null], 'invalid pattern' => [['regex' => 'Failed (password'], 'not a valid regular expression'], 'matches empty message' => [['regex' => 'error|'], 'matches an empty message'], 'line break' => [['regex' => "a\nb"], 'control characters'], @@ -1044,3 +1046,58 @@ function recommendation_require_post(): void {} ->and($license)->toBe('SPDX-FileCopyrightText: ' . $document['copyright'] . "\nSPDX-License-Identifier: " . $document['license'] . "\n"); } }); + +/** + * Load catalogue records into an in-memory table with their recommended actions. + * + * @param list> $records Parsed catalogue records, in import order. + */ +function recommendation_catalogue_db(array $records): void { + $db = recommendation_pattern_db([]); + $insert = $db->prepare('INSERT INTO syslog_recommendations (identifier, vendor, explanation, recommended_action, regex, program) VALUES (?, ?, ?, ?, ?, ?)'); + + foreach ($records as $r) { + $insert->execute([$r['identifier'], $r['vendor'], $r['explanation'], $r['recommended_action'], $r['regex'] ?? '', $r['program'] ?? '']); + } +} + +it('finds each curated Linux recommendation first for every sample message in its source', function () { + $root = dirname(__DIR__, 2); + $source = json_decode((string) file_get_contents($root . '/contrib/recommendations/linux-curated.json'), true); + $records = syslog_recommendations_parse(syslog_recommendations_read_file($root . '/docs/linux-curated.json.gz'))['records']; + $built = array_map(static fn (array $r): array => array_diff_key($r, ['samples' => true]), $source['recommendations']); + + // The shipped file is the source without its test samples. + expect(array_map(static fn (array $r): string => (string) json_encode($r), $records)) + ->toBe(array_map(static fn (array $r): string => (string) json_encode(syslog_recommendation_normalize($r)), $built)); + + recommendation_catalogue_db($records); + $checked = 0; + + foreach ($source['recommendations'] as $record) { + expect($record['recommended_action'])->not->toBe('') + ->and($record['samples'])->not->toBeEmpty(); + + foreach ($record['samples'] as $sample) { + $found = array_column(syslog_recommendations_lookup($sample['message'], 3, '', $sample['program']), 'identifier'); + + expect($found[0] ?? null)->toBe($record['identifier'], $sample['message']); + $checked++; + } + } + + expect($checked)->toBeGreaterThan(90); +}); + +it('shows a curated recommendation with an action before a description-only one imported earlier', function () { + $root = dirname(__DIR__, 2); + $read = static fn (string $file): array => syslog_recommendations_parse(syslog_recommendations_read_file($root . '/docs/' . $file))['records']; + + recommendation_catalogue_db([...$read('linux-wazuh.json.gz'), ...$read('linux-curated.json.gz')]); + + $found = syslog_recommendations_lookup('Out of memory: Killed process 4242 (java) total-vm:8123456kB', 3, '', 'kernel'); + + expect($found[0]['identifier'])->toBe('linux-oom-kill') + ->and(array_column($found, 'identifier'))->toContain('wazuh-5108') + ->and($found[0]['recommended_action'])->not->toBe(''); +}); From d2357c89c20bdf2ed1127d0a3e3e034cd3e490f4 Mon Sep 17 00:00:00 2001 From: TheWitness Date: Thu, 3 Dec 2026 15:22:28 -0500 Subject: [PATCH 2/2] fix(recommendations): keep kernel oops advice off user-space faults Review follow-up for the curated Linux catalogue: - linux-kernel-oops matched any "general protection fault", so a user-space crash logged by the kernel (traps: app[pid] general protection fault ip:... in libc.so.6) got the oops explanation and "Plan a reboot". Match only the oops form ("general protection fault[, probably for non-canonical address 0x...]: 0000 [#1]"). - Records may now list "non_matches", messages they must not match, and the unit test checks them; the traps line is the first. - Anchor linux-systemd-unit-failed's unit name, so a long run without spaces no longer costs quadratic backtracking on every systemd line. - Include the recommended action in the duplicate pattern match key, so a record that differs from an earlier match only by having an action is no longer skipped before the action-first ordering. docs/linux-curated.json.gz is rebuilt with build_catalogues.py. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com> --- README.md | 4 ++-- contrib/recommendations/linux-curated.json | 16 +++++++++++++--- docs/linux-curated.json.gz | Bin 15832 -> 15884 bytes includes/recommendations.php | 8 ++++---- tests/Unit/RecommendationsTest.php | 19 ++++++++++++++++++- 5 files changed, 37 insertions(+), 10 deletions(-) diff --git a/README.md b/README.md index 9a2f1b17..5caf7300 100644 --- a/README.md +++ b/README.md @@ -860,8 +860,8 @@ matched by that regular expression instead, and its identifier only names it evaluations, so a very large page (such as Show All) cannot stall the request; rows beyond that point show only identifier matches, and opening a message still lists its pattern matches. -* A pattern recommendation with the same vendor, message and explanation as one - already matched is skipped, so a recommendation split into several patterns +* A pattern recommendation with the same vendor, message, explanation and + recommended action as one already matched is skipped, so a recommendation split into several patterns (for example one per program) is listed once. ```json diff --git a/contrib/recommendations/linux-curated.json b/contrib/recommendations/linux-curated.json index 785bcfac..6afe49e3 100644 --- a/contrib/recommendations/linux-curated.json +++ b/contrib/recommendations/linux-curated.json @@ -1,7 +1,7 @@ { "format": "syslog-recommendations", "version": 1, - "_comment": "Source of docs/linux-curated.json.gz, written for the Cacti syslog plugin (GPL-2.0-or-later). Each record lists sample messages under \"samples\"; the unit tests check that every sample finds its record. Build with: build_catalogues.py linux-curated < contrib/recommendations/linux-curated.json", + "_comment": "Source of docs/linux-curated.json.gz, written for the Cacti syslog plugin (GPL-2.0-or-later). Each record lists sample messages under \"samples\", and may list messages it must not match under \"non_matches\"; the unit tests check both. Build with: build_catalogues.py linux-curated < contrib/recommendations/linux-curated.json", "recommendations": [ { "vendor": "Linux", @@ -194,7 +194,7 @@ "explanation": "The kernel detected an invalid memory access or an internal consistency check failed (an oops). The faulting task is killed, but the kernel may be left in an unstable state.", "recommended_action": "Save the full oops text including the call trace (journalctl -k -b -1 after a reboot). Note the module named in the trace, update the kernel and that driver, and check memory with a hardware diagnostic if oopses appear in unrelated places. Plan a reboot, because the kernel may be inconsistent after an oops.", "reference": "https://docs.kernel.org/admin-guide/bug-hunting.html", - "regex": "BUG: (?:unable to handle (?:kernel )?(?:paging request|page fault|NULL pointer dereference)|kernel NULL pointer dereference)|general protection fault|kernel BUG at \\S+:\\d+", + "regex": "BUG: (?:unable to handle (?:kernel )?(?:paging request|page fault|NULL pointer dereference)|kernel NULL pointer dereference)|general protection fault(?:, probably for non-canonical address 0x[0-9a-f]+)?: [0-9a-f]{4} \\[#\\d+\\]|kernel BUG at \\S+:\\d+", "program": "kernel", "samples": [ { @@ -209,10 +209,20 @@ "program": "kernel", "message": "general protection fault, probably for non-canonical address 0xdead000000000100: 0000 [#1] SMP NOPTI" }, + { + "program": "kernel", + "message": "general protection fault: 0000 [#1] SMP PTI" + }, { "program": "kernel", "message": "kernel BUG at mm/slub.c:4042!" } + ], + "non_matches": [ + { + "program": "kernel", + "message": "traps: myapp[1234] general protection fault ip:7f2c1a2b3c4d sp:7ffd5e6f7a8b error:0 in libc.so.6[7f2c1a200000+195000]" + } ] }, { @@ -1232,7 +1242,7 @@ "explanation": "A systemd unit failed. The result tells how: exit-code (the program exited with an error), signal or core-dump (it crashed), timeout (it did not start or stop in time), oom-kill, or start-limit-hit.", "recommended_action": "Run systemctl status and journalctl -u -b to see the program's own error messages just before the failure. Fix the configuration or dependency it reports, then systemctl restart . Use systemctl --failed to list all failed units.", "reference": "https://man7.org/linux/man-pages/man5/systemd.service.5.html", - "regex": "\\S+\\.(?:service|socket|mount|timer|path|scope): Failed with result '[^']+'|^Failed to start \\S", + "regex": "^[^\\s:]+\\.(?:service|socket|mount|timer|path|scope): Failed with result '[^']+'|^Failed to start \\S", "program": "systemd", "samples": [ { diff --git a/docs/linux-curated.json.gz b/docs/linux-curated.json.gz index 876650f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t9B z+t`X8(-S(~fvlh@SU5r?oD^%i@&Jwn z0Ys0Kt9k=(RN{SPJFAp95u}#u52#58a3~-y(@M^bEXV13sE1@LMBmi*>@J@>u}>Jm zk;p{N&klGRQ;myJwJgE39uHZU2{`myWMzq57lvb#v@t-?FH^YDq5=1l73;}^_|#Cd jhYJxXIIOqHYyoz+hmO#{U;g9Y|MC9-T1NvS!sY+~JSiyr diff --git a/includes/recommendations.php b/includes/recommendations.php index 08a1bd21..8a1fb931 100644 --- a/includes/recommendations.php +++ b/includes/recommendations.php @@ -918,7 +918,7 @@ function syslog_recommendation_patterns(bool $reset = false): array|false { } if ($patterns === null) { - $rows = syslog_db_fetch_assoc_prepared('SELECT id, vendor, regex, program, message, explanation + $rows = syslog_db_fetch_assoc_prepared('SELECT id, vendor, regex, program, message, explanation, recommended_action FROM syslog_recommendations WHERE regex > ? ORDER BY id @@ -947,7 +947,7 @@ function syslog_recommendation_patterns(bool $reset = false): array|false { 'vendor' => (string) $row['vendor'], 'regex' => syslog_recommendation_regex((string) $row['regex']), 'program' => strtolower((string) ($row['program'] ?? '')), - 'advice' => $message === '' ? '' : hash('sha256', $row['vendor'] . "\0" . $message . "\0" . ($row['explanation'] ?? '')) + 'advice' => $message === '' ? '' : hash('sha256', $row['vendor'] . "\0" . $message . "\0" . ($row['explanation'] ?? '') . "\0" . ($row['recommended_action'] ?? '')) ]; } } @@ -961,8 +961,8 @@ function syslog_recommendation_patterns(bool $reset = false): array|false { * A pattern record applies to a sender unless the sender is a Cacti device * recognised as another vendor, and, when it names a program, only to * messages from that program (ignoring case). A record repeating the vendor, - * message and explanation of an earlier match is skipped, so one - * recommendation is not listed twice. + * message, explanation and recommended action of an earlier match is + * skipped, so one recommendation is not listed twice. * * @param string $message The syslog message text. * @param string $program The syslog program of the message, if known. diff --git a/tests/Unit/RecommendationsTest.php b/tests/Unit/RecommendationsTest.php index da522b75..764c16c6 100644 --- a/tests/Unit/RecommendationsTest.php +++ b/tests/Unit/RecommendationsTest.php @@ -1065,7 +1065,7 @@ function recommendation_catalogue_db(array $records): void { $root = dirname(__DIR__, 2); $source = json_decode((string) file_get_contents($root . '/contrib/recommendations/linux-curated.json'), true); $records = syslog_recommendations_parse(syslog_recommendations_read_file($root . '/docs/linux-curated.json.gz'))['records']; - $built = array_map(static fn (array $r): array => array_diff_key($r, ['samples' => true]), $source['recommendations']); + $built = array_map(static fn (array $r): array => array_diff_key($r, ['samples' => true, 'non_matches' => true]), $source['recommendations']); // The shipped file is the source without its test samples. expect(array_map(static fn (array $r): string => (string) json_encode($r), $records)) @@ -1084,11 +1084,28 @@ function recommendation_catalogue_db(array $records): void { expect($found[0] ?? null)->toBe($record['identifier'], $sample['message']); $checked++; } + + foreach ($record['non_matches'] ?? [] as $sample) { + $found = array_column(syslog_recommendations_lookup($sample['message'], 3, '', $sample['program']), 'identifier'); + + expect($found)->not->toContain($record['identifier'], $sample['message']); + $checked++; + } } expect($checked)->toBeGreaterThan(90); }); +it('keeps a matching record whose only difference from an earlier one is its recommended action', function () { + $db = recommendation_pattern_db([]); + $insert = $db->prepare('INSERT INTO syslog_recommendations (identifier, vendor, message, explanation, recommended_action, regex, program) VALUES (?, ?, ?, ?, ?, ?, ?)'); + + $insert->execute(['plain', 'Linux', 'Disk failed', 'The disk failed.', '', 'disk failed', '']); + $insert->execute(['actioned', 'Linux', 'Disk failed', 'The disk failed.', 'Replace the disk.', 'disk failed', '']); + + expect(array_column(syslog_recommendations_lookup('sda: disk failed', 3), 'identifier'))->toBe(['actioned', 'plain']); +}); + it('shows a curated recommendation with an action before a description-only one imported earlier', function () { $root = dirname(__DIR__, 2); $read = static fn (string $file): array => syslog_recommendations_parse(syslog_recommendations_read_file($root . '/docs/' . $file))['records'];