diff --git a/CHANGELOG.md b/CHANGELOG.md
index e3a1733d..cdd0305c 100644
--- a/CHANGELOG.md
+++ b/CHANGELOG.md
@@ -6,8 +6,9 @@
--- develop ---
-* 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 collector scripts in contrib/recommendations/vendors/ that build Arista, Cisco, Dell, Fortinet, HPE, Huawei, Juniper, Nokia, NVIDIA and Palo Alto Networks recommendation catalogues from each vendor's published documentation, for import on a site's own Recommendations page. They obey robots.txt and use browser-saved documents where a vendor does not allow scripted downloads; the catalogues remain under the vendor's terms and are not redistributable. See docs/VENDOR_COLLECTORS.md
+* security: Remove the recommendation catalogues derived from network vendors' documentation (Arista, Cisco, Dell, Fortinet, HPE, Huawei, Juniper, MikroTik, Nokia, NVIDIA and Palo Alto Networks) together with their build entries and documentation, because that documentation is not licensed for redistribution with the plugin. No catalogue is loaded automatically any more; earlier 5.0 builds loaded the Cisco catalogue once on install or upgrade. Records already imported into a database are not deleted: to remove them, filter the Recommendations page by vendor and use the Delete action
+* 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
* 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
@@ -20,7 +21,6 @@
* issue#480: Split the syslog upgrade notice in `includes/installer.php` into separate balanced `
` translation strings, regenerate `locales/po/cacti.pot`, and remove orphan `locales/LC_MESSAGES/ka.mo`
* issue#479: With more than one Syslog Processing Process, the master no longer waits out the full ten second registration window on each phase when its workers have already finished or exited
* issue#479: Replace the GET_LOCK()-based Syslog processing lock with Cacti's process registry so transfer workers no longer stop writing when their database connection is routed to a different cluster node; the master, partition rebuilds and on-demand table repair now coordinate through register_process_start('syslog','master',...) and workers verify the master by process id
-* feature: Add manually importable recommendation catalogues for Arista, Dell, Fortinet, HPE, Huawei, MikroTik, Nokia, NVIDIA and Palo Alto Networks in docs/.json.gz, built from each vendor's public message references
* feature: Recommendations are matched only against the sending device's vendor (and vendor-neutral records) when the syslog host is a Cacti device whose vendor is recognised from its SNMP sysDescr or device template and has records; other hosts match every vendor, except that all-digit identifiers then match only vendor-neutral records
* feature: Preserve legacy DATETIME logtime history (including TO_DAYS partitioned tables) in cli/upgrade_partitioning.php with --source-time-zone=. Before any change the zone must be known to PHP/Cacti and the Syslog database, both must agree on its offsets across the stored history, and every value must exist in it. Stored and removed messages are then renamed and copied in verified batches in that zone, and a retry must reuse the same zone
@@ -58,9 +58,9 @@
* feature: The Report Rules Message Match String is a resizable text area, taller for SQL Expressions
-* feature#46: Add Recommendations. A vendor-neutral `syslog_recommendations` table maps a message identifier (a Cisco `%FACILITY-SEV-MNEMONIC`, a Juniper `RPD_OSPF_NBRDOWN`, and so on) to an explanation and a recommended action. Hovering over a row in the Syslog tab now asks the server for a matching recommendation and shows its explanation and recommended action in the tooltip. Console > Syslog Settings > Recommendations (Syslog Administration realm) adds, edits and deletes records and imports and exports them as JSON, using field names drawn from Sigma and the Elastic Common Schema so catalogues from other suppliers can be converted. docs/cisco.json.gz, converted from the Cisco Error Message Database (CEMDB) shipped with php-syslog-ng, is loaded once on install or upgrade without overwriting existing records
+* feature#46: Add Recommendations. A vendor-neutral `syslog_recommendations` table maps a message identifier (a Cisco `%FACILITY-SEV-MNEMONIC`, a Juniper `RPD_OSPF_NBRDOWN`, and so on) to an explanation and a recommended action. Hovering over a row in the Syslog tab now asks the server for a matching recommendation and shows its explanation and recommended action in the tooltip. Console > Syslog Settings > Recommendations (Syslog Administration realm) adds, edits and deletes records and imports and exports them as JSON, using field names drawn from Sigma and the Elastic Common Schema so catalogues from other suppliers can be converted.
-* feature: Add an optional Juniper EX Series recommendation catalogue in docs/juniper.json.gz, convert the Cisco seed to docs/cisco.json.gz, accept .json and .json.gz recommendation imports, and export gzip-compressed JSON by default while retaining one-time Cisco seeding
+* feature: Accept .json and .json.gz recommendation imports, and export gzip-compressed JSON by default
* issue#458: Initialize and validate the active tab before saving view defaults, avoiding a TypeError that disables Syslog and stops processing
* issue#459: Explain that SQL Expression rule previews search only queued incoming messages, so an empty preview is not mistaken for an alert-processing failure
diff --git a/NOTICE b/NOTICE
index 5d846034..84f81290 100644
--- a/NOTICE
+++ b/NOTICE
@@ -12,9 +12,7 @@ The recommendation catalogues are data files that the plugin can import on
request. None is loaded automatically. Each catalogue has a .license
file next to it with its SPDX copyright and license tags, and the same
copyright, license, license_url and source fields at the top of its JSON
-document.
-
-Openly licensed catalogues, distributed under their own licenses:
+document. All are openly licensed and distributed under their own licenses:
docs/linux.json.gz systemd journal message catalog.
Copyright systemd contributors.
@@ -28,32 +26,15 @@ Openly licensed catalogues, distributed under their own licenses:
contrib/recommendations/linux-curated.json).
Copyright The Cacti Group. GPL-2.0-or-later.
-Vendor-derived catalogues:
-
- docs/arista.json.gz, docs/cisco.json.gz, docs/dell.json.gz,
- docs/fortinet.json.gz, docs/hpe.json.gz, docs/huawei.json.gz,
- docs/juniper.json.gz, docs/mikrotik.json.gz, docs/nokia.json.gz,
- docs/nvidia.json.gz, docs/paloalto.json.gz
-
-These catalogues are separate works aggregated with the Syslog plugin. They are
-not part of the plugin and are not licensed under the GNU General Public
-License. Their content is condensed from the vendors' public documentation,
-which remains Copyright its respective owners, all rights reserved, and is
-subject to each owner's terms. Their .license files name those terms with
-LicenseRef- identifiers (for example LicenseRef-Cisco-Terms-of-Use); these are
-references to the vendor's terms of use, not open licenses. The terms are
-linked from the "Recommendation sources and licensing" section of README.md
-and in each file's license_url field. The catalogues are provided for
-reference and interoperability with the vendors' products. Check the vendor's
-terms before redistributing a catalogue outside your organisation.
+Vendor catalogue collectors (contrib/recommendations/vendors/)
+--------------------------------------------------------------
-docs/nvidia.json.gz is partly openly licensed: its Cumulus Linux switchd and
-FRRouting records come from NVIDIA networking documentation licensed under
-Creative Commons Attribution-NonCommercial-ShareAlike 4.0 International
-(CC-BY-NC-SA-4.0, https://docs.nvidia.com/networking-ethernet-software/license/),
-which permits non-commercial sharing with attribution under the same license.
-That license is not compatible with the GPL. Its Xid and SXid records come from
-documentation under the NVIDIA Terms of Service.
+These scripts are part of the plugin (GPL-2.0-or-later). They download or
+read a network vendor's published documentation and write a recommendation
+catalogue for use within the organisation that runs them. They contain no
+vendor documentation themselves. The catalogues they produce are copies of
+the vendor's material, remain subject to that vendor's terms, are not part of
+the plugin and must not be redistributed with it. See docs/VENDOR_COLLECTORS.md.
Trademarks are the property of their respective owners. This notice describes
where the data comes from and is not legal advice.
diff --git a/README.md b/README.md
index 5caf7300..a16a2795 100644
--- a/README.md
+++ b/README.md
@@ -807,9 +807,10 @@ which returns JSON.
(`Linux ...`) is ignored. The syslog host is matched to a device by
description or hostname, ignoring case; when several devices match and they
name different vendors, or any of them is unrecognised, the host is treated
- as unrecognised. The recognised vendors use the names of the bundled
- catalogues: Arista, Cisco, Dell, Fortinet, HPE, Huawei, Juniper, MikroTik,
- Nokia, NVIDIA and Palo Alto Networks. A device that names none of them but
+ as unrecognised. The recognised vendors are Arista, Cisco, Dell, Fortinet,
+ HPE, Huawei, Juniper, MikroTik, Nokia, NVIDIA and Palo Alto Networks; give
+ your own recommendations for these devices the same vendor name. A device
+ that names none of them but
mentions Linux in its description or template (a Net-SNMP agent reports
`Linux ...`) is a Linux device. Many network operating
systems run on Linux, so a vendor named in either always wins.
@@ -818,8 +819,7 @@ which returns JSON.
identifiers match.
* Identifiers containing other characters, such as the `#` slot placeholder or
the `|` alternatives in some vendor documentation (`%ASA|PIX-3-331001`), are
- stored and exported but can never match. The bundled data has 860 of them;
- set **Can Match** to No on the Recommendations page to list them, and edit
+ stored and exported but can never match. Set **Can Match** to No on the Recommendations page to list them, and edit
them into the exact code (for
example `%ASA-3-331001`). Saving or importing such an identifier shows a
note saying it cannot match.
@@ -883,47 +883,23 @@ Syslog Administration realm). You can add, edit, and delete records, filter by
vendor, severity and whether they match by identifier or pattern, and import or
export them as JSON. A recommendation is identified by its vendor and identifier.
-No catalogue is loaded automatically. Import the ones you need from the
-Recommendations page; see [Recommendation sources and licensing](#recommendation-sources-and-licensing)
-for the terms that cover each file. Before this change, `docs/cisco.json.gz`
-was loaded once when the plugin was installed or upgraded to 5.0. Records loaded
-that way are kept, and you can delete them on the Recommendations page (filter
-by vendor Cisco and use the Delete action). The Cisco catalogue retains the
-CEMDB/php-syslog-ng data and field values.
-
-A curated, manually importable Juniper EX Series catalogue is available in
-`docs/juniper.json.gz`. Its 14 ESWD records are based on Juniper's System Log
-Explorer; most source records provide an explanation but no recommended action.
-This is not a complete Juniper catalogue and is not automatically installed.
-Message templates use bracketed variable names and explanatory wording, not
-regular expressions.
-
-Further manually importable catalogues are built from each vendor's public
-message references. None of them is installed automatically, and none is
-complete. Explanations and actions are condensed from the vendor text; where a
-vendor documents no action the field is empty. The `reference` field of each
-record links to its source. [RECOMMENDATION_SOURCES.md](docs/RECOMMENDATION_SOURCES.md)
-lists the source documents, versions and retrieval dates of each file, and
-`contrib/recommendations/build_catalogues.py` is the final build step.
+Three catalogues are provided in `docs/`. None is loaded automatically: import
+the ones you need from the Recommendations page. Each record's `reference` field
+links to its source. [RECOMMENDATION_SOURCES.md](docs/RECOMMENDATION_SOURCES.md)
+lists the source documents and versions, and
+`contrib/recommendations/build_catalogues.py` is the final build step. See
+[Recommendation sources and licensing](#recommendation-sources-and-licensing) for
+the license of each file.
| File | Vendor | Records | Coverage and identifier form |
|------|--------|---------|------------------------------|
-| `docs/arista.json.gz` | Arista | 1,047 | EOS System Message Guide (EOS 4.15), `%FACILITY-SEV-MNEMONIC` such as `%LINEPROTO-5-UPDOWN`. Later EOS messages are missing. |
-| `docs/dell.json.gz` | Dell | 7,142 | PowerEdge iDRAC/CMC messages that can be sent to remote syslog (6,811, MessageID such as `PSU0003`), SmartFabric OS10 (327, `%IFM_ASTATE_UP`) and four OS9 messages (`%CHMGR-2-MAJOR_TEMP`). |
-| `docs/hpe.json.gz` | HPE | 4,883 | Comware 5 and 7 switches (`%10IFNET/3/PHY_UPDOWN`, the default log-host format), AOS-CX 10.17 and ArubaOS-Switch 16.10 event IDs (`4701`, `00076`), which have explanations but no actions. 694 AOS-CX and ArubaOS-Switch events are omitted because HPE's guides give no description for them. |
-| `docs/huawei.json.gz` | Huawei | 3,686 | CloudEngine S16700 and 9800/8800/6800 (VRP8) and S1720–S6720 (VRP5) Log References, `%01MODULE/SEV/MNEMONIC` such as `%01IFNET/4/IF_STATE`, as the lookup reads `%%01IFNET/4/IF_STATE(l)`. Devices that send another version number than `01` do not match. AR and NE routers are not included. |
-| `docs/nvidia.json.gz` | NVIDIA | 251 | Cumulus Linux 5.18 switchd messages keyed on the function name they contain, FRRouting `[EC nnnnnnnn]` error codes, and the GPU `Xid`/NVSwitch `SXid` families. |
-| `docs/nokia.json.gz` | Nokia | 2,016 | SR OS Log Events Guide 25.10, `APP-SEVERITY-EventName-EventID` such as `SYSTEM-WARNING-tmnxStateChange-2009`, using each event's default severity. An event whose severity was changed on the router does not match. 7210 SAS and SR Linux are not included. |
-| `docs/fortinet.json.gz` | Fortinet | 1,462 | FortiOS 7.6.8 Log Message Reference, every traffic, event and UTM log ID as the 10-digit `logid` sent on the wire (`logid="0100032001"`). The full ID is built from the documented type, subtype and message ID. Fortinet documents no recommended actions. |
-| `docs/paloalto.json.gz` | Palo Alto Networks | 364 | PAN-OS System log event IDs from the Syslog Severity Reference, such as `tunnel-status-down`. Generic event IDs (`general`, `auth`) and event IDs that are ordinary networking phrases other vendors also log (`link-down`, `admin-down`, `auth-fail`, `lacp-up`) are excluded. Few records have a recommended action. |
-| `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
-(see the matching rules above).
+Identifiers made only of digits only match messages from a Cacti device whose
+vendor is recognised, unless they are stored without a vendor (see the matching
+rules above).
### Linux and systemd message IDs
@@ -1019,49 +995,38 @@ 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.
-Three catalogues are openly licensed: the systemd catalogue
+All 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**:
-the plugin's license grant applies to its code and to its openly licensed data,
-not to vendor-derived catalogues. Those records are short summaries that link
-back to the vendor's page in their `reference` field, and the vendor's own
-documentation is the authoritative text. Check the linked terms before you
-redistribute a catalogue outside your organisation. No catalogue is loaded
-automatically; each is imported only when an administrator chooses to.
+GPL-2.0-or-later. Their records keep their source's license and copyright
+notices. No catalogue is loaded automatically; each is imported only when an
+administrator chooses to.
Every catalogue has a `.license` file next to it (for example
`docs/linux-wazuh.json.gz.license`) with SPDX copyright and license tags, and
the same information is in the `copyright`, `license`, `license_url` and
-`source` fields at the top of its JSON document. Vendor terms are named with
-`LicenseRef-` identifiers, such as `LicenseRef-Cisco-Terms-of-Use`; they refer
-to the vendor's terms of use and are not open licenses. The [NOTICE](NOTICE)
-file summarises the licensing of the whole plugin and states that the
-vendor-derived catalogues are separate works aggregated with it, not part of
-the plugin. This section describes where the data comes from; it is not legal
-advice. Source documents, versions and retrieval dates are listed in
-[RECOMMENDATION_SOURCES.md](docs/RECOMMENDATION_SOURCES.md).
+`source` fields at the top of its JSON document. The [NOTICE](NOTICE) file
+summarises the licensing of the whole plugin. This section describes where the
+data comes from; it is not legal advice. Source documents and versions are
+listed in [RECOMMENDATION_SOURCES.md](docs/RECOMMENDATION_SOURCES.md).
+
+The plugin does not ship recommendations derived from network vendors'
+documentation, because that documentation is not licensed for redistribution.
+You can create such records for your own use on the Recommendations page or
+import them from a file you build yourself.
+[VENDOR_COLLECTORS.md](docs/VENDOR_COLLECTORS.md) describes scripts in
+`contrib/recommendations/vendors/` that build catalogues for Arista, Cisco,
+Dell, Fortinet, HPE, Huawei, Juniper, Nokia, NVIDIA and Palo Alto Networks from
+the vendor's published documentation. The catalogues they produce stay under
+the vendor's terms: use them within your organisation and do not redistribute
+them.
| Vendor | File | Source | Copyright and license | How it was obtained |
|--------|------|--------|-----------------------|---------------------|
-| Arista | `docs/arista.json.gz` | EOS System Message Guide (EOS 4.15, 2015) | © Arista Networks, Inc.; proprietary documentation, [Arista Terms of Use](https://www.arista.com/en/terms-of-use) | Extracted from Internet Archive copies of the public EOS 4.15 System Message Guide PDF. |
-| Cisco | `docs/cisco.json.gz` | Cisco Error Message Database (CEMDB) | © Cisco and/or its affiliates; proprietary documentation, [Cisco Terms of Use](https://www.cisco.com/c/en/us/about/legal/terms-conditions.html) and [Copyright Use Policies](https://www.cisco.com/c/en/us/about/brand-center/copyright-use.html). The data was distributed with the GPL-2.0 php-syslog-ng project. | Converted from the CEMDB data shipped with php-syslog-ng; no longer loaded automatically. |
-| Dell | `docs/dell.json.gz` | PowerEdge Error and Event Messages Reference (EEMI), SmartFabric OS10 System Log Message Reference, OS9 configuration guide | © Dell Inc.; proprietary documentation, [Dell Terms of Use](https://www.dell.com/en-us/legal/lp/site-terms-of-use) | Extracted from Dell's public EEMI guide and OS10 and OS9 documentation pages. |
-| Fortinet | `docs/fortinet.json.gz` | FortiOS 7.6.8 Log Message Reference | © Fortinet, Inc.; proprietary documentation, [Fortinet Legal, Limited License](https://www.fortinet.com/corporate/about-us/legal) | Generated from the public FortiOS Log Message Reference pages; explanations are built from the documented message, type and level. |
-| HPE | `docs/hpe.json.gz` | Comware 5 and 7 System Log Messages References, AOS-CX 10.17 and ArubaOS-Switch 16.10 Event Log Message References | © Hewlett Packard Enterprise Development LP; proprietary documentation, [HPE Terms of Use](https://www.hpe.com/us/en/about/legal/terms-of-use.html) | Extracted from public HPE and Aruba log message reference guides on support.hpe.com. |
-| Huawei | `docs/huawei.json.gz` | CloudEngine and S-series (VRP5 and VRP8) Log References | © Huawei Technologies Co., Ltd.; proprietary documentation, [Huawei Terms of Use](https://www.huawei.com/en/legal) | Extracted from Huawei's public log references through its regional documentation mirror. |
-| 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. |
-| Palo Alto Networks | `docs/paloalto.json.gz` | PAN-OS System Log Reference, System Log Fields and selected Knowledge Base articles | © Palo Alto Networks, Inc.; proprietary documentation, [Palo Alto Networks Terms of Use](https://www.paloaltonetworks.com/legal-notices/terms-of-use) | Extracted from the public PAN-OS System Log Reference; most explanations are generated from the documented message and severity. |
## Settings
diff --git a/contrib/recommendations/build_catalogues.py b/contrib/recommendations/build_catalogues.py
index 96d1c980..dd9b03ec 100755
--- a/contrib/recommendations/build_catalogues.py
+++ b/contrib/recommendations/build_catalogues.py
@@ -12,26 +12,25 @@
# | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
# | GNU General Public License for more details. |
# +-------------------------------------------------------------------------+
-"""Build a docs/.json.gz recommendation catalogue from extracted JSON.
+"""Build a docs/.json.gz recommendation catalogue from extracted JSON.
-The input is a syslog-recommendations JSON document extracted from the
-vendor's public message reference (see docs/RECOMMENDATION_SOURCES.md). The
-build drops records the importer would reject (neither an explanation nor a
-recommended action), case-insensitive duplicate identifiers (first kept) and
-the generic identifiers listed in EXCLUDE, then writes reproducible gzip to
-the plugin's docs/ directory.
+The input is a syslog-recommendations JSON document produced from an openly
+licensed source (see docs/RECOMMENDATION_SOURCES.md). The build drops records
+the importer would reject (neither an explanation nor a recommended action) and
+case-insensitive duplicate identifiers (first kept), then writes reproducible
+gzip to 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-curated linux-wazuh mikrotik
- nokia nvidia paloalto
+Usage: build_catalogues.py NAME < extracted/.json
+ build_catalogues.py --metadata-only NAME
+ NAME is one of: linux linux-curated linux-wazuh
For linux, the extracted JSON comes from extract_systemd_catalog.py; for
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).
+hand-written contrib/recommendations/linux-curated.json. --metadata-only
+refreshes the licensing fields of docs/.json.gz without touching its
+records.
-Each build also writes docs/.json.gz.license with SPDX copyright and
+Each build also writes docs/.json.gz.license with SPDX copyright and
license tags, and puts the same copyright, license, license_url and source in
the JSON document, from LICENSING below.
"""
@@ -42,26 +41,8 @@
import os
import sys
-# Who owns each catalogue's source material and under which terms. LicenseRef-
-# identifiers name vendor terms of use; they are not open licenses (see NOTICE).
+# Who owns each catalogue's source material and under which license.
LICENSING = {
- 'arista': ('Arista Networks, Inc.', 'LicenseRef-Arista-Terms-of-Use',
- 'https://www.arista.com/en/terms-of-use', 'Arista EOS System Message Guide (EOS 4.15)'),
- 'cisco': ('Cisco Systems, Inc. and/or its affiliates', 'LicenseRef-Cisco-Terms-of-Use',
- 'https://www.cisco.com/c/en/us/about/legal/terms-conditions.html',
- 'Cisco Error Message Database (CEMDB), as distributed with php-syslog-ng'),
- 'dell': ('Dell Inc. or its subsidiaries', 'LicenseRef-Dell-Terms-of-Use',
- 'https://www.dell.com/en-us/legal/lp/site-terms-of-use',
- 'Dell PowerEdge EEMI guide, SmartFabric OS10 System Log Message Reference, OS9 configuration guide'),
- 'fortinet': ('Fortinet, Inc.', 'LicenseRef-Fortinet-Terms-of-Use',
- 'https://www.fortinet.com/corporate/about-us/legal', 'FortiOS 7.6.8 Log Message Reference'),
- 'hpe': ('Hewlett Packard Enterprise Development LP', 'LicenseRef-HPE-Terms-of-Use',
- 'https://www.hpe.com/us/en/about/legal/terms-of-use.html',
- 'HPE Comware, AOS-CX and ArubaOS-Switch log message references'),
- 'huawei': ('Huawei Technologies Co., Ltd.', 'LicenseRef-Huawei-Terms-of-Use',
- 'https://www.huawei.com/en/legal', 'Huawei CloudEngine and S-series Log References'),
- 'juniper': ('Juniper Networks, Inc.', 'LicenseRef-Juniper-Terms-of-Use',
- 'https://www.juniper.net/us/en/legal-notices.html', 'Juniper System Log Explorer'),
'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'),
@@ -70,17 +51,6 @@
'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'),
- 'mikrotik': ('SIA Mikrotikls (MikroTik)', 'LicenseRef-MikroTik-Documentation',
- 'https://help.mikrotik.com/docs/', 'MikroTik RouterOS documentation (help.mikrotik.com)'),
- 'nokia': ('Nokia', 'LicenseRef-Nokia-Terms-of-Use', 'https://www.nokia.com/notices/terms/',
- 'Nokia SR OS 25.10 Log Events Guide'),
- 'nvidia': ('NVIDIA Corporation & affiliates', 'CC-BY-NC-SA-4.0 AND LicenseRef-NVIDIA-Terms-of-Service',
- 'https://docs.nvidia.com/networking-ethernet-software/license/ (Cumulus Linux switchd and FRRouting '
- 'records); https://www.nvidia.com/en-us/about-nvidia/terms-of-service/ (Xid and SXid records)',
- 'NVIDIA Cumulus Linux 5.18 log message references, Xid and Fabric Manager documentation'),
- 'paloalto': ('Palo Alto Networks, Inc.', 'LicenseRef-PaloAltoNetworks-Terms-of-Use',
- 'https://www.paloaltonetworks.com/legal-notices/terms-of-use',
- 'PAN-OS System Log Reference and Knowledge Base articles'),
}
# Output names are taken from this table, never from the command line.
@@ -94,27 +64,10 @@
# Pattern record fields, kept only when set.
OPTIONAL_FIELDS = ['regex', 'program']
-# Identifiers that are ordinary words or protocol terms other vendors also log
-# as a single token; they would show this vendor's advice for unrelated messages.
-EXCLUDE = {
- 'paloalto': {
- 'admin-down', 'agent-event', 'auth-fail', 'auth-success', 'cache-cleared',
- 'cert-expiry', 'connect-client', 'connect-fail', 'expired-time', 'fan-failure',
- 'fan-inserted', 'fan-removed', 'if-add', 'if-clear', 'if-del', 'lacp-down',
- 'lacp-up', 'lease-end', 'lease-start', 'link-change', 'link-down', 'load-success',
- 'nego-fail', 'neighbor-down', 'nh-down', 'nh-up', 'ps-failure', 'ps-inserted',
- 'relay-on', 'server-on', 'slot-up', 'speed-duplex', 'state-change', 'unresponsive',
- },
- 'mikrotik': {
- '3way', 'cme', 'cmd-failed', 'conntrack', 'fcs', 'no-proposal-chosen', 'ph1', 'phase1',
- },
-}
-
-
def build(vendor, source):
records = json.load(source)['recommendations']
- seen, out, empty, excluded, duplicate = set(), [], 0, 0, 0
+ seen, out, empty, duplicate = set(), [], 0, 0
for record in records:
if not (record.get('explanation') or '').strip() and not (record.get('recommended_action') or '').strip():
@@ -123,10 +76,6 @@ def build(vendor, source):
key = record['identifier'].lower()
- if key in EXCLUDE.get(vendor, ()):
- excluded += 1
- continue
-
if key in seen:
duplicate += 1
continue
@@ -138,7 +87,7 @@ def build(vendor, source):
write(vendor, out)
- print('%s: kept %d, no text %d, excluded %d, duplicate %d' % (vendor, len(out), empty, excluded, duplicate))
+ print('%s: kept %d, no text %d, duplicate %d' % (vendor, len(out), empty, duplicate))
def write(vendor, records):
diff --git a/contrib/recommendations/vendors/collect_arista.py b/contrib/recommendations/vendors/collect_arista.py
new file mode 100755
index 00000000..f1ec54fb
--- /dev/null
+++ b/contrib/recommendations/vendors/collect_arista.py
@@ -0,0 +1,276 @@
+#!/usr/bin/env python3
+# +-------------------------------------------------------------------------+
+# | Copyright (C) 2004-2026 The Cacti Group |
+# | |
+# | This program is free software; you can redistribute it and/or |
+# | modify it under the terms of the GNU General Public License |
+# | as published by the Free Software Foundation; either version 2 |
+# | of the License, or (at your option) any later version. |
+# | |
+# | This program is distributed in the hope that it will be useful, |
+# | but WITHOUT ANY WARRANTY; without even the implied warranty of |
+# | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
+# | GNU General Public License for more details. |
+# +-------------------------------------------------------------------------+
+"""Build an Arista recommendation catalogue from an EOS System Message Guide PDF you supply.
+
+Source: Arista's "EOS System Message Guide" (SysMsgGuide.pdf), for example the guide for
+Software Release 4.15.3F (December 3, 2015). Arista distributes the guide from its
+login-protected software download portal (https://www.arista.com/en/support/software-download;
+see https://www.arista.com/en/um-eos/eos-system-event-logging), so this script does not
+download anything: sign in with your own Arista account, save the guide, and pass it with
+--pdf. --pdf may be given more than once (for example two releases of the guide); a message
+found in an earlier file wins. Requires pdfminer.six.
+
+The guide has one section per facility ("2.1 AAA Messages") and, for each message, the
+mnemonic and message text followed by "Severity:", "Explanation:" and "Recommended Action:".
+Each message becomes the identifier %FACILITY--MNEMONIC, as it appears in syslog,
+for example "%LINEPROTO-5-UPDOWN" from
+ Nov 20 17:01:02 leaf1 Ebra: %LINEPROTO-5-UPDOWN: Line protocol on Interface Ethernet1, changed state to down
+The severity word maps to RFC 5424: Emergency 0, Alert 1, Critical 2, Error 3, Warning 4,
+Notice 5, Info 6, Debug 7. The texts are kept as published (with %s/%d placeholders), apart
+from typographic repairs:
+ - the PDF draws the underscores of mnemonics as rules rather than characters; they are
+ restored from the gaps between the letters (pdfminer.six character positions), while
+ kerning gaps ("W ARM", "DELA Y") are closed;
+ - words hyphenated at a line break are rejoined when the unhyphenated word occurs
+ elsewhere in the guide or neither half does, otherwise the hyphen is kept;
+ - ligatures are expanded, curly quotes straightened, and the guide's "¿"/"¡" (its font's
+ rendering of ">" and "<") restored.
+
+Known gaps: only EOS messages that are in the guide you supply are included (the 4.15 guide
+predates later releases' messages; CloudVision and other non-EOS messages are not covered).
+Some mnemonics that look truncated are reproduced as published (for example under VRRP), and
+a few entries have an empty explanation. --limit stops after that many PDF pages per file.
+
+Usage:
+ contrib/recommendations/vendors/collect_arista.py --pdf SysMsgGuide.pdf -o /some/dir/arista.json.gz
+"""
+
+import collections
+import os
+import re
+import sys
+import unicodedata
+
+sys.path.insert(0, os.path.dirname(os.path.abspath(__file__)))
+
+import collector # noqa: E402
+
+LABELS = {'severity': 'severity', 'explanation': 'explanation', 'recommended action': 'recommended_action'}
+SECTION = re.compile(r'^\d+\.\d+\s+(\S+)\s+Messages$')
+RELEASE = re.compile(r'Software Release\s+(\S+)')
+# A gap wider than this (in points, for 10 pt text) between two letters of a mnemonic is an underscore.
+UNDERSCORE_GAP = 1.5
+
+
+def extra(parser):
+ parser.add_argument('--pdf', action='append', required=True, metavar='FILE',
+ help='EOS System Message Guide PDF saved from Arista\'s support portal (may be repeated)')
+ parser.add_argument('--reference', default='',
+ help='URL to record as each message\'s reference, e.g. where you obtained the guide')
+
+
+def typography(text):
+ text = unicodedata.normalize('NFKC', text)
+
+ text = text.replace('\u201c', '"').replace('\u201d', '"')
+
+ # The guide's font encoding prints ">" and "<" as inverted question and exclamation marks.
+ return text.replace('\u2019', "'").replace('\u2018', "'").replace('\u00bf', '>').replace('\u00a1', '<')
+
+
+def lines(path, limit):
+ """Yield (page number, characters) for each text line of the PDF, top to bottom.
+
+ Each character is a dict with its text, font flags and horizontal position; spaces that
+ pdfminer inferred between words are kept as ' ' without a position.
+ """
+ from pdfminer.high_level import extract_pages
+ from pdfminer.layout import LTChar, LTTextContainer, LTTextLine
+
+ def walk(element):
+ for child in element:
+ if isinstance(child, LTTextLine):
+ yield child
+ elif isinstance(child, LTTextContainer):
+ yield from walk(child)
+
+ for number, page in enumerate(extract_pages(path, maxpages=limit or 0), 1):
+ found = []
+
+ for line in walk(page):
+ chars = []
+
+ for item in line:
+ if isinstance(item, LTChar):
+ font = item.fontname.split('+')[-1]
+ chars.append({'bold': 'Medi' in font or 'Bold' in font, 'slant': 'Slant' in font or 'Ital' in font,
+ 'text': item.get_text(), 'x0': item.x0, 'x1': item.x1, 'size': item.size})
+ elif item.get_text() == ' ':
+ chars.append({'bold': chars[-1]['bold'] if chars else False, 'slant': False, 'text': ' ',
+ 'x0': None, 'x1': None, 'size': 0})
+
+ if chars:
+ found.append((-round(line.y1), line.x0, chars))
+
+ for _, _, chars in sorted(found, key=lambda item: (item[0], item[1])):
+ yield number, chars
+
+
+def plain(chars):
+ return typography(''.join(c['text'] for c in chars)).strip()
+
+
+def token(chars):
+ """Rebuild an identifier part: rules drawn for underscores leave wide gaps, kerning leaves none."""
+ letters = [c for c in chars if c['x0'] is not None and not c['text'].isspace()]
+ out = []
+
+ for i, c in enumerate(letters):
+ if i and c['x0'] - letters[i - 1]['x1'] > UNDERSCORE_GAP * c['size'] / 10.0:
+ out.append('_')
+ out.append(c['text'])
+
+ return typography(''.join(out)).strip()
+
+
+def split_label(chars):
+ """Split a line that starts with bold text up to a colon into (bold chars, rest text), else None."""
+ bold = []
+
+ for i, c in enumerate(chars):
+ if c['bold']:
+ bold.append(c)
+ continue
+
+ rest = plain(chars[i:])
+
+ if rest.startswith(':') and bold:
+ return bold, rest[1:].strip()
+
+ return None
+
+ return None
+
+
+def join(parts, words):
+ """Join wrapped lines, repairing words hyphenated at a line break.
+
+ The hyphen is dropped when the whole word occurs in the guide, or when neither half occurs
+ anywhere else (as in "Regen-erating"); otherwise it is kept ("non-routed").
+ """
+ text = ''
+
+ for part in parts:
+ part = part.strip()
+
+ if not part:
+ continue
+
+ match = re.search(r'([A-Za-z]+)-$', text)
+ first = re.match(r'[A-Za-z]+', part)
+
+ if match and first:
+ head, tail = match.group(1).lower(), first.group(0).lower()
+
+ if words[head + tail] or (words[head] < 2 and words[tail] < 2):
+ text = text[:-1] + part
+ else:
+ text += part
+ else:
+ text = (text + ' ' + part) if text else part
+
+ return collector.clean(text)
+
+
+def parse(path, limit, reference):
+ entries, words, facility, current, field = [], collections.Counter(), None, None, None
+ release = ''
+
+ for page, chars in lines(path, limit):
+ text = plain(chars)
+
+ if page == 1 and not release:
+ match = RELEASE.search(text)
+ release = match.group(1) if match else ''
+
+ size = max(c['size'] for c in chars)
+
+ if all(c['slant'] or c['text'].isspace() for c in chars) or text == 'EOS User Manual' or text.isdigit():
+ continue
+
+ words.update(w.lower() for w in re.findall(r'[A-Za-z]+', text))
+
+ if size > 12:
+ match = SECTION.match(text)
+
+ if match:
+ facility = match.group(1).upper()
+ current, field = None, None
+ continue
+
+ label = split_label(chars)
+
+ if label:
+ name = plain(label[0]).lower()
+
+ if name in LABELS and current is not None:
+ field = LABELS[name]
+ current[field] = [label[1]]
+ continue
+
+ if name not in LABELS and facility:
+ current = {'facility': facility, 'mnemonic': token(label[0]), 'message': [label[1]],
+ 'severity': [], 'explanation': [], 'recommended_action': []}
+ entries.append(current)
+ field = 'message'
+ continue
+
+ if current is not None and field:
+ current[field].append(text)
+
+ records = []
+
+ for entry in entries:
+ severity = collector.severity(join(entry['severity'], words))
+ records.append({
+ 'identifier': '%%%s-%s-%s' % (entry['facility'], '' if severity is None else severity, entry['mnemonic']),
+ 'component': entry['facility'],
+ 'severity': severity,
+ 'message': join(entry['message'], words),
+ 'explanation': join(entry['explanation'], words),
+ 'recommended_action': join(entry['recommended_action'], words),
+ 'reference': reference,
+ })
+
+ return records, release
+
+
+def main():
+ args = collector.arguments(__doc__.splitlines()[0], extra)
+ records, releases = [], []
+
+ for path in args.pdf:
+ found, release = parse(collector.local_path(path), args.limit, args.reference)
+ missing = sum(1 for r in found if r['severity'] is None)
+ sys.stderr.write('arista: %d messages in %s (release %s)%s\n' % (
+ len(found), path, release or 'unknown', ', %d without a severity skipped' % missing if missing else ''))
+ records.extend(r for r in found if r['severity'] is not None)
+
+ if release and release not in releases:
+ releases.append(release)
+
+ if not records:
+ sys.stderr.write('arista: no messages found; is this the EOS System Message Guide?\n')
+ return 1
+
+ source = 'Arista EOS System Message Guide%s, from a copy supplied by the user' % (
+ ' (EOS %s)' % ', '.join(releases) if releases else '')
+ collector.write('arista', 'Arista', records, args.output, source)
+
+ return 0
+
+
+if __name__ == '__main__':
+ sys.exit(main())
diff --git a/contrib/recommendations/vendors/collect_cisco.py b/contrib/recommendations/vendors/collect_cisco.py
new file mode 100755
index 00000000..e2b1b49f
--- /dev/null
+++ b/contrib/recommendations/vendors/collect_cisco.py
@@ -0,0 +1,202 @@
+#!/usr/bin/env python3
+# +-------------------------------------------------------------------------+
+# | Copyright (C) 2004-2026 The Cacti Group |
+# | |
+# | This program is free software; you can redistribute it and/or |
+# | modify it under the terms of the GNU General Public License |
+# | as published by the Free Software Foundation; either version 2 |
+# | of the License, or (at your option) any later version. |
+# | |
+# | This program is distributed in the hope that it will be useful, |
+# | but WITHOUT ANY WARRANTY; without even the implied warranty of |
+# | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
+# | GNU General Public License for more details. |
+# +-------------------------------------------------------------------------+
+"""Build a Cisco recommendation catalogue from the Cisco Error Message Database (CEMDB) dump.
+
+Source: the CEMDB table that php-syslog-ng (the predecessor of LogZilla) shipped for
+its "Cisco Error Message" lookup, as kept in the php-syslog-ng repository on GitHub:
+
+ https://github.com/daedalus/php-syslog-ng (repository licence shown: GPL-2.0)
+ file html/install/sql/cemdb.sql.gz, commit b9dc7ea3ed655abdfe21cbedafa3709b3039e944
+ (30,968 INSERT rows, collected by php-syslog-ng from Cisco's message guides in 2007)
+
+The same table is also in https://github.com/OpenAai/php-syslog-ng as the uncompressed
+www/html/install/sql/cemdb.sql (byte-identical once decompressed); download it and pass
+the local copy (.sql or .sql.gz) with --file. The message texts themselves are
+Cisco's documentation and remain subject to Cisco's terms whatever the repository licence.
+
+Each row is (id, name, message, explanation, action, datetime). The name, for example
+"%LINK-3-UPDOWN:", becomes the identifier without the trailing colon (and without any text that
+follows that colon), exactly as it appears in syslog: "%LINK-3-UPDOWN". The component is the facility
+(LINK, or ROUTING-CLNS for "%ROUTING-CLNS-3-...") and the severity is the number in the identifier
+(0-7); names without a numeric severity (for example "%PIX-n-106100") get neither. HTML in the texts
+is reduced to plain text: "
" becomes a space, while paragraphs and list items keep their own
+lines. Where the table has several rows for one identifier (the same text with and without line
+breaks, or different platforms' wording) the row with the longest explanation and action is kept.
+
+Known gaps: the data dates from 2007 (IOS 12.x, CatOS, PIX/ASA 7.x, MDS SAN-OS), so newer
+messages are missing and some may have changed. Records carry no reference URL. Identifiers are
+kept as published, so about 860 of them (e.g. "%PIX|ASA-...", "%FCDD-SLOT#-...") cannot be matched
+by the plugin's lookup tokenizer, and identifiers that differ only in case are merged.
+--limit stops after that many table rows.
+
+Usage:
+ contrib/recommendations/vendors/collect_cisco.py -o /some/dir/cisco.json.gz
+ contrib/recommendations/vendors/collect_cisco.py -o /some/dir/cisco.json.gz --file cemdb.sql.gz
+"""
+
+import gzip
+import html
+import os
+import re
+import sys
+
+sys.path.insert(0, os.path.dirname(os.path.abspath(__file__)))
+
+import collector # noqa: E402
+
+REPOSITORY = 'https://github.com/daedalus/php-syslog-ng'
+COMMIT = 'b9dc7ea3ed655abdfe21cbedafa3709b3039e944'
+PATH = 'html/install/sql/cemdb.sql.gz'
+URL = 'https://raw.githubusercontent.com/daedalus/php-syslog-ng/%s/%s' % (COMMIT, PATH)
+
+INSERT = re.compile(r"^\s*INSERT\s+(?:IGNORE\s+)?INTO\s+`?cemdb`?\s+VALUES\s*\(", re.I)
+NAME = re.compile(r'^%(.+?)-([0-7])-([A-Za-z0-9_-]+)$')
+CUT = re.compile(r'^(%.+?-[0-7]-[^:\s]+):')
+BREAK = re.compile(r'
', re.I)
+PARAGRAPH_BREAK = re.compile(r'(?:
\s*){2,}', re.I)
+LIST_BREAK = re.compile(r'
\s*(?=(?:-|\d+[.)])\s)', re.I)
+PARAGRAPH = re.compile(r'(?:p|div|ul|ol)\s*>', re.I)
+ITEM = re.compile(r']*>', re.I)
+# Only real HTML tags are removed: message texts also use -style placeholders.
+TAG = re.compile(r'?(?:a|b|i|u|em|strong|font|span|p|div|ul|ol|li|sup|sub|tt|code|pre|center)\b[^>]*>', re.I)
+ESCAPES = {'0': '\0', 'b': '\b', 'n': '\n', 'r': '\r', 't': '\t', 'Z': '\x1a'}
+
+
+def extra(parser):
+ parser.add_argument('--file', help='read a local copy of the CEMDB SQL dump (.sql or .sql.gz) instead of downloading')
+
+
+def values(line):
+ """Return the fields of one "INSERT ... VALUES (...);" row, or None if the line is not one."""
+ match = INSERT.match(line)
+
+ if not match:
+ return None
+
+ fields, i, n = [], match.end(), len(line)
+
+ while i < n:
+ while i < n and line[i] in ' \t,':
+ i += 1
+
+ if i >= n or line[i] == ')':
+ break
+
+ if line[i] == "'":
+ i += 1
+ text = []
+
+ while i < n:
+ c = line[i]
+
+ if c == '\\' and i + 1 < n:
+ text.append(ESCAPES.get(line[i + 1], line[i + 1]))
+ i += 2
+ elif c == "'" and i + 1 < n and line[i + 1] == "'":
+ text.append("'")
+ i += 2
+ elif c == "'":
+ i += 1
+ break
+ else:
+ text.append(c)
+ i += 1
+ fields.append(''.join(text))
+ else:
+ start = i
+
+ while i < n and line[i] not in ',)':
+ i += 1
+ fields.append(line[start:i].strip())
+
+ return fields
+
+
+def text(value):
+ """Turn a CEMDB field into plain text, keeping list items and paragraphs on their own lines."""
+ value = PARAGRAPH_BREAK.sub('\n\n', value or '')
+ value = LIST_BREAK.sub('\n', value)
+ value = BREAK.sub(' ', value)
+ value = PARAGRAPH.sub('\n', value)
+ value = ITEM.sub('\0', value)
+ value = html.unescape(TAG.sub('', value))
+ lines = [' '.join(line.split()) for line in value.split('\n')]
+ value = re.sub(r'\s*\0\s*', '\n- ', '\n'.join(lines))
+
+ return re.sub(r'\n{3,}', '\n\n', value).strip()
+
+
+def main():
+ args = collector.arguments(__doc__.splitlines()[0], extra)
+
+ if args.file:
+ with open(collector.local_path(args.file), 'rb') as fh:
+ data = fh.read()
+ reference = os.path.basename(args.file)
+ else:
+ data = collector.fetcher(args, 'cisco').get(URL, binary=True)
+ reference = URL
+
+ if data[:2] == b'\x1f\x8b':
+ data = gzip.decompress(data)
+
+ rows, best = 0, {}
+
+ for line in data.decode('utf-8', errors='replace').splitlines():
+ fields = values(line)
+
+ if not fields or len(fields) < 5:
+ continue
+
+ rows += 1
+ name = collector.clean(fields[1])
+ cut = CUT.match(name)
+ identifier = cut.group(1) if cut else name.rstrip(':')
+ match = NAME.match(identifier)
+ record = {
+ 'identifier': identifier,
+ 'component': match.group(1) if match else '',
+ 'severity': int(match.group(2)) if match else None,
+ 'message': text(fields[2]),
+ 'explanation': text(fields[3]),
+ 'recommended_action': text(fields[4]),
+ 'reference': '',
+ }
+ size = len(record['explanation']) + len(record['recommended_action'])
+ key = identifier.lower()
+
+ # Keep the fullest of the rows for one identifier (the first of equally long ones).
+ if key not in best or size > best[key][0]:
+ best[key] = (size, record)
+
+ if args.limit and rows >= args.limit:
+ break
+
+ records = [record for size, record in best.values()]
+
+ sys.stderr.write('cisco: %d CEMDB rows read from %s\n' % (rows, reference))
+
+ if not rows:
+ sys.stderr.write('cisco: no "INSERT INTO cemdb" rows found; is this the CEMDB SQL dump?\n')
+ return 1
+
+ source = 'Cisco Error Message Database (CEMDB), as distributed with php-syslog-ng (%s)' % reference
+ collector.write('cisco', 'Cisco', records, args.output, source)
+
+ return 0
+
+
+if __name__ == '__main__':
+ sys.exit(main())
diff --git a/contrib/recommendations/vendors/collect_dell.py b/contrib/recommendations/vendors/collect_dell.py
new file mode 100755
index 00000000..13db72de
--- /dev/null
+++ b/contrib/recommendations/vendors/collect_dell.py
@@ -0,0 +1,558 @@
+#!/usr/bin/env python3
+# +-------------------------------------------------------------------------+
+# | Copyright (C) 2004-2026 The Cacti Group |
+# | |
+# | This program is free software; you can redistribute it and/or |
+# | modify it under the terms of the GNU General Public License |
+# | as published by the Free Software Foundation; either version 2 |
+# | of the License, or (at your option) any later version. |
+# | |
+# | This program is distributed in the hope that it will be useful, |
+# | but WITHOUT ANY WARRANTY; without even the implied warranty of |
+# | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
+# | GNU General Public License for more details. |
+# +-------------------------------------------------------------------------+
+"""Build a Dell recommendation catalogue from the PowerEdge EEMI guide and the OS10 System Log Message Reference.
+
+Sources:
+
+- PowerEdge Servers Error and Event Messages Reference Guide (EEMI), iDRAC9 /
+ Lifecycle Controller v6.x, PDF:
+ https://dl.dell.com/content/manual64973867-poweredge-servers-error-and-event-messages-reference-guide.pdf
+ (web version: https://www.dell.com/support/manuals/en-us/idrac9-lifecycle-controller-v6.x-series/error_event_message_guide/Getting-help)
+- Dell SmartFabric OS10 System Log Message Reference, PDF:
+ https://dl.dell.com/content/manual23434279-dell-smartfabric-os10-system-log-message-reference.pdf
+ (web version: https://www.dell.com/support/manuals/en-us/smartfabric-os10-emp-partner/os10-syslog-reference-guide/view-system-logs)
+
+Getting the documents: dl.dell.com's robots.txt only admits robots to /manuals
+and /topicspdf, and www.dell.com/support/manuals answers scripts with 403, so the
+collector cannot download either guide itself. It tries (robots.txt is checked
+first) and, when refused, asks for the files. Download the two PDFs above with a
+browser and pass them with --pdf and --os10-pdf, or put them (and/or OS10 topic
+pages saved from www.dell.com with "Save Page As", .html) into a directory and
+pass --from DIR. PDFs are recognised by their title, whatever their file name.
+
+Identifiers:
+
+- EEMI: the MessageID, as iDRAC sends it in its remote syslog messages
+ ("... MessageID: PSU0003, Message: ..." gives PSU0003). Only MessageIDs whose
+ applicable alert types include Remote System Log are kept; if an ID appears
+ more than once, the first occurrence wins. Severity: Critical 2, Warning 4,
+ Informational 6. The explanation is the Detailed Description and the action the
+ Recommended Response Action; IDs without a description keep only the action.
+ The reference is the PDF URL with the page number (#page=N).
+- OS10: %EVENT_NAME ("%log-alert:EQM_MORE_PSU_FAULT: ..." -> %EQM_MORE_PSU_FAULT;
+ the plugin also tries the bare form). For INFRA_AFS sub-events the second token
+ is used, without the % (%INFRA_AFS:MAC_LEARN_LIMIT_VIOLATION: ... gives
+ MAC_LEARN_LIMIT_VIOLATION); event names given without message text (VRRP_STATE)
+ use the name as the message.
+ Rows sharing an event name are merged: message variants joined with " | ",
+ distinct descriptions and actions concatenated, worst severity kept. Severity:
+ CRITICAL 2, ERROR 3, WARNING 4, INFORMATIONAL 5 (OS10 sends informational
+ events as %log-notice). Rows without an event name (CLI errors, alarm text)
+ are skipped.
+
+Known gaps: Networking OS9 has no public message reference (the old catalogue
+had 4 records taken from a configuration guide); it is not collected. PowerSwitch
+N-series (OS6) messages have no stable identifiers and are not collected. Saved
+OS10 HTML pages are parsed generically (4-column tables: message, severity,
+description, action) because the live pages cannot be fetched by scripts.
+Extracting text from the ~3,900-page EEMI PDF takes about 5 minutes; the text is
+cached under --cache, so later runs are fast.
+
+Usage:
+ contrib/recommendations/vendors/collect_dell.py -o /some/dir/dell.json.gz \\
+ --pdf ~/Downloads/manual64973867-...-reference-guide.pdf \\
+ --os10-pdf ~/Downloads/manual23434279-dell-smartfabric-os10-system-log-message-reference.pdf
+ contrib/recommendations/vendors/collect_dell.py -o /some/dir/dell.json.gz --from ~/Downloads/dell-docs
+"""
+
+import hashlib
+import html
+import html.parser
+import json
+import os
+import re
+import sys
+
+sys.path.insert(0, os.path.dirname(os.path.abspath(__file__)))
+
+import collector # noqa: E402
+
+EEMI_URL = 'https://dl.dell.com/content/manual64973867-poweredge-servers-error-and-event-messages-reference-guide.pdf'
+OS10_URL = 'https://dl.dell.com/content/manual23434279-dell-smartfabric-os10-system-log-message-reference.pdf'
+OS10_WEB = 'https://www.dell.com/support/manuals/en-us/smartfabric-os10-emp-partner/os10-syslog-reference-guide/view-system-logs'
+
+EEMI_SEVERITY = {'critical': 2, 'warning': 4, 'informational': 6, 'information': 6}
+OS10_SEVERITY = {'CRITICAL': 2, 'ERROR': 3, 'MAJOR': 3, 'WARNING': 4, 'MINOR': 4, 'NOTICE': 5, 'INFORMATIONAL': 5,
+ 'INFO': 5}
+
+EEMI_LABELS = ['NOTE:', 'Message', 'Arguments', 'Detailed Description', 'Recommended Response Action', 'Category',
+ 'Severity', 'Trap/EventID', 'LCD Message', 'Redfish Event Type', 'Applicable Event or Alert Types']
+EEMI_ID = re.compile(r'^([A-Z][A-Z0-9]*?)(\d{1,4})$')
+
+
+def extra(parser):
+ parser.add_argument('--pdf', help='EEMI guide PDF downloaded with a browser (see the module docstring)')
+ parser.add_argument('--os10-pdf', help='OS10 System Log Message Reference PDF downloaded with a browser')
+ parser.add_argument('--from', dest='source_dir',
+ help='directory with the PDFs and/or OS10 topic pages (.html) saved from a browser')
+
+
+# --- PDF text -------------------------------------------------------------------------------------------------------
+
+def pdf_pages(path, cache_dir, limit):
+ """Return the text of each page (pypdf), cached by the file's SHA-256."""
+ path = collector.local_path(path)
+ cache_dir = collector.local_path(cache_dir)
+
+ with open(path, 'rb') as fh:
+ digest = hashlib.sha256(fh.read()).hexdigest()
+
+ cached = os.path.join(cache_dir, 'pdf-%s.json' % digest)
+
+ if os.path.exists(cached):
+ with open(cached, encoding='utf-8') as fh:
+ pages = json.load(fh)
+ return pages[:limit] if limit else pages
+
+ import pypdf
+
+ reader = pypdf.PdfReader(path)
+ count = len(reader.pages)
+ pages = []
+
+ for number in range(min(count, limit) if limit else count):
+ pages.append(reader.pages[number].extract_text() or '')
+
+ if number and number % 250 == 0:
+ sys.stderr.write('dell: %s: %d/%d pages\n' % (os.path.basename(path), number, count))
+
+ if not limit:
+ os.makedirs(cache_dir, exist_ok=True)
+ with open(cached, 'w', encoding='utf-8') as fh:
+ json.dump(pages, fh)
+
+ return pages
+
+
+def pdf_title(path):
+ import pypdf
+
+ try:
+ reader = pypdf.PdfReader(path)
+ title = (reader.metadata or {}).get('/Title') or ''
+
+ if not title and reader.pages:
+ title = reader.pages[0].extract_text() or ''
+ except Exception as e: # noqa: BLE001 - report unreadable files, keep going
+ sys.stderr.write('dell: cannot read %s: %s\n' % (path, e))
+ return ''
+
+ return collector.clean(title)
+
+
+# --- EEMI -----------------------------------------------------------------------------------------------------------
+
+def eemi_records(pages, url):
+ lines = []
+
+ for number, text in enumerate(pages, 1):
+ page_lines = [line.rstrip() for line in text.splitlines()]
+
+ while page_lines and not page_lines[-1].strip():
+ page_lines.pop()
+
+ # Running footer: " " or " ".
+ if page_lines and re.match(r'^(%d\s.+|.+\s%d)$' % (number, number), page_lines[-1].strip()):
+ page_lines.pop()
+
+ lines.extend((number, line) for line in page_lines)
+
+ starts = []
+
+ for index, (number, line) in enumerate(lines):
+ if EEMI_ID.match(line.strip()):
+ following = ' '.join(text for _, text in lines[index + 1:index + 6])
+
+ if 'Message ' in following and ('NOTE:' in following or following.lstrip().startswith('Message')):
+ starts.append(index)
+
+ records = []
+
+ for position, start in enumerate(starts):
+ end = starts[position + 1] if position + 1 < len(starts) else len(lines)
+ identifier = lines[start][1].strip()
+ fields = eemi_fields([text for _, text in lines[start + 1:end]])
+ alerts = ' '.join(fields.get('Applicable Event or Alert Types', []))
+
+ if 'Remote System Log' not in alerts:
+ continue
+
+ message = re.sub(r'\barg(\d+)\b', r'[arg\1]', collector.clean(' '.join(fields.get('Message', []))))
+ message = re.sub(r'\[arg(\d+)\] ([.,;:)])', r'[arg\1]\2', message)
+ description = collector.clean(' '.join(fields.get('Detailed Description', [])))
+ action = collector.clean(' '.join(fields.get('Recommended Response Action', [])))
+ severity = collector.clean(' '.join(fields.get('Severity', []))).lower()
+
+ records.append({
+ 'identifier': identifier,
+ 'component': EEMI_ID.match(identifier).group(1),
+ 'severity': EEMI_SEVERITY.get(severity.split(' ')[0] if severity else ''),
+ 'message': message,
+ 'explanation': description,
+ 'recommended_action': action,
+ 'reference': '%s#page=%d' % (url, lines[start][0]),
+ })
+
+ return records
+
+
+def eemi_fields(lines):
+ """Split a message's lines into its labelled fields; labels must appear in guide order."""
+ text = '\n'.join(lines)
+ text = re.sub(r'(?m)^Recommended\s*\n\s*Response Action', 'Recommended Response Action', text)
+ text = re.sub(r'(?m)^Applicable Event or\s*\n\s*Alert Types', 'Applicable Event or Alert Types', text)
+ text = re.sub(r'(?m)^Detailed\s*\n\s*Description', 'Detailed Description', text)
+
+ fields, current, order = {}, None, -1
+
+ for line in text.split('\n'):
+ stripped = line.strip()
+ matched = None
+
+ for rank, label in enumerate(EEMI_LABELS):
+ if (stripped == label or stripped.startswith(label + ' ')) and \
+ (rank > order or (label == 'Applicable Event or Alert Types' and rank == order)):
+ # "Message" also starts "LCD Message"-free lines such as "Message ID"; require the order.
+ matched = (rank, label)
+ break
+
+ if matched:
+ order, current = matched
+ fields.setdefault(current, []).append(stripped[len(current):].strip())
+ elif current:
+ fields[current].append(stripped)
+
+ return fields
+
+
+# --- OS10 -----------------------------------------------------------------------------------------------------------
+
+def os10_pdf_rows(path, limit):
+ """Yield (page, [col1, severity, description, action]) table rows of the OS10 PDF, by character position."""
+ from pdfminer.high_level import extract_pages
+ from pdfminer.layout import LAParams, LTAnno, LTChar, LTTextLine
+
+ row = None
+
+ for number, page in enumerate(extract_pages(path, laparams=LAParams()), 1):
+ if limit and number > limit:
+ break
+
+ lines = []
+
+ def walk(node):
+ for child in node:
+ if isinstance(child, LTTextLine):
+ lines.append(child)
+ elif hasattr(child, '__iter__'):
+ walk(child)
+
+ walk(page)
+ lines.sort(key=lambda line: (page.height - line.y1, line.x0))
+
+ # Cells of one table line can sit a fraction of a point apart, so group lines by baseline first.
+ groups = []
+
+ for line in lines:
+ top = page.height - line.y1
+
+ if groups and top - groups[-1][0] < 3:
+ groups[-1][1].append(line)
+ else:
+ groups.append((top, [line]))
+
+ # Each page repeats the table header, so the columns are measured again per page.
+ columns = None
+
+ for top, group in groups:
+ group.sort(key=lambda line: line.x0)
+ texts = [line.get_text().strip() for line in group]
+
+ if top > page.height - 50 or top < 50:
+ continue
+
+ if re.match(r'^Table \d+\.', texts[0]):
+ if row and 'continued' not in texts[0].lower():
+ yield row
+ row = None
+ continue
+
+ if texts[0].lower() == 'system log message':
+ columns = [line.x0 for line in group]
+ continue
+
+ if columns is None or len(columns) != 4 or texts == ['action']:
+ continue
+
+ if group[0].x0 < columns[0] - 1.5:
+ if row:
+ yield row
+ row = None
+ columns = None
+ continue
+
+ cells = ['', '', '', '']
+
+ for line in group:
+ cell = 0
+
+ for child in line:
+ if isinstance(child, LTChar):
+ cell = sum(1 for x in columns[1:] if child.x0 >= x - 2)
+ cells[cell] += child.get_text()
+ elif isinstance(child, LTAnno):
+ cells[cell] += child.get_text()
+
+ cells = [collector.clean(c) for c in cells]
+ level = cells[1].split(' ')[0] if cells[1] else ''
+
+ if level in OS10_SEVERITY:
+ if row:
+ yield row
+ row = (number, [[c] if c else [] for c in cells])
+ elif row:
+ for index, value in enumerate(cells):
+ if value:
+ row[1][index].append(value)
+
+ if row:
+ yield row
+
+class TableParser(html.parser.HTMLParser):
+ """Collect the rows of every table in a saved HTML page, plus the page URL."""
+
+ def __init__(self):
+ super().__init__(convert_charrefs=True)
+ self.rows, self.row, self.cell, self.url, self.skip = [], None, None, '', 0
+
+ def handle_starttag(self, tag, attrs):
+ attrs = dict(attrs)
+
+ if tag in ('script', 'style'):
+ self.skip += 1
+ elif tag == 'tr':
+ self.row = []
+ elif tag in ('td', 'th') and self.row is not None:
+ self.cell = []
+ elif tag in ('br', 'p', 'li', 'div') and self.cell is not None:
+ self.cell.append('\n')
+ elif tag == 'link' and (attrs.get('rel') or '').lower() == 'canonical' and attrs.get('href'):
+ self.url = self.url or attrs['href']
+ elif tag == 'meta' and attrs.get('property') == 'og:url' and attrs.get('content'):
+ self.url = self.url or attrs['content']
+
+ def handle_endtag(self, tag):
+ if tag in ('script', 'style'):
+ self.skip = max(0, self.skip - 1)
+ elif tag in ('td', 'th') and self.cell is not None and self.row is not None:
+ self.row.append(''.join(self.cell))
+ self.cell = None
+ elif tag == 'tr' and self.row is not None:
+ self.rows.append(self.row)
+ self.row = None
+
+ def handle_data(self, data):
+ if self.cell is not None and not self.skip:
+ self.cell.append(data)
+
+ def handle_comment(self, data):
+ match = re.search(r'saved from url=\(\d+\)(\S+)', data)
+
+ if match:
+ self.url = self.url or match.group(1)
+
+
+def os10_html_rows(path):
+ with open(path, encoding='utf-8', errors='replace') as fh:
+ parser = TableParser()
+ parser.feed(fh.read())
+
+ rows = []
+
+ for cells in parser.rows:
+ if len(cells) == 4 and cells[1].strip().split(' ')[0].upper() in OS10_SEVERITY:
+ rows.append([[line for line in (c.strip() for c in cell.split('\n')) if line] for cell in cells])
+
+ return parser.url or OS10_WEB, rows
+
+
+def join_lines(lines, name_zone=False):
+ """Join wrapped cell lines: hyphenated breaks and broken event names are joined without a space."""
+ text = ''
+
+ for line in lines:
+ line = line.strip()
+
+ if not text:
+ text = line
+ elif text.endswith('-') and not text.endswith(' -'):
+ text += line
+ elif name_zone and ' ' not in text and re.match(r'[A-Z0-9_-]$', text[-1]) and re.match(r'^[A-Z0-9_-]* ?:', line):
+ text += line
+ else:
+ text += ' ' + line
+
+ return collector.clean(text)
+
+
+def os10_records(rows):
+ """rows: (reference, [col1 lines, severity lines, description lines, action lines]); merge by event name."""
+ merged, order = {}, []
+
+ for reference, cells in rows:
+ first = join_lines(cells[0], name_zone=True)
+ match = re.match(r'^([A-Z][A-Z0-9_-]*[A-Z0-9_])(?:\s*:\s*(.*))?$', first)
+
+ if not match:
+ continue
+
+ name, message = match.group(1), match.group(2) if match.group(2) is not None else match.group(1)
+ prefix = '%'
+
+ # INFRA_AFS sub-events follow "%INFRA_AFS:", so the syslog line carries them as a bare word.
+ if name == 'INFRA_AFS':
+ sub = re.match(r'^([A-Z][A-Z0-9_-]*[A-Z0-9_])\s*:\s*(.*)$', message)
+
+ if not sub:
+ continue
+ name, message, prefix = sub.group(1), sub.group(2), ''
+ elif message.startswith('INFRA_AFS:'):
+ prefix = ''
+
+ message = re.sub(r'<\s*([^<>]*?)\s*>', r'[\1]', message)
+ level = join_lines(cells[1]).split(' ')[0].upper()
+ description = join_lines(cells[2])
+ action = join_lines(cells[3])
+
+ if name not in merged:
+ order.append(name)
+ merged[name] = {'identifier': prefix + name, 'component': re.split(r'[_-]', name)[0], 'severity': None,
+ 'messages': [], 'explanations': [], 'actions': [], 'reference': reference}
+ record = merged[name]
+
+ for key, value in (('messages', message), ('explanations', description), ('actions', action)):
+ if value and value not in record[key]:
+ record[key].append(value)
+
+ severity = OS10_SEVERITY.get(level)
+
+ if severity is not None and (record['severity'] is None or severity < record['severity']):
+ record['severity'] = severity
+
+ records = []
+
+ for name in order:
+ record = merged[name]
+ records.append({
+ 'identifier': record['identifier'], 'component': record['component'], 'severity': record['severity'],
+ 'message': ' | '.join(record['messages']), 'explanation': ' '.join(record['explanations']),
+ 'recommended_action': ' '.join(record['actions']), 'reference': record['reference'],
+ })
+
+ return records
+
+
+# --- main -----------------------------------------------------------------------------------------------------------
+
+def fetch_pdf(fetch, url, cache_dir, name):
+ """Try to download a guide; return a local path, or None when the site refuses scripts."""
+ try:
+ body = fetch.get(url, binary=True)
+ except PermissionError as e:
+ sys.stderr.write('dell: %s\n' % e)
+ return None
+ except Exception as e: # noqa: BLE001 - HTTP 403 and similar
+ sys.stderr.write('dell: cannot download %s: %s\n' % (url, e))
+ return None
+
+ path = collector.local_path(os.path.join(cache_dir, name))
+
+ with open(path, 'wb') as fh:
+ fh.write(body)
+
+ return path
+
+
+def main():
+ args = collector.arguments(__doc__.splitlines()[0], extra)
+ cache_dir = collector.local_path(os.path.join(args.cache, 'dell'))
+ os.makedirs(cache_dir, exist_ok=True)
+ eemi_pdf, os10_pdf, html_pages = args.pdf, args.os10_pdf, []
+
+ if args.source_dir:
+ for root, _, files in os.walk(collector.local_path(args.source_dir)):
+ for name in sorted(files):
+ path = os.path.join(root, name)
+
+ if name.lower().endswith('.pdf'):
+ title = pdf_title(path).lower()
+
+ if 'error and event messages' in title and not eemi_pdf:
+ eemi_pdf = path
+ elif 'system log message reference' in title and not os10_pdf:
+ os10_pdf = path
+ else:
+ sys.stderr.write('dell: ignoring %s (not the EEMI or OS10 log reference)\n' % path)
+ elif name.lower().endswith(('.html', '.htm')):
+ html_pages.append(path)
+
+ if not (eemi_pdf or os10_pdf or html_pages):
+ fetch = collector.fetcher(args, 'dell')
+ eemi_pdf = fetch_pdf(fetch, EEMI_URL, cache_dir, 'eemi.pdf')
+ os10_pdf = fetch_pdf(fetch, OS10_URL, cache_dir, 'os10.pdf')
+
+ if not (eemi_pdf or os10_pdf):
+ sys.stderr.write(
+ 'dell: Dell does not allow scripts to download these guides. Download them with a browser:\n'
+ ' %s\n %s\nand run again with --pdf FILE --os10-pdf FILE, or --from DIR.\n' % (EEMI_URL, OS10_URL))
+ return 2
+
+ records, sources = [], []
+
+ if eemi_pdf:
+ pages = pdf_pages(eemi_pdf, cache_dir, args.limit)
+ found = eemi_records(pages, EEMI_URL)
+ sys.stderr.write('dell: EEMI: %d pages, %d Remote System Log messages\n' % (len(pages), len(found)))
+ records.extend(found)
+ sources.append('Dell PowerEdge Servers Error and Event Messages Reference Guide (%s)' % EEMI_URL)
+
+ rows = []
+
+ if os10_pdf:
+ for number, cells in os10_pdf_rows(os10_pdf, args.limit):
+ rows.append(('%s#page=%d' % (OS10_URL, number), cells))
+ sources.append('Dell SmartFabric OS10 System Log Message Reference (%s)' % OS10_URL)
+
+ for count, path in enumerate(sorted(html_pages)):
+ if args.limit and count >= args.limit:
+ break
+ url, page_rows = os10_html_rows(path)
+ rows.extend((url, cells) for cells in page_rows)
+
+ if html_pages and not os10_pdf:
+ sources.append('Dell SmartFabric OS10 System Log Message Reference (%s)' % OS10_WEB)
+
+ if rows:
+ found = os10_records(rows)
+ sys.stderr.write('dell: OS10: %d table rows, %d event names\n' % (len(rows), len(found)))
+ records.extend(found)
+
+ collector.write('dell', 'Dell', records, args.output, '; '.join(sources))
+
+ return 0
+
+
+if __name__ == '__main__':
+ sys.exit(main())
diff --git a/contrib/recommendations/vendors/collect_fortinet.py b/contrib/recommendations/vendors/collect_fortinet.py
new file mode 100755
index 00000000..a5ee3c43
--- /dev/null
+++ b/contrib/recommendations/vendors/collect_fortinet.py
@@ -0,0 +1,239 @@
+#!/usr/bin/env python3
+# +-------------------------------------------------------------------------+
+# | Copyright (C) 2004-2026 The Cacti Group |
+# | |
+# | This program is free software; you can redistribute it and/or |
+# | modify it under the terms of the GNU General Public License |
+# | as published by the Free Software Foundation; either version 2 |
+# | of the License, or (at your option) any later version. |
+# | |
+# | This program is distributed in the hope that it will be useful, |
+# | but WITHOUT ANY WARRANTY; without even the implied warranty of |
+# | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
+# | GNU General Public License for more details. |
+# +-------------------------------------------------------------------------+
+"""Build a Fortinet recommendation catalogue from the FortiOS Log Message Reference.
+
+Source: "FortiOS Log Message Reference" for the FortiOS release given with
+--version (default 7.6.8), one page per log message:
+https://docs.fortinet.com/document/fortigate/7.6.8/fortios-log-message-reference
+The type and subtype codes come from its "Log ID definitions" page
+(.../656858/log-id-definitions), which also lists every message page.
+
+Two ways to read the messages:
+- default: fetch every message page (about 1,460 pages). docs.fortinet.com asks
+ for a 2 second crawl delay, which is honoured, so a full run takes about an
+ hour and 10 minutes and the page cache grows to about 1.3 GB.
+- --pdf FILE: read the "Download PDF" version of the reference (for 7.6.8,
+ FortiOS_7.6.8_Log_Reference.pdf, about 9 MB), saved with your own browser
+ from the reference's "Download PDF" link. The PDF is served from Amazon S3,
+ whose robots.txt cannot be read, so the collector does not download it
+ itself. Only the Log ID definitions page is fetched in this mode; the run
+ takes about two minutes, mostly PDF text extraction.
+
+Identifier: the 10-digit logid with leading zeros: 2-digit log type + 2-digit
+subtype (the UTM eventtype) + 6-digit message ID, as described on the "Log ID
+numbers" page. In '... logid="0100032001" type="event" subtype="system" ...'
+the identifier is 0100032001.
+
+Severity: the documented level: Emergency 0, Alert 1, Critical 2, Error 3,
+Warning 4, Notice 5, Information 6, Debug 7.
+
+Records: message is the documented Message Meaning (the logdesc value);
+explanation is generated from the type/subtype, logid, message ID name, meaning
+and level; recommended_action is always empty because the reference documents
+no operator actions.
+
+Known gaps: the reference does not print the 10-digit IDs; they are derived
+from the documented codes. Fortinet notes that the level of a log ID is not
+always uniform. Bare numeric IDs can collide with other numbers in messages
+from other vendors, so rely on vendor scoping.
+
+Usage example:
+ contrib/recommendations/vendors/collect_fortinet.py -o /some/dir/fortinet.json.gz
+ contrib/recommendations/vendors/collect_fortinet.py --pdf ~/Downloads/FortiOS_7.6.8_Log_Reference.pdf \\
+ -o /some/dir/fortinet.json.gz
+"""
+
+import html
+import os
+import re
+import sys
+import urllib.parse
+
+sys.path.insert(0, os.path.dirname(os.path.abspath(__file__)))
+
+import collector # noqa: E402
+
+SITE = 'https://docs.fortinet.com'
+PATH = '/document/fortigate/%s/fortios-log-message-reference'
+
+FIELDS = ('Message ID', 'Message Description', 'Message Meaning', 'Type', 'Category', 'Severity')
+
+
+def extra(parser):
+ parser.add_argument('--version', default='7.6.8', help='FortiOS release of the reference (default: %(default)s)')
+ parser.add_argument('--pdf', metavar='FILE',
+ help='read the messages from the saved "Download PDF" file of the reference instead of '
+ 'fetching every message page')
+
+
+def text(fragment):
+ return collector.clean(html.unescape(re.sub(r'<[^>]+>', ' ', fragment)))
+
+
+def definitions(page):
+ """Return {type: (code, {subtype: code})} from the Log ID definitions table."""
+ codes = {}
+ body = page[page.find('Log Category IDs'):]
+ body = body[:body.find('')]
+
+ for row in re.findall(r']*>(.*?)
', body, re.S):
+ cells = re.findall(r']*>(.*?) | ', row, re.S)
+
+ if len(cells) != 2:
+ continue
+
+ category = re.match(r'([\w-]+):\s*(\d+)$', text(cells[0]))
+
+ if not category:
+ continue
+
+ subtypes = {}
+
+ for item in re.findall(r']*>(.*?)
', cells[1], re.S):
+ match = re.match(r'([\w-]+):\s*(\d+)$', text(item))
+
+ if match:
+ subtypes[match.group(1).lower()] = int(match.group(2))
+
+ codes[category.group(1).lower()] = (int(category.group(2)), subtypes)
+
+ return codes
+
+
+def html_message(page):
+ values = {}
+
+ for label, value in re.findall(r']*>\s*\s*([^<:]+?)\s*:\s*(.*?)
', page, re.S):
+ if label in FIELDS and label not in values:
+ values[label] = text(value)
+
+ return values
+
+
+def pdf_messages(path, version):
+ from pypdf import PdfReader
+
+ pages = []
+
+ for page in PdfReader(collector.local_path(path)).pages:
+ lines = (page.extract_text() or '').split('\n')
+
+ # Drop the running header ("Log Messages") and footer ("FortiOS x Log Reference n", "Fortinet Inc.").
+ if lines and lines[0].strip() == 'Log Messages':
+ lines = lines[1:]
+ while lines and (lines[-1].strip() == 'Fortinet Inc.' or re.match(r'FortiOS \S+ Log Reference \d+$', lines[-1].strip())
+ or not lines[-1].strip()):
+ lines = lines[:-1]
+ pages.append('\n'.join(lines))
+
+ body = '\n'.join(pages)
+ found = re.search(r'FortiOS (\S+) Log Reference', '\n'.join(pages[:3]))
+
+ if found and found.group(1) != version:
+ sys.stderr.write('fortinet: warning: the PDF is for FortiOS %s, not --version %s\n' % (found.group(1), version))
+
+ pattern = (r'Message ID:\s*(\d+)\s+Message Description:\s*(.+?)\s+Message Meaning:\s*(.+?)\s+'
+ r'Type:\s*(.+?)\s+Category:\s*(\S+)\s+Severity:\s*([A-Za-z]+)')
+
+ for match in re.finditer(pattern, body, re.S):
+ yield dict(zip(FIELDS, (collector.clean(value) for value in match.groups())))
+
+
+def record(values, codes, reference):
+ try:
+ number = int(values['Message ID'])
+ except (KeyError, ValueError):
+ return None
+
+ kind = values.get('Type', '').lower()
+ subtype = values.get('Category', '')
+
+ if kind not in codes or subtype.lower() not in codes[kind][1]:
+ sys.stderr.write('fortinet: skipping message %d: unknown type/subtype %s/%s\n' % (number, kind, subtype))
+ return None
+
+ logid = '%02d%02d%06d' % (codes[kind][0], codes[kind][1][subtype.lower()], number)
+ meaning = values.get('Message Meaning', '')
+ level = values.get('Severity', '')
+
+ if kind in ('traffic', 'event'):
+ component = '%s/%s' % (kind, subtype)
+ detail = 'message ID %d, %s' % (number, values.get('Message Description', ''))
+ else:
+ component = 'utm/%s' % kind
+ detail = 'eventtype %s, message ID %d, %s' % (subtype, number, values.get('Message Description', ''))
+
+ return {
+ 'identifier': logid,
+ 'component': component,
+ 'severity': collector.severity(level),
+ 'message': meaning,
+ 'explanation': 'FortiOS %s log %s (%s): %s. Documented level: %s.' % (component, logid, detail, meaning.rstrip('. '), level),
+ 'recommended_action': '',
+ 'reference': reference,
+ }
+
+
+def main():
+ args = collector.arguments(__doc__.splitlines()[0], extra)
+ fetch = collector.fetcher(args, 'fortinet')
+ base = SITE + PATH % args.version
+ start = base + '/656858/log-id-definitions'
+ page = fetch.get(start)
+ codes = definitions(page)
+
+ if not codes:
+ sys.stderr.write('fortinet: no log ID definitions found on %s\n' % start)
+ return 1
+
+ # Every page links all message pages: //-.
+ links = {}
+
+ for number, slug in re.findall(r'href="%s/(\d+)/(\1-[^"#?]+)"' % re.escape(PATH % args.version), page):
+ links.setdefault(int(number), '%s/%s/%s' % (base, number, slug))
+
+ records = []
+
+ if args.pdf:
+ for count, values in enumerate(pdf_messages(args.pdf, args.version)):
+ if args.limit and count >= args.limit:
+ break
+
+ number = int(values['Message ID'])
+ records.append(record(values, codes, links.get(number, '%s/%d' % (base, number))))
+
+ source = 'FortiOS %s Log Reference (PDF %s), %s' % (args.version, os.path.basename(args.pdf), base)
+ else:
+ for count, number in enumerate(sorted(links)):
+ if args.limit and count >= args.limit:
+ break
+
+ url = links[number]
+
+ if count % 100 == 0:
+ sys.stderr.write('fortinet: %d/%d %s\n' % (count, len(links), url))
+
+ records.append(record(html_message(fetch.get(url)), codes, urllib.parse.urldefrag(url)[0]))
+
+ source = 'FortiOS %s Log Message Reference, %s' % (args.version, base)
+
+ records = sorted((r for r in records if r), key=lambda r: r['identifier'])
+ collector.write('fortinet', 'Fortinet', records, args.output, source)
+
+ return 0
+
+
+if __name__ == '__main__':
+ sys.exit(main())
diff --git a/contrib/recommendations/vendors/collect_hpe.py b/contrib/recommendations/vendors/collect_hpe.py
new file mode 100755
index 00000000..0635f937
--- /dev/null
+++ b/contrib/recommendations/vendors/collect_hpe.py
@@ -0,0 +1,514 @@
+#!/usr/bin/env python3
+# +-------------------------------------------------------------------------+
+# | Copyright (C) 2004-2026 The Cacti Group |
+# | |
+# | This program is free software; you can redistribute it and/or |
+# | modify it under the terms of the GNU General Public License |
+# | as published by the Free Software Foundation; either version 2 |
+# | of the License, or (at your option) any later version. |
+# | |
+# | This program is distributed in the hope that it will be useful, |
+# | but WITHOUT ANY WARRANTY; without even the implied warranty of |
+# | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
+# | GNU General Public License for more details. |
+# +-------------------------------------------------------------------------+
+"""Collect HPE Comware, AOS-CX and ArubaOS-Switch log message recommendations from the HPE Support Center.
+
+Sources (https://support.hpe.com/hpesc/public/docDisplay?docId=), in order of precedence:
+
+ c7-5900 c04532301 HP 5920 & 5900 Switch Series System Log Messages Reference (Comware 7, 2014)
+ c7-12900 c04532292 HP FlexFabric 12900 Switch Series System Log Messages Reference (Comware 7,
+ 2014); only messages that are not in the 5900 guide
+ c5-5500 c04532298 HP 5500 EI & 5500 SI Switch Series System Log Messages Reference (Comware 5,
+ 2014); only messages that are not in a Comware 7 guide
+ aoscx sd00007159en_us AOS-CX Event Log Message Reference Guide (All Switch Series), current release
+ aoss a00093582en_us Aruba Event Log Message Reference Guide for ArubaOS-Switch 16.10
+
+The documents are read through the public HPE Support Center document API that the docDisplay viewer uses:
+/hpesc/public/api/document/ returns the PDF for the Comware and ArubaOS-Switch guides, and for the
+multi-page AOS-CX guide /hpesc/public/api/document//toc lists the topic pages, which are fetched one
+by one. PDFs are parsed with pypdf.
+
+Identifiers, as they appear in real syslog messages:
+ Comware: %10MODULE/LEVEL/MNEMONIC, e.g. %10IFNET/3/PHY_UPDOWN from
+ "%%10IFNET/3/PHY_UPDOWN: Ethernet0/0: link status is down." (the tokenizer keeps one '%').
+ MODULE is taken from the guide's example (falling back to the " messages" section),
+ LEVEL is the documented severity level.
+ AOS-CX: the plain event ID, e.g. 4701.
+ AOS-S: the event ID zero-padded to 5 digits, e.g. 00076.
+
+Severity: Comware uses the documented level 0-7. AOS-CX words map EMERG 0 ... DEBUG 7. AOS-S maps
+Information 6, Warning 4, Debug 7 and Fatal 2 (an interpretation); "None" and "Standard" give no severity.
+
+Precedence and filtering: documents are read in the order above and a later document only adds identifiers
+(compared case-insensitively) that the earlier ones lack, so the Comware 7 form of a message wins. When a
+Comware 5 message's example shows a different level than its severity row, both identifier forms are
+produced. Events without a description and without a recommended action are omitted (the importer would
+reject them); in practice that is most of the gaps in the ArubaOS-Switch guide. Comware 5 headings of the form
+"MNEMONIC: start of message" use the part before the colon; mnemonics that still contain spaces are skipped.
+
+Known gaps: the Comware guides are 2014 HP editions (no newer public Comware references were found); the
+AOS-CX and AOS-S guides have no recommended actions; numeric AOS-CX/AOS-S IDs can collide with other numbers
+in a message; HPE iLO/server messages are out of scope.
+
+support.hpe.com is slow: use --doc to collect only some documents. If the site blocks scripted access, save
+the documents with your own browser into a directory and use --from DIR: .pdf for the PDF guides
+(the docDisplay viewer's download button), and for AOS-CX either .html or a directory / with
+the saved topic pages (*.html); any page containing "Event ID: " tables is parsed.
+
+Usage example:
+ contrib/recommendations/vendors/collect_hpe.py -o /some/dir/hpe.json.gz
+ contrib/recommendations/vendors/collect_hpe.py --doc aoscx,aoss -o /some/dir/hpe.json.gz
+ contrib/recommendations/vendors/collect_hpe.py --from ~/Downloads/hpe -o /some/dir/hpe.json.gz
+"""
+
+import glob
+import html
+import io
+import json
+import os
+import re
+import sys
+
+sys.path.insert(0, os.path.dirname(os.path.abspath(__file__)))
+
+import collector # noqa: E402
+
+SITE = 'https://support.hpe.com'
+API = SITE + '/hpesc/public/api/document/'
+VIEW = SITE + '/hpesc/public/docDisplay?docId='
+
+# alias, docId, family, title
+DOCUMENTS = [
+ ('c7-5900', 'c04532301', 'comware7', 'HP 5920 & 5900 Switch Series System Log Messages Reference (Comware 7)'),
+ ('c7-12900', 'c04532292', 'comware7', 'HP FlexFabric 12900 Switch Series System Log Messages Reference (Comware 7)'),
+ ('c5-5500', 'c04532298', 'comware5', 'HP 5500 EI & 5500 SI Switch Series System Log Messages Reference (Comware 5)'),
+ ('aoscx', 'sd00007159en_us', 'aoscx', 'AOS-CX Event Log Message Reference Guide (All Switch Series)'),
+ ('aoss', 'a00093582en_us', 'aoss', 'Aruba Event Log Message Reference Guide for ArubaOS-Switch'),
+]
+
+AOSS_SEVERITY = {'information': 6, 'warning': 4, 'debug': 7, 'fatal': 2, 'none': None, 'standard': None}
+
+MNEMONIC = re.compile(r'^[A-Za-z0-9_][A-Za-z0-9_.-]*$')
+
+
+def extra(parser):
+ parser.add_argument('--doc', default='',
+ help='comma-separated documents to collect, by alias or docId (default: all): '
+ + ', '.join('%s=%s' % (d[0], d[1]) for d in DOCUMENTS))
+ parser.add_argument('--from', dest='from_dir', default='',
+ help='read documents saved with a browser from this directory instead of the web '
+ '(.pdf, .html or /*.html)')
+
+
+def label(text):
+ """Regex for a field label at the start of a line; PDF columns may wrap it anywhere."""
+ return r'(?m)^[ \t]*' + r'\s*'.join(re.escape(c) for c in text.replace(' ', '')) + r'\b[ \t]*'
+
+
+def tidy(text):
+ """Collapse a PDF field to one line, turning bullet glyphs into dashes."""
+ lines = []
+
+ for line in (text or '').split('\n'):
+ line = line.strip()
+ line = re.sub(r'^[\u2022\u25cf\uf0b7{]\s*', '- ', line)
+ lines.append(line)
+
+ return collector.clean(' '.join(lines))
+
+
+def pdf_pages(data):
+ import pypdf
+
+ return [page.extract_text() or '' for page in pypdf.PdfReader(io.BytesIO(data)).pages]
+
+
+# ---------------------------------------------------------------- Comware
+
+COMWARE_LABELS = [('message', 'Message text'), ('variables', 'Variable fields'), ('severity', 'Severity level'),
+ ('example', 'Example'), ('explanation', 'Explanation'), ('action', 'Recommended action')]
+
+
+def parse_comware(pages, reference, family):
+ """Yield Comware records from the text of a System Log Messages Reference."""
+ text, page_starts = '', set()
+
+ for page in pages:
+ lines = page.split('\n')
+
+ # Page header: blank lines and the page number.
+ while lines and (not lines[0].strip() or re.fullmatch(r'\s*[ivx\d][ivx\d ]*', lines[0])):
+ lines.pop(0)
+ page_starts.add(len(text))
+ text += '\n'.join(lines) + '\n'
+
+ section = r'(?im)^\s*(\S+) messages\s*$'
+ starts = [m.start() for m in re.finditer(label('Message text'), text)]
+ sections = [(m.start(), m.group(1)) for m in re.finditer(section, text)]
+ heads = []
+
+ for start in starts:
+ # The mnemonic heads the record; Comware 5 headings may add the start of the message after a colon
+ # ("CFM_LOG: Command") and wrap it onto the next line.
+ header, position = [], start
+ lines = text[:start].rstrip().split('\n')
+
+ for back, line in enumerate(reversed(lines[-3:])):
+ if not line.strip() or re.match(r'\s*(\S+ messages|This section contains|Message text|Variable fields|'
+ r'Severity level|Example|Explanation|Recommended)\b', line, re.I):
+ break
+
+ if re.fullmatch(r'\s*[A-Z0-9][A-Z0-9_.-]*(\s*:.*)?\s*', line):
+ header = [x.strip() for x in lines[len(lines) - back - 1:]]
+ break
+
+ if not header and start in page_starts:
+ # A table continued on a new page repeats its "Message text" row.
+ heads.append((None, start))
+ continue
+
+ if not header and lines and lines[-1].strip():
+ header = [lines[-1].strip()]
+
+ if header:
+ found = text.rfind('\n' + '\n'.join(lines[len(lines) - len(header):]), 0, start)
+ position = found + 1 if found >= 0 else start
+
+ heads.append((' '.join(header).split(':', 1)[0].strip(), position))
+
+ entries = []
+
+ for i, start in enumerate(starts):
+ end = heads[i + 1][1] if i + 1 < len(starts) else len(text)
+ end = end if end > start else starts[i + 1]
+ segment = text[start:end]
+
+ if heads[i][0] is None and entries:
+ # Drop the repeated "Message text" row, then continue the previous record.
+ label_end = re.match(label('Message text'), segment).end()
+ repeated = re.sub(r'\s+', '', entries[-1][3])
+ k, n = label_end, 0
+
+ while k < len(segment) and n < len(repeated):
+ if segment[k].isspace():
+ k += 1
+ elif segment[k] == repeated[n]:
+ k += 1
+ n += 1
+ else:
+ break
+ entries[-1][2] += '\n' + segment[k:]
+ continue
+
+ if heads[i][0] is None:
+ continue
+ m = re.search(label('Message text'), segment)
+ nxt = re.search(r'(?m)^\s*(Variable\s*fields|Severity\s*level)', segment)
+ entries.append([heads[i][0], start, segment, segment[m.end():nxt.start() if nxt else len(segment)]])
+
+ records = []
+
+ for mnemonic, start, body, _ in entries:
+ heading = re.search(section, body)
+ body = body[:heading.start()] if heading else body
+ fields, positions = {}, []
+
+ for name, words in COMWARE_LABELS:
+ m = re.search(label(words), body)
+
+ if m:
+ positions.append((m.start(), m.end(), name))
+ positions.sort()
+
+ for j, (s, e, name) in enumerate(positions):
+ fields[name] = body[e:positions[j + 1][0] if j + 1 < len(positions) else len(body)]
+
+ if not MNEMONIC.match(mnemonic):
+ continue
+
+ level = re.search(r'\d', fields.get('severity', ''))
+ level = int(level.group(0)) if level else None
+ example = re.sub(r'\s+', '', fields.get('example', ''))
+ m = re.search(r'([A-Za-z0-9_]+)/(\d)/' + re.escape(mnemonic) + r'(?![A-Za-z0-9_])', example)
+ module = m.group(1) if m else None
+ example_level = int(m.group(2)) if m else None
+
+ if module is None:
+ heading = [name for pos, name in sections if pos < start]
+ module = heading[-1] if heading else None
+
+ if module is None or level is None:
+ continue
+
+ record = {
+ 'component': module,
+ 'severity': level,
+ 'message': re.sub(r'^[A-Za-z0-9_]+/\d/\s*' + re.escape(mnemonic) + r':\s*', '', tidy(fields.get('message'))),
+ 'explanation': tidy(fields.get('explanation')),
+ 'recommended_action': tidy(fields.get('action')),
+ 'reference': reference,
+ }
+ records.append(dict(record, identifier='%%10%s/%d/%s' % (module, level, mnemonic)))
+
+ if family == 'comware5' and example_level is not None and example_level != level:
+ records.append(dict(record, identifier='%%10%s/%d/%s' % (module, example_level, mnemonic),
+ severity=example_level))
+
+ return records
+
+
+# ---------------------------------------------------------------- ArubaOS-Switch
+
+AOSS_LABELS = [('message', 'Message'), ('platforms', 'Platforms'), ('category', 'Category'),
+ ('severity', 'Severity'), ('description', 'Description')]
+
+
+def placeholders(text):
+ return re.sub(r'[<{]([A-Za-z0-9_./ -]+?)[>}]', r'[\1]', text)
+
+
+def parse_aoss(pages, reference):
+ lines = []
+
+ for page in pages:
+ page_lines = page.split('\n')
+ skip = False
+
+ for line in page_lines:
+ stripped = line.strip()
+
+ if skip:
+ skip = False
+ continue
+
+ if re.fullmatch(r'Chapter \d+', stripped) or re.match(r'\d+ Aruba Event Log Message Reference Guide', stripped):
+ skip = True
+ continue
+
+ if stripped == 'Table Continued' or re.fullmatch(r'Chapter \d+ .*\d', stripped) \
+ or stripped.startswith('The following are the events related to') \
+ or re.match(r'Aruba Event Log Message Reference Guide', stripped):
+ continue
+ lines.append(line)
+
+ text = '\n'.join(lines)
+ heads = list(re.finditer(r'(?m)^Event ID:\s*(\d+)(?:\s*\(Severity:[^)]*\))?\s*$', text))
+ records = []
+
+ for i, head in enumerate(heads):
+ body = text[head.end():heads[i + 1].start() if i + 1 < len(heads) else len(text)]
+ positions = []
+
+ for name, word in AOSS_LABELS:
+ m = re.search(r'(?m)^' + word + r'\b[ \t]*', body)
+
+ if m:
+ positions.append((m.start(), m.end(), name))
+ positions.sort()
+ fields = {}
+
+ for j, (s, e, name) in enumerate(positions):
+ fields[name] = body[e:positions[j + 1][0] if j + 1 < len(positions) else len(body)]
+
+ word = collector.clean(fields.get('severity')).lower()
+ records.append({
+ 'identifier': '%05d' % int(head.group(1)),
+ 'component': collector.clean(fields.get('category')),
+ 'severity': AOSS_SEVERITY.get(word, collector.severity(word)),
+ 'message': placeholders(tidy(fields.get('message'))),
+ 'explanation': tidy(fields.get('description')),
+ 'recommended_action': '',
+ 'reference': reference,
+ })
+
+ return records
+
+
+# ---------------------------------------------------------------- AOS-CX
+
+def html_text(fragment):
+ fragment = re.sub(r'(?i)
|
|', '\n', fragment)
+ fragment = re.sub(r'(?i)]*>', '- ', fragment)
+ text = html.unescape(re.sub(r'<[^>]+>', ' ', fragment)).replace('\u2010', '-').replace('\u00a0', ' ')
+
+ return collector.clean(text)
+
+
+def parse_aoscx(page, reference):
+ """Yield records from an AOS-CX topic page: one "Event ID: n" heading and table per event."""
+ heads = list(re.finditer(r'(?is)]*>\s*Event\s+ID:\s*(\d+)\s*', page))
+ records = []
+
+ for i, head in enumerate(heads):
+ body = page[head.end():heads[i + 1].start() if i + 1 < len(heads) else len(page)]
+ fields = {}
+
+ for row in re.findall(r'(?is)]*>(.*?)
', body):
+ cells = re.findall(r'(?is)]*>(.*?)', row)
+
+ if len(cells) >= 2:
+ fields[html_text(cells[0]).lower()] = html_text(cells[1])
+
+ records.append({
+ 'identifier': head.group(1),
+ 'component': fields.get('category', ''),
+ 'severity': collector.severity(fields.get('severity', '').replace('LOG_', '')),
+ 'message': placeholders(fields.get('message', '')),
+ 'explanation': fields.get('description', ''),
+ 'recommended_action': '',
+ 'reference': reference,
+ })
+
+ return records
+
+
+def toc_pages(toc):
+ """Topic links below the "Event Categories" node (or all topics if there is none), in order."""
+ def walk(nodes):
+ for node in nodes or []:
+ yield node
+ yield from walk(node.get('children'))
+
+ nodes = list(walk(toc))
+ roots = [n for n in nodes if 'event categories' in (n.get('topicName') or '').lower()]
+ chosen = list(walk(roots[0].get('children'))) if roots else nodes
+
+ return [n['topicLink'] for n in chosen if n.get('topicLink')]
+
+
+# ---------------------------------------------------------------- driver
+
+def select(spec):
+ if not spec:
+ return list(DOCUMENTS)
+
+ wanted = {s.strip().lower() for s in spec.split(',') if s.strip()}
+ known = {d[0] for d in DOCUMENTS} | {d[1].lower() for d in DOCUMENTS}
+ unknown = wanted - known
+
+ if unknown:
+ raise SystemExit('unknown --doc %s; choose from %s' % (', '.join(sorted(unknown)),
+ ', '.join(d[0] for d in DOCUMENTS)))
+
+ return [d for d in DOCUMENTS if d[0] in wanted or d[1].lower() in wanted]
+
+
+def from_dir(directory, docid, family):
+ """Records from files saved with a browser, or None when none are present."""
+ reference = VIEW + docid
+ directory = collector.local_path(directory)
+ pdf = os.path.join(directory, docid + '.pdf')
+
+ if family != 'aoscx' and os.path.exists(pdf):
+ with open(pdf, 'rb') as fh:
+ pages = pdf_pages(fh.read())
+
+ return parse_aoss(pages, reference) if family == 'aoss' else parse_comware(pages, reference, family)
+
+ if family == 'aoscx':
+ files = sorted(glob.glob(os.path.join(directory, docid + '.htm*'))
+ + glob.glob(os.path.join(directory, docid, '*.htm*')))
+ records = []
+
+ for name in files:
+ with open(name, encoding='utf-8', errors='replace') as fh:
+ page = fh.read()
+ guid = re.search(r'page=(GUID-[0-9A-Fa-f-]+\.html)', page)
+ ref = reference + ('&page=%s&docLocale=en_US' % guid.group(1) if guid and len(files) > 1 else '')
+ records.extend(parse_aoscx(page, ref))
+
+ return records if files else None
+
+ return None
+
+
+def collect(args, fetch, docid, family, budget):
+ """Records for one document from the web; budget is the number of pages still allowed (0 = no limit)."""
+ reference = VIEW + docid
+
+ if family == 'aoscx':
+ toc = json.loads(fetch.get(API + docid + '/toc'))
+ links = toc_pages(toc)
+ records, used = [], 0
+
+ for link in links:
+ if budget and used >= budget:
+ break
+ page = fetch.get(link)
+ used += 1
+
+ if page.lstrip().startswith('{'):
+ page = json.loads(page).get('page_html') or ''
+ guid = re.search(r'page=([^&]+)', link)
+ ref = reference + ('&page=%s&docLocale=en_US' % guid.group(1) if guid else '')
+ records.extend(parse_aoscx(page, ref))
+
+ return records, used
+
+ data = fetch.get(API + docid, binary=True)
+
+ if not data.startswith(b'%PDF'):
+ raise IOError('%s did not return a PDF; save it with a browser and use --from' % docid)
+
+ pages = pdf_pages(data)
+
+ if family == 'aoss':
+ return parse_aoss(pages, reference), 1
+
+ return parse_comware(pages, reference, family), 1
+
+
+def main():
+ args = collector.arguments(__doc__.splitlines()[0], extra)
+ fetch = None if args.from_dir else collector.fetcher(args, 'hpe')
+ documents = select(args.doc)
+ records, seen, used, docids = [], set(), 0, []
+
+ for alias, docid, family, title in documents:
+ if args.limit and used >= args.limit:
+ break
+
+ if args.from_dir:
+ found = from_dir(args.from_dir, docid, family)
+
+ if found is None:
+ sys.stderr.write('hpe: %s (%s) not found in %s, skipped\n' % (alias, docid, args.from_dir))
+ continue
+ count = 1
+ else:
+ try:
+ found, count = collect(args, fetch, docid, family, args.limit - used if args.limit else 0)
+ except (IOError, PermissionError) as e:
+ sys.stderr.write('hpe: %s (%s): %s\n' % (alias, docid, e))
+ continue
+
+ used += count
+ docids.append(docid)
+ kept = missing = earlier = 0
+
+ for record in found:
+ # Earlier documents take precedence: a later guide only adds identifiers they lack.
+ if record['identifier'].lower() in seen:
+ earlier += 1
+ continue
+
+ if not (record['explanation'] or record['recommended_action']):
+ missing += 1
+ continue
+ seen.add(record['identifier'].lower())
+ records.append(record)
+ kept += 1
+
+ sys.stderr.write('hpe: %s (%s): %d records, %d without description omitted, %d already in an earlier guide\n'
+ % (alias, docid, kept, missing, earlier))
+
+ source = 'HPE Comware, AOS-CX and ArubaOS-Switch log message references, HPE Support Center (%s)' % \
+ ', '.join(VIEW + d for d in docids)
+ collector.write('hpe', 'HPE', records, args.output, source)
+
+ return 0
+
+
+if __name__ == '__main__':
+ sys.exit(main())
diff --git a/contrib/recommendations/vendors/collect_huawei.py b/contrib/recommendations/vendors/collect_huawei.py
new file mode 100755
index 00000000..3a58fa8c
--- /dev/null
+++ b/contrib/recommendations/vendors/collect_huawei.py
@@ -0,0 +1,344 @@
+#!/usr/bin/env python3
+# +-------------------------------------------------------------------------+
+# | Copyright (C) 2004-2026 The Cacti Group |
+# | |
+# | This program is free software; you can redistribute it and/or |
+# | modify it under the terms of the GNU General Public License |
+# | as published by the Free Software Foundation; either version 2 |
+# | of the License, or (at your option) any later version. |
+# | |
+# | This program is distributed in the hope that it will be useful, |
+# | but WITHOUT ANY WARRANTY; without even the implied warranty of |
+# | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
+# | GNU General Public License for more details. |
+# +-------------------------------------------------------------------------+
+"""Build a Huawei recommendation catalogue from CloudEngine and S-series Log References saved from support.huawei.com.
+
+Sources, in order of precedence (an identifier found in an earlier document wins):
+
+1. CloudEngine S16700 Log Reference, V600R024C10 (VRP8)
+ https://support.huawei.com/enterprise/en/doc/EDOC1100459363
+2. CloudEngine 9800, 8800, and 6800 Log Reference, V300R026C00 (VRP8)
+ https://support.huawei.com/enterprise/en/doc/EDOC1100613732
+3. S1720, S2700, S5700, and S6720 Log Reference, V200R011C10 (VRP5)
+ https://support.huawei.com/enterprise/en/doc/EDOC1000178180
+Other Huawei Log References in the same format can be added; they come after these three.
+
+Getting the documents: support.huawei.com's robots.txt disallows every path for
+all robots except named search engines ("User-agent: * Disallow: /"), and its
+document pages are rendered by JavaScript, so this collector does not fetch
+anything. It checks robots.txt once, to report the current policy, and reads
+documents that you saved with a browser (--from DIR, required):
+
+ For each document above, open its URL in a browser while signed in or not
+ (the Log References are public) and either
+ a. use the page's Download button and save the offline package: a .zip
+ (HTML/HedEx; keep it zipped or unzip it), a .chm (unpack it first, for
+ example with "7z x FILE.chm -oDIR/EDOC..."), or a .pdf; or
+ b. open each log or module topic and use "Save Page As..." (HTML), which keeps
+ the page URL for the record's reference.
+ Put each document's files in a subdirectory named after its document ID:
+ DIR/EDOC1100459363/..., DIR/EDOC1100613732/..., DIR/EDOC1000178180/...
+ Files outside such a subdirectory are treated as one more, lowest-precedence
+ document. .html/.htm/.xhtml files, .zip archives of them, and .pdf files are read.
+
+Identifier: %01MODULE/SEVERITY/MNEMONIC, the log name after the "%%" of the
+syslog line, with the mnemonic's case as documented:
+ "... HUAWEI %%01CLI/5/LOGIN(l):CID=...;VTY0 login ..." gives %01CLI/5/LOGIN.
+Severity: the level in the log name (0-7, already RFC 5424).
+Fields: message = the Message section; explanation = the Description, followed by
+"Possible causes: " and the Possible Causes section; recommended_action = the
+Procedure, with numbered steps; component = the module.
+
+Filtering and gaps: the WLAN and PKI modules of the two VRP8 documents are skipped;
+log names whose mnemonic contains a space (FECD/5/PARITY ERROR) are skipped; within
+a document the first variant of a log name is kept. Lines with a log format version
+other than %%01 will not match. The parser follows the Log References' topic
+structure (log name title, then Message / Description / Parameters / Possible
+Causes / Procedure sections); pages that render these differently may need the
+section names in SECTIONS extended.
+
+Usage:
+ contrib/recommendations/vendors/collect_huawei.py -o /some/dir/huawei.json.gz --from ~/Downloads/huawei-log-references
+"""
+
+import html
+import html.parser
+import io
+import os
+import re
+import sys
+import zipfile
+
+sys.path.insert(0, os.path.dirname(os.path.abspath(__file__)))
+
+import collector # noqa: E402
+
+DOCUMENTS = [
+ ('EDOC1100459363', 'CloudEngine S16700 Log Reference V600R024C10', True),
+ ('EDOC1100613732', 'CloudEngine 9800, 8800, and 6800 Log Reference V300R026C00', True),
+ ('EDOC1000178180', 'S1720, S2700, S5700, and S6720 Log Reference V200R011C10', False),
+]
+VRP8_SKIP = {'WLAN', 'PKI'}
+DOC_URL = 'https://support.huawei.com/enterprise/en/doc/%s'
+
+# Optional chapter numbering, MODULE/LEVEL/MNEMONIC, optional "(l)"-style suffix.
+LOG_NAME = re.compile(r'^(?:\d+(?:\.\d+)*\s+)?([A-Za-z0-9][A-Za-z0-9_-]*)/([0-7])/([A-Za-z0-9_][A-Za-z0-9_ .-]*?)'
+ r'(?:\s*\([a-z]\))?$')
+SECTIONS = {
+ 'message': 'message', 'log message': 'message', 'log format': 'message',
+ 'description': 'description', 'log meaning': 'description', 'meaning': 'description',
+ 'parameters': 'parameters', 'log parameters': 'parameters', 'parameter': 'parameters',
+ 'possible causes': 'causes', 'possible cause': 'causes', 'cause': 'causes', 'causes': 'causes',
+ 'procedure': 'procedure', 'handling procedure': 'procedure', 'recommended action': 'procedure',
+ 'impact on the system': 'impact', 'impact': 'impact', 'example': 'example', 'related topics': 'related',
+}
+BLOCK = {'p', 'div', 'li', 'tr', 'td', 'th', 'h1', 'h2', 'h3', 'h4', 'h5', 'h6', 'br', 'pre', 'dt', 'dd', 'title',
+ 'section', 'table', 'ul', 'ol', 'dl', 'caption'}
+
+
+def extra(parser):
+ parser.add_argument('--from', dest='source_dir',
+ help='directory with the Log References saved from support.huawei.com (see the docstring)')
+
+
+class Lines(html.parser.HTMLParser):
+ """Flatten an HTML page into text lines; ordered-list items get their step number, and the page URL is kept."""
+
+ def __init__(self):
+ super().__init__(convert_charrefs=True)
+ self.lines, self.buffer, self.skip, self.url, self.lists = [], [], 0, '', []
+
+ def flush(self):
+ text = collector.clean(''.join(self.buffer))
+
+ if text:
+ self.lines.append(text)
+ self.buffer = []
+
+ def handle_starttag(self, tag, attrs):
+ attrs = dict(attrs)
+
+ if tag in ('script', 'style', 'noscript'):
+ self.skip += 1
+ elif tag == 'link' and (attrs.get('rel') or '').lower() == 'canonical' and attrs.get('href'):
+ self.url = self.url or attrs['href']
+ elif tag == 'meta' and attrs.get('property') == 'og:url' and attrs.get('content'):
+ self.url = self.url or attrs['content']
+ elif tag in ('ol', 'ul'):
+ self.flush()
+ self.lists.append([tag, 0])
+ elif tag == 'li':
+ self.flush()
+
+ if self.lists and self.lists[-1][0] == 'ol':
+ self.lists[-1][1] += 1
+ self.buffer.append('%d. ' % self.lists[-1][1])
+ elif tag in BLOCK:
+ self.flush()
+
+ def handle_endtag(self, tag):
+ if tag in ('script', 'style', 'noscript'):
+ self.skip = max(0, self.skip - 1)
+ elif tag in ('ol', 'ul'):
+ self.flush()
+
+ if self.lists:
+ self.lists.pop()
+ elif tag in BLOCK:
+ self.flush()
+
+ def handle_data(self, data):
+ if not self.skip:
+ self.buffer.append(data)
+
+ def handle_comment(self, data):
+ match = re.search(r'saved from url=\(\d+\)(\S+)', data)
+
+ if match:
+ self.url = self.url or match.group(1)
+
+ def close(self):
+ super().close()
+ self.flush()
+
+
+def html_lines(data):
+ parser = Lines()
+ parser.feed(data.decode('utf-8', errors='replace') if isinstance(data, bytes) else data)
+ parser.close()
+
+ return parser.url, parser.lines
+
+
+def pdf_lines(path, limit):
+ from pdfminer.high_level import extract_text
+
+ text = extract_text(path, maxpages=limit or 0)
+
+ return [collector.clean(line) for line in text.splitlines() if line.strip()]
+
+
+def parse(lines, reference, skip_modules):
+ """Yield records from a page's text lines (one or more logs)."""
+ current, section = None, None
+
+ def finish(log):
+ if not log:
+ return None
+
+ module, level, mnemonic = log['name']
+ description = join(log['description'])
+ causes = join(log['causes'])
+ explanation = description
+
+ if causes:
+ explanation = (description + ' ' if description else '') + 'Possible causes: ' + causes
+
+ return {
+ 'identifier': '%%01%s/%s/%s' % (module, level, mnemonic),
+ 'component': module,
+ 'severity': int(level),
+ 'message': join(log['message']),
+ 'explanation': explanation,
+ 'recommended_action': join(log['procedure']),
+ 'reference': log['reference'],
+ }
+
+ for line in lines:
+ match = LOG_NAME.match(line)
+
+ if match:
+ record = finish(current)
+
+ if record:
+ yield record
+
+ module, level, mnemonic = match.group(1), match.group(2), match.group(3).strip()
+
+ if ' ' in mnemonic or module.upper() in skip_modules:
+ current = None
+ else:
+ current = {'name': (module, level, mnemonic), 'reference': reference, 'message': [],
+ 'description': [], 'causes': [], 'procedure': [], 'seen': set()}
+ section = None
+ continue
+
+ key = SECTIONS.get(line.lower().rstrip(':'))
+
+ if key:
+ # A repeated section name is a table header (such as a Parameters column), not a new section.
+ if current is not None and key not in current['seen']:
+ current['seen'].add(key)
+ section = key
+ continue
+
+ if current is not None and section in ('message', 'description', 'causes', 'procedure'):
+ current[section].append(line)
+
+ record = finish(current)
+
+ if record:
+ yield record
+
+
+def join(parts):
+ return collector.clean(' '.join(parts))
+
+
+def document_of(path, root):
+ """The document ID of a saved file: its EDOC subdirectory, or None."""
+ for part in os.path.relpath(path, root).split(os.sep):
+ if re.match(r'^EDOC\d+$', part, re.I):
+ return part.upper()
+
+ return None
+
+
+def page_url(nid, url):
+ if url and url.startswith('http'):
+ return url
+
+ return DOC_URL % nid if nid else 'https://support.huawei.com/enterprise/en/doc/'
+
+
+def main():
+ args = collector.arguments(__doc__.splitlines()[0], extra)
+
+ fetch = collector.fetcher(args, 'huawei')
+
+ if not fetch.allowed(DOC_URL % DOCUMENTS[0][0]):
+ sys.stderr.write('huawei: support.huawei.com robots.txt disallows scripts; reading saved documents only\n')
+
+ if not args.source_dir:
+ sys.stderr.write('huawei: --from DIR is required: save the Log References from support.huawei.com with a '
+ 'browser (see --help and the script header):\n%s\n'
+ % '\n'.join(' %s %s' % (DOC_URL % nid, title) for nid, title, _ in DOCUMENTS))
+ return 2
+
+ known = [nid for nid, _, _ in DOCUMENTS]
+ vrp8 = {nid for nid, _, is_vrp8 in DOCUMENTS if is_vrp8}
+ files = {}
+
+ source_dir = collector.local_path(args.source_dir)
+
+ for root, _, names in os.walk(source_dir):
+ for name in sorted(names):
+ path = os.path.join(root, name)
+ nid = document_of(path, source_dir)
+ files.setdefault(nid, []).append(path)
+
+ order = [nid for nid in known if nid in files] + sorted(n for n in files if n and n not in known)
+
+ if None in files:
+ order.append(None)
+
+ records, processed, used = [], 0, []
+
+ for nid in order:
+ skip = VRP8_SKIP if nid in vrp8 else set()
+ before = len(records)
+
+ for path in files[nid]:
+ if args.limit and processed >= args.limit:
+ break
+
+ lower = path.lower()
+ pages = []
+
+ try:
+ if lower.endswith(('.html', '.htm', '.xhtml')):
+ with open(path, 'rb') as fh:
+ pages.append(html_lines(fh.read()))
+ elif lower.endswith('.zip'):
+ with zipfile.ZipFile(path) as archive:
+ for member in sorted(archive.namelist()):
+ if member.lower().endswith(('.html', '.htm', '.xhtml')):
+ url, lines = html_lines(archive.read(member))
+ pages.append((url, lines))
+ elif lower.endswith('.pdf'):
+ pages.append(('', pdf_lines(path, args.limit)))
+ else:
+ continue
+ except (OSError, zipfile.BadZipFile, ValueError) as e:
+ sys.stderr.write('huawei: cannot read %s: %s\n' % (path, e))
+ continue
+
+ processed += 1
+
+ for url, lines in pages:
+ records.extend(parse(lines, page_url(nid, url), skip))
+
+ if len(records) > before:
+ title = dict((n, t) for n, t, _ in DOCUMENTS).get(nid, nid or 'other saved pages')
+ used.append('%s (%s)' % (title, DOC_URL % nid if nid else 'saved pages'))
+ sys.stderr.write('huawei: %s: %d log entries\n' % (nid or 'other', len(records) - before))
+
+ collector.write('huawei', 'Huawei', records, args.output,
+ 'Huawei Log References, saved from support.huawei.com: ' + '; '.join(used))
+
+ return 0
+
+
+if __name__ == '__main__':
+ sys.exit(main())
diff --git a/contrib/recommendations/vendors/collect_juniper.py b/contrib/recommendations/vendors/collect_juniper.py
new file mode 100755
index 00000000..f7b648cc
--- /dev/null
+++ b/contrib/recommendations/vendors/collect_juniper.py
@@ -0,0 +1,239 @@
+#!/usr/bin/env python3
+# +-------------------------------------------------------------------------+
+# | Copyright (C) 2004-2026 The Cacti Group |
+# | |
+# | This program is free software; you can redistribute it and/or |
+# | modify it under the terms of the GNU General Public License |
+# | as published by the Free Software Foundation; either version 2 |
+# | of the License, or (at your option) any later version. |
+# | |
+# | This program is distributed in the hope that it will be useful, |
+# | but WITHOUT ANY WARRANTY; without even the implied warranty of |
+# | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
+# | GNU General Public License for more details. |
+# +-------------------------------------------------------------------------+
+"""Collect Junos system log message recommendations from the Juniper System Log Explorer.
+
+Source: Juniper System Log Explorer, https://apps.juniper.net/syslog-explorer/ (Junos OS and Junos OS
+Evolved, the releases the explorer lists, currently 22.2R1 to 26.2R1). The explorer is a public web
+application; this script uses the same JSON endpoints its page script (scripts/syslog.js) calls:
+
+ getAllReleases products ("software") and their releases
+ getAllMessagesForRelease/// message names in a release, 100 at a time from offset n
+ messageDetails?msg= the message's details for every product and release
+
+The message names of the selected releases are merged, then each message's details are fetched once (one
+request per message, so a full run takes a while at the polite delay -- about 7,000 messages and 3 hours with
+the defaults; the page cache makes re-runs cheap and lets an interrupted run resume).
+
+Identifier: the Junos system log tag, exactly as it appears in messages, e.g. RPD_OSPF_NBRDOWN from
+"rpd[1234]: RPD_OSPF_NBRDOWN: OSPF neighbor 10.0.0.2 ... state changed from Full to Down ...".
+The component is the tag's prefix (RPD, ESWD, ...). The message keeps the documented text with variables
+written as [name]. The explanation is the explorer's Description (followed by its Cause when given; the
+short Help text is used when there is no description) and the recommended action is its Action.
+
+Severity: the explorer's severity word (emergency ... debug) maps to 0-7; "unknown" (common for flow and
+AppTrack logs) gives no severity. When a message is documented for
+several products or releases, the details of the first selected product and its newest release are used.
+
+Selection: --product picks "Junos OS" and/or "Junos OS Evolved" (default both); --release picks releases by
+name (e.g. 24.4R2) or the keywords latest, oldest or all (default: latest,oldest, i.e. the newest and the
+oldest listed release of each product, which also catches messages that newer releases removed).
+--limit N stops after N message detail requests.
+
+Known gaps: only what the explorer publishes (Junos OS and Junos OS Evolved from 22.2 on; no ScreenOS,
+older releases or other products); many messages have no recommended action ("None"), and some have only a
+short help text. If the explorer is unavailable, the same descriptions are published in the Junos
+"System Log Explorer"/System Log Messages reference on juniper.net, which this script does not parse.
+
+Usage example:
+ contrib/recommendations/vendors/collect_juniper.py -o /some/dir/juniper.json.gz
+ contrib/recommendations/vendors/collect_juniper.py --product "Junos OS" --release 24.4R2 -o /some/dir/juniper.json.gz
+"""
+
+import html
+import json
+import os
+import re
+import sys
+import urllib.parse
+
+sys.path.insert(0, os.path.dirname(os.path.abspath(__file__)))
+
+import collector # noqa: E402
+
+BASE = 'https://apps.juniper.net/syslog-explorer/'
+PRODUCTS = {'junos': 'Junos OS', 'junos os': 'Junos OS', 'evo': 'Junos OS Evolved', 'evolved': 'Junos OS Evolved',
+ 'junos os evolved': 'Junos OS Evolved'}
+
+
+def extra(parser):
+ parser.add_argument('--product', default='Junos OS,Junos OS Evolved',
+ help='comma-separated products: "Junos OS" (junos), "Junos OS Evolved" (evo) '
+ '(default: %(default)s)')
+ parser.add_argument('--release', default='latest,oldest',
+ help='comma-separated releases (e.g. 24.4R2) or latest, oldest, all (default: %(default)s)')
+
+
+def version_key(release):
+ """Sort key for releases such as 22.4R3 or 23.4R2-S1."""
+ return tuple(int(n) for n in re.findall(r'\d+', release))
+
+
+def get_json(fetch, path):
+ return json.loads(fetch.get(BASE + path, headers={'Accept': 'application/json'}))
+
+
+def releases(fetch, products, wanted):
+ """[(product, release)] to list, in the order given."""
+ catalogue = {}
+
+ for entry in get_json(fetch, 'getAllReleases'):
+ versions = [r['releaseVersion'] for train in (entry.get('releaseList') or {}).values() for r in train]
+ catalogue[entry.get('software')] = sorted(set(versions), key=version_key, reverse=True)
+
+ chosen = []
+
+ for product in products:
+ if product not in catalogue:
+ raise SystemExit('the explorer has no product %r; it lists %s' % (product, ', '.join(catalogue)))
+
+ available = catalogue[product]
+
+ for word in wanted:
+ if word == 'all':
+ picks = available
+ elif word == 'latest':
+ picks = available[:1]
+ elif word == 'oldest':
+ picks = available[-1:]
+ elif word in available:
+ picks = [word]
+ else:
+ sys.stderr.write('juniper: %s has no release %s, skipped\n' % (product, word))
+ picks = []
+
+ for release in picks:
+ if (product, release) not in chosen:
+ chosen.append((product, release))
+
+ return chosen
+
+
+def message_text(text):
+ text = re.sub(r'(?is)\s*(.*?)\s*', r'[\1]', text or '')
+
+ return collector.clean(html.unescape(re.sub(r'<[^>]+>', ' ', text)))
+
+
+def plain(text):
+ text = collector.clean(html.unescape(re.sub(r'<[^>]+>', ' ', text or '')))
+
+ return '' if text.lower() in ('none', 'null', 'n/a') else text
+
+
+def record(name, details, products):
+ """Build a record from messageDetails output: {product: {release: details}}."""
+ best = None
+
+ for product in products + sorted(p for p in details if p not in products):
+ per_release = details.get(product) or {}
+
+ if per_release:
+ release = max(per_release, key=version_key)
+ best = per_release[release]
+ break
+
+ if not best:
+ return None
+
+ explanation = plain(best.get('description')) or plain(best.get('help'))
+ cause = plain(best.get('cause'))
+
+ if cause and cause not in explanation:
+ if explanation and explanation[-1] not in '.!?':
+ explanation += '.'
+ explanation = (explanation + ' ' + cause).strip()
+
+ return {
+ 'identifier': best.get('name') or name,
+ 'component': name.split('_', 1)[0],
+ 'severity': collector.severity(best.get('severity')),
+ 'message': message_text(best.get('message')),
+ 'explanation': explanation,
+ 'recommended_action': plain(best.get('action')),
+ 'reference': BASE + 'messageDetails?msg=' + urllib.parse.quote(name),
+ }
+
+
+def main():
+ args = collector.arguments(__doc__.splitlines()[0], extra)
+ fetch = collector.fetcher(args, 'juniper')
+ products = []
+
+ for item in args.product.split(','):
+ item = item.strip()
+
+ if item:
+ product = PRODUCTS.get(item.lower(), item)
+
+ if product not in products:
+ products.append(product)
+
+ wanted = [w.strip() for w in args.release.split(',') if w.strip()]
+ selected = releases(fetch, products, wanted)
+ names = []
+ seen = set()
+
+ for product, release in selected:
+ offset, before = 0, len(names)
+
+ if args.limit and len(names) >= args.limit:
+ sys.stderr.write('juniper: %s %s: skipped, --limit reached\n' % (product, release))
+ continue
+
+ while not (args.limit and len(names) >= args.limit):
+ page = get_json(fetch, 'getAllMessagesForRelease/%s/%s/%d'
+ % (urllib.parse.quote(product), urllib.parse.quote(release), offset))
+
+ if not page:
+ break
+
+ for item in page:
+ name = (item.get('name') or '').strip()
+
+ if name and name not in seen:
+ seen.add(name)
+ names.append(name)
+ offset += len(page)
+
+ sys.stderr.write('juniper: %s %s: %d messages listed, %d new\n' % (product, release, offset, len(names) - before))
+
+ if args.limit:
+ names = names[:args.limit]
+
+ records = []
+
+ for count, name in enumerate(names, 1):
+ try:
+ details = get_json(fetch, 'messageDetails?msg=' + urllib.parse.quote(name))
+ except (IOError, ValueError) as e:
+ sys.stderr.write('juniper: %s: %s\n' % (name, e))
+ continue
+
+ built = record(name, details or {}, products)
+
+ if built:
+ records.append(built)
+
+ if count % 500 == 0:
+ sys.stderr.write('juniper: %d/%d messages\n' % (count, len(names)))
+
+ source = 'Juniper System Log Explorer (%s), %s' % (BASE, ', '.join('%s %s' % s for s in selected))
+ collector.write('juniper', 'Juniper', records, args.output, source)
+
+ return 0
+
+
+if __name__ == '__main__':
+ sys.exit(main())
diff --git a/contrib/recommendations/vendors/collect_nokia.py b/contrib/recommendations/vendors/collect_nokia.py
new file mode 100755
index 00000000..f6a0101d
--- /dev/null
+++ b/contrib/recommendations/vendors/collect_nokia.py
@@ -0,0 +1,157 @@
+#!/usr/bin/env python3
+# +-------------------------------------------------------------------------+
+# | Copyright (C) 2004-2026 The Cacti Group |
+# | |
+# | This program is free software; you can redistribute it and/or |
+# | modify it under the terms of the GNU General Public License |
+# | as published by the Free Software Foundation; either version 2 |
+# | of the License, or (at your option) any later version. |
+# | |
+# | This program is distributed in the hope that it will be useful, |
+# | but WITHOUT ANY WARRANTY; without even the implied warranty of |
+# | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
+# | GNU General Public License for more details. |
+# +-------------------------------------------------------------------------+
+"""Build a Nokia SR OS recommendation catalogue from the SR OS Log Events Guide.
+
+Source: Nokia SR OS Log Events Guide (HTML, one page per application), release
+25.10 by default:
+ https://documentation.nokia.com/sr/25-10/7750-sr/titles/log-events.html
+The title page links to one page per application (log-.html); every event
+on those pages is a properties table (Application name, Event ID, Event name,
+Default severity, Message format string, Cause, Effect, Recovery). Use
+--release to read another release, e.g. --release 24-10 (the URL path segment).
+
+Identifier: APPLICATION-SEVERITY-EventName-EventID with the default severity in
+upper case, as it appears in SR OS syslog lines, e.g.
+ <188>Jan 2 18:43:23 10.221.38.108 TMNX: 17 Base SYSTEM-WARNING-tmnxStateChange-2009 [CHASSIS]: ...
+gives SYSTEM-WARNING-tmnxStateChange-2009.
+
+Severity (from the default severity): critical 2, major 3, minor 4, warning 4,
+cleared 6, indeterminate 6. Nokia's own syslog PRI mapping differs (critical 1,
+major 2, minor 3).
+
+Explanation is the documented Cause plus Effect; the recommended action is the
+documented Recovery. "N/A" values are ignored, so events whose Cause, Effect and
+Recovery are all "N/A" are omitted. References point to the application page
+plus the event anchor.
+
+Known gaps: 7210 SAS and SR Linux are not covered (SR Linux lines carry no
+stable event token). If an operator changes an event's severity with
+"log event-control" the token changes and will not match. The CLEARED,
+INDETERMINATE and CRITICAL words in tokens are assumed by analogy.
+
+Usage:
+ contrib/recommendations/vendors/collect_nokia.py -o /some/dir/nokia.json.gz
+ contrib/recommendations/vendors/collect_nokia.py --release 25-10 --limit 3 -o /some/dir/nokia.json.gz
+"""
+
+import html
+import os
+import re
+import sys
+import urllib.parse
+
+sys.path.insert(0, os.path.dirname(os.path.abspath(__file__)))
+import collector # noqa: E402
+
+TITLE = 'https://documentation.nokia.com/sr/%s/7750-sr/titles/log-events.html'
+
+SEVERITY = {'critical': 2, 'major': 3, 'minor': 4, 'warning': 4, 'cleared': 6, 'indeterminate': 6}
+
+
+def extra(parser):
+ parser.add_argument('--release', default='25-10',
+ help='SR OS documentation release as used in the URL (default: %(default)s)')
+
+
+def text(fragment):
+ fragment = re.sub(r'(?is)<(script|style)\b.*?\1>', ' ', fragment)
+ fragment = re.sub(r'(?i)?(p|div|li|ul|ol|tr|td|th|table|br|pre|section|dt|dd|blockquote|h[1-6])\b[^>]*>', ' ', fragment)
+ fragment = re.sub(r'<[^>]+>', '', fragment)
+
+ return collector.clean(html.unescape(fragment))
+
+
+def present(value):
+ return '' if value.strip().rstrip('.').upper() in ('', 'N/A', 'NA', 'NONE') else value
+
+
+def parse_page(page, url):
+ records = []
+
+ for match in re.finditer(r'(?s)]*\bid="(evnt[^"]*)"[^>]*>(.*?)', page):
+ anchor, body = match.groups()
+ props = {}
+
+ for row in re.finditer(r'(?s)]*>\s*| ]*>(.*?) | \s*]*>(.*?) | \s*
', body):
+ props[text(row.group(1)).lower()] = row.group(2)
+
+ app = text(props.get('application name', ''))
+ event_id = text(props.get('event id', ''))
+ name = text(props.get('event name', ''))
+ level = text(props.get('default severity', '')).lower()
+
+ if not (app and event_id and name and level):
+ continue
+
+ message = re.sub(r'\$([A-Za-z0-9_.]+)\$', r'[\1]', text(props.get('message format string', '')))
+ cause = present(text(props.get('cause', '')))
+ effect = present(text(props.get('effect', '')))
+ recovery = present(text(props.get('recovery', '')))
+ explanation = ' '.join(x for x in (cause, ('Effect: ' + effect) if effect else '') if x)
+
+ records.append({
+ 'identifier': '%s-%s-%s-%s' % (app.upper(), level.upper(), name, event_id),
+ 'component': app.upper(),
+ 'severity': SEVERITY.get(level, collector.severity(level)),
+ 'message': message,
+ 'explanation': explanation,
+ 'recommended_action': recovery,
+ 'reference': url + '#' + anchor,
+ })
+
+ return records
+
+
+def main():
+ args = collector.arguments(__doc__.splitlines()[0], extra)
+ fetch = collector.fetcher(args, 'nokia')
+ title = TITLE % args.release
+ index = fetch.get(title)
+
+ pages = []
+
+ for href in re.findall(r'href="([^"#?]*/log-events/log-[^"#?]+\.html)"', index):
+ url = urllib.parse.urljoin(title, href)
+
+ if not url.endswith('/log-events-overview.html') and url not in pages:
+ pages.append(url)
+
+ if not pages:
+ sys.stderr.write('nokia: no application pages found on %s\n' % title)
+ return 1
+
+ if args.limit:
+ pages = pages[:args.limit]
+
+ records = []
+
+ for number, url in enumerate(pages, 1):
+ try:
+ found = parse_page(fetch.get(url), url)
+ except Exception as e: # keep going; one missing application should not abort the build
+ sys.stderr.write('nokia: %s: %s\n' % (url, e))
+ continue
+
+ sys.stderr.write('nokia: [%d/%d] %s: %d events\n' % (number, len(pages), url.rsplit('/', 1)[-1], len(found)))
+ records.extend(found)
+
+ release = args.release.replace('-', '.')
+ collector.write('nokia', 'Nokia', records, args.output, 'Nokia SR OS %s Log Events Guide (%s)' % (release, title))
+
+ return 0
+
+
+if __name__ == '__main__':
+ sys.exit(main())
diff --git a/contrib/recommendations/vendors/collect_nvidia.py b/contrib/recommendations/vendors/collect_nvidia.py
new file mode 100755
index 00000000..aa2d891e
--- /dev/null
+++ b/contrib/recommendations/vendors/collect_nvidia.py
@@ -0,0 +1,281 @@
+#!/usr/bin/env python3
+# +-------------------------------------------------------------------------+
+# | Copyright (C) 2004-2026 The Cacti Group |
+# | |
+# | This program is free software; you can redistribute it and/or |
+# | modify it under the terms of the GNU General Public License |
+# | as published by the Free Software Foundation; either version 2 |
+# | of the License, or (at your option) any later version. |
+# | |
+# | This program is distributed in the hope that it will be useful, |
+# | but WITHOUT ANY WARRANTY; without even the implied warranty of |
+# | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
+# | GNU General Public License for more details. |
+# +-------------------------------------------------------------------------+
+"""Build an NVIDIA recommendation catalogue from the Cumulus Linux, Xid and Fabric Manager documentation.
+
+Sources (docs.nvidia.com):
+ - switchd Log Message Reference, Cumulus Linux 5.18:
+ https://docs.nvidia.com/networking-ethernet-software/cumulus-linux-518/Monitoring-and-Troubleshooting/switchd-Log-Message-Reference/
+ - FRRouting Log Message Reference, Cumulus Linux 5.18:
+ https://docs.nvidia.com/networking-ethernet-software/cumulus-linux-518/Monitoring-and-Troubleshooting/FRRouting-Log-Message-Reference/
+ When the published page renders without its table (as it does for 5.18 at
+ the time of writing), the page's own Markdown source in NVIDIA's public docs
+ repository (github.com/CumulusNetworks/docs, linked from the page's "Edit
+ this page" button) is read instead.
+ - Xid Errors, "Working with Xid Errors":
+ https://docs.nvidia.com/deploy/xid-errors/latest/working-with-xid-errors.html
+ - Fabric Manager User Guide, "NVSwitch SXid Errors":
+ https://docs.nvidia.com/datacenter/tesla/fabric-manager-user-guide/index.html#nvswitch-sxid-errors
+Use --cumulus-release to read another Cumulus Linux release (URL segment, e.g. 519).
+
+Licensing: the Cumulus Linux documentation (switchd and FRR records) is
+published under CC BY-NC-SA 4.0
+(https://docs.nvidia.com/networking-ethernet-software/license/); the Xid and
+Fabric Manager pages are under the NVIDIA Terms of Service.
+
+Identifiers:
+ - switchd: the C symbol in the message text (the function name), e.g.
+ "switchd[1234]: .c: _range_limits_get: ..." gives _range_limits_get.
+ A symbol qualifies when it contains an underscore and starts with "_" or one of
+ hal_, sx_api_, rtnl_, nl_, genl_, or has at least two underscores; source file
+ names (before ".c"), libc/socket names (pthread_*, recvmsg_*, SO_*) and the
+ truncated vlan_range_confi are skipped. Messages sharing a symbol are merged.
+ - FRR: the number of the "[EC n]" code, e.g. "bgpd[1559]: [EC 33554454] ..." gives 33554454.
+ - GPU and NVSwitch: the family tokens Xid and SXid (no per-code records,
+ because bare numbers would collide).
+
+Severity: switchd CRITICAL 2, ERROR 3, WARNING 4 (merged records take the most
+severe level); FRR 3 (logged through flog_err at LOG_ERR); Xid/SXid none, as the
+documents state no syslog priority.
+
+Known gaps: most switchd messages have no distinctive token and are omitted;
+FRR records give the category title, not the exact log text; Onyx, UFM,
+NVSM/DGX, SONiC, NVOS and BlueField are not covered; sx_api_* symbols may also
+appear in other software built on the Spectrum SDK.
+
+Usage:
+ contrib/recommendations/vendors/collect_nvidia.py -o /some/dir/nvidia.json.gz
+"""
+
+import collections
+import html
+import os
+import re
+import sys
+
+sys.path.insert(0, os.path.dirname(os.path.abspath(__file__)))
+import collector # noqa: E402
+
+CUMULUS = 'https://docs.nvidia.com/networking-ethernet-software/cumulus-linux-%s/Monitoring-and-Troubleshooting/%s/'
+FRR_SOURCE = ('https://raw.githubusercontent.com/CumulusNetworks/docs/stage/content/cumulus-linux-%s/'
+ 'Monitoring-and-Troubleshooting/FRRouting-Log-Message-Reference.md')
+XID = 'https://docs.nvidia.com/deploy/xid-errors/latest/working-with-xid-errors.html'
+FABRIC = 'https://docs.nvidia.com/datacenter/tesla/fabric-manager-user-guide/index.html'
+
+SWITCHD_LEVELS = {'CRITICAL': 2, 'ERROR': 3, 'WARNING': 4}
+SWITCHD_SKIP = {'vlan_range_confi'}
+
+FRR_DAEMONS = {'babel': 'babeld', 'bgp': 'bgpd', 'zebra': 'zebra', 'general': 'General', 'ospf': 'ospfd',
+ 'ospfv3': 'ospf6d', 'eigrp': 'eigrpd', 'isis': 'isisd', 'pim': 'pimd', 'rip': 'ripd',
+ 'ripng': 'ripngd', 'ldp': 'ldpd', 'pbr': 'pbrd', 'vrrp': 'vrrpd', 'bfd': 'bfdd',
+ 'static': 'staticd', 'sharp': 'sharpd', 'nhrp': 'nhrpd', 'fabricd': 'fabricd', 'pathd': 'pathd'}
+
+
+def extra(parser):
+ parser.add_argument('--cumulus-release', default='518',
+ help='Cumulus Linux documentation release as used in the URL (default: %(default)s)')
+
+
+def text(fragment):
+ fragment = re.sub(r'(?is)<(script|style|h[1-6])\b.*?\1>', ' ', fragment)
+ fragment = re.sub(r'(?i)?(p|div|li|ul|ol|tr|td|th|table|br|pre|section|dt|dd|blockquote)\b[^>]*>', ' ', fragment)
+ fragment = re.sub(r'<[^>]+>', '', fragment)
+
+ return collector.clean(html.unescape(fragment)).replace('\u2019', "'")
+
+
+def section(page, ident):
+ """Return the HTML of , including nested sections."""
+ start = page.find('', start + tag.end())
+
+ return page[start:end + 1 if end >= 0 else len(page)]
+
+ return page[start:]
+
+
+def symbols(message):
+ for match in re.finditer(r'(?= 2:
+ yield token
+
+
+def switchd(fetch, release):
+ url = CUMULUS % (release, 'switchd-Log-Message-Reference')
+ page = fetch.get(url)
+ groups = collections.OrderedDict()
+
+ for row in re.finditer(r'(?s)\s*| (.*?) | \s*(.*?) | \s*(.*?) | \s*(.*?) | \s*
', page):
+ level, message, explanation, action = (text(x) for x in row.groups())
+
+ for token in set(symbols(message)):
+ entries = groups.setdefault(token, [])
+
+ if not any(e[1] == message for e in entries):
+ entries.append((level.upper(), message, explanation, action))
+
+ records = []
+
+ for token, entries in groups.items():
+ levels = [SWITCHD_LEVELS[e[0]] for e in entries if e[0] in SWITCHD_LEVELS]
+ severity = min(levels) if levels else collector.severity(entries[0][0])
+
+ if len(entries) == 1:
+ message, explanation, action = entries[0][1:]
+ else:
+ causes = list(collections.OrderedDict.fromkeys(e[2] for e in entries if e[2]))
+ actions = list(collections.OrderedDict.fromkeys(e[3] for e in entries if e[3]))
+ message = '%s: [details]' % token
+ explanation = 'One of %d documented switchd messages containing \'%s\' (e.g. "%s"). Documented causes: %s' \
+ % (len(entries), token, entries[0][1], ' / '.join(c.rstrip('.') for c in causes) + '.')
+ action = ' / '.join(actions)
+
+ records.append({'identifier': token, 'component': 'switchd', 'severity': severity, 'message': message,
+ 'explanation': explanation, 'recommended_action': action, 'reference': url})
+
+ return records
+
+
+def frr_rows(fetch, release, url):
+ page = fetch.get(url)
+ rows = []
+
+ for row in re.finditer(r'(?s)((?:\s*| .*? | ){6})\s*
', page):
+ rows.append([text(c) for c in re.findall(r'(?s)(.*?) | ', row.group(1))])
+
+ if rows:
+ return rows
+
+ source = FRR_SOURCE % release
+ sys.stderr.write('nvidia: %s has no table; reading its source %s\n' % (url, source))
+
+ for line in fetch.get(source).splitlines():
+ cells = [collector.clean(c) for c in line.strip().strip('|').split('|')]
+
+ if len(cells) == 6 and cells[2].isdigit():
+ rows.append(cells)
+
+ return rows
+
+
+def frr(fetch, release):
+ url = CUMULUS % (release, 'FRRouting-Log-Message-Reference')
+ records = []
+
+ for category, _level, code, title, explanation, action in frr_rows(fetch, release, url):
+ if not code.isdigit():
+ continue
+
+ daemon = FRR_DAEMONS.get(category.lower(), category.lower())
+ records.append({
+ 'identifier': code,
+ 'component': 'FRR %s' % daemon,
+ 'severity': 3,
+ 'message': '[EC %s] [message-text]' % code,
+ 'explanation': "FRR error category '%s' (%s): %s" % (title.rstrip('*').strip(), category, explanation),
+ 'recommended_action': action,
+ 'reference': url,
+ })
+
+ return records
+
+
+def xid(fetch):
+ page = fetch.get(XID)
+ viewing = text(section(page, 'viewing-xid-messages'))
+ viewing = re.sub(r'^Viewing Xid Messages #?\s*', '', viewing)
+ actions = []
+
+ for row in re.finditer(r'(?s)]*>\s*| (.*?) | \s*(.*?) | \s*
', section(page, 'analyzing-xid-errors')):
+ actions.append('%s: %s' % (text(row.group(1)), text(row.group(2))))
+
+ return [{
+ 'identifier': 'Xid',
+ 'component': 'NVRM (NVIDIA GPU driver)',
+ 'severity': None,
+ 'message': 'NVRM: Xid (PCI:[pci-bdf]): [xid-code], [xid-specific-details]',
+ 'explanation': viewing,
+ 'recommended_action': ' '.join(actions),
+ 'reference': XID,
+ }]
+
+
+def sxid(fetch):
+ page = fetch.get(FABRIC)
+ whole = section(page, 'nvswitch-sxid-errors')
+ nonfatal = section(whole, 'non-fatal-sxid-errors')
+ fatal = section(whole, 'fatal-sxid-errors')
+ intro = whole.split(' 1 else ''
+ intro = re.sub(r'^Nv[Ss]witch SXid Errors #?\s*', '', text(' 1 else release
+ collector.write('nvidia', 'NVIDIA', records, args.output,
+ 'NVIDIA Cumulus Linux %s switchd and FRRouting log message references, Xid errors and '
+ 'Fabric Manager User Guide (docs.nvidia.com)' % version)
+
+ return 0
+
+
+if __name__ == '__main__':
+ sys.exit(main())
diff --git a/contrib/recommendations/vendors/collect_paloalto.py b/contrib/recommendations/vendors/collect_paloalto.py
new file mode 100755
index 00000000..dc09d885
--- /dev/null
+++ b/contrib/recommendations/vendors/collect_paloalto.py
@@ -0,0 +1,242 @@
+#!/usr/bin/env python3
+# +-------------------------------------------------------------------------+
+# | Copyright (C) 2004-2026 The Cacti Group |
+# | |
+# | This program is free software; you can redistribute it and/or |
+# | modify it under the terms of the GNU General Public License |
+# | as published by the Free Software Foundation; either version 2 |
+# | of the License, or (at your option) any later version. |
+# | |
+# | This program is distributed in the hope that it will be useful, |
+# | but WITHOUT ANY WARRANTY; without even the implied warranty of |
+# | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
+# | GNU General Public License for more details. |
+# +-------------------------------------------------------------------------+
+"""Build a Palo Alto Networks recommendation catalogue from the PAN-OS System Log Reference.
+
+Source: "Syslog Severity Reference" (System Log Reference) for current PAN-OS
+(10.1 to 12.2), with one page per severity (critical, high, medium, low,
+informational), each listing the SYSTEM log Event IDs and messages per log
+subtype:
+https://docs.paloaltonetworks.com/ngfw/administration/monitoring/use-syslog-for-monitoring/system-log-reference
+
+The severity pages are found by following the links from the reference page,
+so a renamed page (the low page is "low-severity-sytem-log-messages") is still
+picked up.
+
+Identifier: the Event ID (CSV field 9 of a SYSTEM log), for example
+"tunnel-status-down" in "... SYSTEM,vpn,0,2026/11/20 17:00:01,,tunnel-status-down,...".
+
+Severity: the page the Event ID is documented on: critical 2, high 3, medium 4,
+low 5, informational 6. It is null when the Event ID is documented at more than
+one severity.
+
+Records: message is the first documented message (placeholders written as
+[name]); component is the log subtype(s); explanation is generated from the
+message, subtype, severity and the number of documented message variants
+(distinct messages per severity page).
+
+Excluded: generic one-word Event IDs (general, auth, api, cli, gnmi, connect,
+initiate, terminate, restart, sync, N/A), Event IDs that contain spaces, Event
+IDs whose messages are only placeholders (such as palo-alto-networks-message\nand syslog-conn-status), user-password-change-* Event IDs
+whose documented message is not about a password change, and the 34 generic
+identifiers in EXCLUDE, which would match other vendors' messages.
+
+Known gaps: recommended_action is always empty; the reference pages give no
+operator actions (the previously shipped catalogue had about a dozen
+hand-written actions and explanations from Knowledge Base articles, which are
+not reproduced). GlobalProtect eventid values and most HA events are not
+documented in the reference.
+
+Usage example:
+ contrib/recommendations/vendors/collect_paloalto.py -o /some/dir/paloalto.json.gz
+"""
+
+import html
+import os
+import re
+import sys
+import urllib.parse
+from html.parser import HTMLParser
+
+sys.path.insert(0, os.path.dirname(os.path.abspath(__file__)))
+
+import collector # noqa: E402
+
+BASE = 'https://docs.paloaltonetworks.com'
+START = BASE + '/ngfw/administration/monitoring/use-syslog-for-monitoring/system-log-reference'
+
+SEVERITIES = ['critical', 'high', 'medium', 'low', 'informational']
+LEVEL = {'critical': 2, 'high': 3, 'medium': 4, 'low': 5, 'informational': 6}
+
+GENERIC = {'general', 'auth', 'api', 'cli', 'gnmi', 'connect', 'initiate', 'terminate', 'restart', 'sync', 'n/a'}
+
+EXCLUDE = (
+ 'admin-down', 'auth-fail', 'auth-success', 'link-down', 'link-change', 'lacp-down', 'lacp-up', 'state-change',
+ 'neighbor-down', 'connect-fail', 'connect-client', 'nh-down', 'nh-up', 'speed-duplex', 'unresponsive',
+ 'fan-failure', 'fan-removed', 'fan-inserted', 'ps-failure', 'ps-inserted', 'slot-up', 'lease-start', 'lease-end',
+ 'cert-expiry', 'if-add', 'if-del', 'if-clear', 'relay-on', 'server-on', 'expired-time', 'load-success',
+ 'nego-fail', 'cache-cleared', 'agent-event',
+)
+
+PAGE_LINK = re.compile(r'href="(?:https://docs\.paloaltonetworks\.com)?(?:/content/techdocs/en_US)?'
+ r'(/ngfw/administration/monitoring/use-syslog-for-monitoring/system-log-reference/'
+ r'([a-z]+)-[a-z-]*?messages)(?:\.html)?"')
+
+
+class Tables(HTMLParser):
+ """Collect (subtype, event id, message) rows from the Event ID / Message tables of a page."""
+
+ def __init__(self):
+ super().__init__(convert_charrefs=True)
+ self.rows = []
+ self.subtype = ''
+ self.heading = None
+ self.cell = None
+ self.cells = []
+
+ def handle_starttag(self, tag, attrs):
+ attrs = dict(attrs)
+
+ if tag == 'div' and attrs.get('class') == 'p' and attrs.get('id'):
+ self.heading = []
+ elif tag == 'tr':
+ self.cells = []
+ elif tag in ('td', 'th'):
+ self.cell = []
+ elif tag == 'br' and self.cell is not None:
+ self.cell.append(' ')
+
+ def handle_endtag(self, tag):
+ if tag == 'div' and self.heading is not None:
+ self.subtype = collector.clean(''.join(self.heading))
+ self.heading = None
+ elif tag in ('td', 'th') and self.cell is not None:
+ self.cells.append(collector.clean(''.join(self.cell)))
+ self.cell = None
+ elif tag == 'tr':
+ if len(self.cells) == 2 and self.cells[0] != 'Event ID':
+ self.rows.append((self.subtype, self.cells[0], self.cells[1]))
+ self.cells = []
+
+ def handle_data(self, data):
+ if self.cell is not None:
+ self.cell.append(data)
+ elif self.heading is not None:
+ self.heading.append(data)
+
+
+def placeholders(text):
+ """Write placeholders as [name] and drop the stray double quotes of the reference tables."""
+ text = re.sub(r'<([^<>]*)>', lambda m: '[%s]' % '-'.join(m.group(1).split()), text)
+ text = re.sub(r'%[sd]\b', '[value]', text.replace('"', ''))
+
+ return collector.clean(re.sub(r'\[\[([^\[\]]*)\]\]', r'[\1]', text))
+
+
+def only_placeholders(text):
+ return not re.sub(r'<[^<>]*>|[^A-Za-z0-9]', '', text)
+
+
+def excluded(identifier, message):
+ if identifier.lower() in GENERIC or ' ' in identifier or only_placeholders(message):
+ return True
+
+ if identifier.lower().startswith('user-password-change') and 'password' not in message.lower():
+ return True
+
+ return False
+
+
+def explanation(entry):
+ subtype = '/'.join(entry['subtypes'])
+ text = placeholders(entry['messages'][0]).rstrip(' !.')
+ sentence = 'PAN-OS SYSTEM log event (subtype %s) reporting: %s.' % (subtype, text)
+
+ if len(entry['severities']) == 1:
+ sentence += ' Documented at %s severity.' % entry['severities'][0]
+ else:
+ sentence += ' Documented at several severities (%s) depending on the message.' % ', '.join(entry['severities'])
+
+ if len(entry['messages']) > 1:
+ sentence += ' %d message variants are documented.' % len(entry['messages'])
+
+ return sentence
+
+
+def main():
+ args = collector.arguments(__doc__.splitlines()[0])
+ fetch = collector.fetcher(args, 'paloalto')
+
+ start = fetch.get(START)
+ pages, queue, seen = {}, [start], set()
+
+ # The reference page links only some severity pages; the others are reached through previous/next links.
+ while queue:
+ body = queue.pop()
+
+ for path, word in PAGE_LINK.findall(body):
+ if word in LEVEL and path not in seen:
+ seen.add(path)
+
+ if args.limit and len(pages) >= args.limit:
+ continue
+
+ url = BASE + path
+ sys.stderr.write('paloalto: %s\n' % url)
+ page = fetch.get(url)
+ pages[word] = (url, page)
+ queue.append(page)
+
+ entries = {}
+
+ for word in SEVERITIES:
+ if word not in pages:
+ if not args.limit:
+ sys.stderr.write('paloalto: warning: no %s severity page found\n' % word)
+ continue
+
+ url, page = pages[word]
+ parser = Tables()
+ parser.feed(page)
+
+ for subtype, identifier, message in parser.rows:
+ identifier = html.unescape(identifier).strip()
+
+ if not identifier or excluded(identifier, message):
+ continue
+
+ entry = entries.setdefault(identifier.lower(), {
+ 'identifier': identifier, 'subtypes': [], 'severities': [], 'messages': [], 'variants': [],
+ 'reference': url})
+
+ if subtype and subtype not in entry['subtypes']:
+ entry['subtypes'].append(subtype)
+ if word not in entry['severities']:
+ entry['severities'].append(word)
+ if (word, message) not in entry['variants']:
+ entry['variants'].append((word, message))
+ entry['messages'].append(message)
+
+ records = []
+
+ for entry in entries.values():
+ entry['subtypes'].sort()
+ records.append({
+ 'identifier': entry['identifier'],
+ 'component': '/'.join(entry['subtypes']),
+ 'severity': LEVEL[entry['severities'][0]] if len(entry['severities']) == 1 else None,
+ 'message': placeholders(entry['messages'][0]),
+ 'explanation': explanation(entry),
+ 'recommended_action': '',
+ 'reference': urllib.parse.urldefrag(entry['reference'])[0],
+ })
+
+ collector.write('paloalto', 'Palo Alto Networks', records, args.output,
+ 'PAN-OS System Log Reference (Syslog Severity Reference), ' + START, exclude=EXCLUDE)
+
+ return 0
+
+
+if __name__ == '__main__':
+ sys.exit(main())
diff --git a/contrib/recommendations/vendors/collector.py b/contrib/recommendations/vendors/collector.py
new file mode 100644
index 00000000..fe818d21
--- /dev/null
+++ b/contrib/recommendations/vendors/collector.py
@@ -0,0 +1,287 @@
+#!/usr/bin/env python3
+# +-------------------------------------------------------------------------+
+# | Copyright (C) 2004-2026 The Cacti Group |
+# | |
+# | This program is free software; you can redistribute it and/or |
+# | modify it under the terms of the GNU General Public License |
+# | as published by the Free Software Foundation; either version 2 |
+# | of the License, or (at your option) any later version. |
+# | |
+# | This program is distributed in the hope that it will be useful, |
+# | but WITHOUT ANY WARRANTY; without even the implied warranty of |
+# | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
+# | GNU General Public License for more details. |
+# +-------------------------------------------------------------------------+
+"""Shared helpers for the vendor recommendation collectors.
+
+The collectors build a recommendation catalogue from a vendor's public
+documentation on the site that runs them, for that site's own use. The plugin
+does not ship these catalogues, because the vendors' documentation is not
+licensed for redistribution; see docs/VENDOR_COLLECTORS.md.
+
+Every page is fetched at most once (pages are cached on disk), robots.txt is
+honoured, and requests are spaced by --delay seconds.
+"""
+
+import argparse
+import gzip
+import hashlib
+import json
+import os
+import sys
+import tempfile
+import time
+import urllib.error
+import urllib.parse
+import urllib.request
+import urllib.robotparser
+
+USER_AGENT = 'Cacti-Syslog-Recommendation-Collector/1.0 (+https://github.com/Cacti/plugin_syslog; site-internal use)'
+
+FIELDS = ['vendor', 'identifier', 'component', 'severity', 'message', 'explanation', 'recommended_action', 'reference']
+
+# Who owns each vendor's documentation and the terms it is published under.
+# The collected catalogue carries these so its origin stays visible.
+LICENSING = {
+ 'arista': ('Arista Networks, Inc.', 'LicenseRef-Arista-Terms-of-Use', 'https://www.arista.com/en/terms-of-use'),
+ 'cisco': ('Cisco Systems, Inc. and/or its affiliates', 'LicenseRef-Cisco-Terms-of-Use',
+ 'https://www.cisco.com/c/en/us/about/legal/terms-conditions.html'),
+ 'dell': ('Dell Inc. or its subsidiaries', 'LicenseRef-Dell-Terms-of-Use',
+ 'https://www.dell.com/en-us/legal/lp/site-terms-of-use'),
+ 'fortinet': ('Fortinet, Inc.', 'LicenseRef-Fortinet-Terms-of-Use', 'https://www.fortinet.com/corporate/about-us/legal'),
+ 'hpe': ('Hewlett Packard Enterprise Development LP', 'LicenseRef-HPE-Terms-of-Use',
+ 'https://www.hpe.com/us/en/about/legal/terms-of-use.html'),
+ 'huawei': ('Huawei Technologies Co., Ltd.', 'LicenseRef-Huawei-Terms-of-Use', 'https://www.huawei.com/en/legal'),
+ 'juniper': ('Juniper Networks, Inc.', 'LicenseRef-Juniper-Terms-of-Use', 'https://www.juniper.net/us/en/legal-notices.html'),
+ 'nokia': ('Nokia', 'LicenseRef-Nokia-Terms-of-Use', 'https://www.nokia.com/notices/terms/'),
+ 'nvidia': ('NVIDIA Corporation & affiliates', 'CC-BY-NC-SA-4.0 AND LicenseRef-NVIDIA-Terms-of-Service',
+ 'https://docs.nvidia.com/networking-ethernet-software/license/'),
+ 'paloalto': ('Palo Alto Networks, Inc.', 'LicenseRef-PaloAltoNetworks-Terms-of-Use',
+ 'https://www.paloaltonetworks.com/legal-notices/terms-of-use'),
+}
+
+# The documentation hosts each collector may download from, over HTTPS only.
+HOSTS = {
+ 'cisco': ('raw.githubusercontent.com',),
+ 'dell': ('dl.dell.com', 'www.dell.com'),
+ 'fortinet': ('docs.fortinet.com',),
+ 'hpe': ('support.hpe.com',),
+ 'huawei': ('support.huawei.com',),
+ 'juniper': ('apps.juniper.net',),
+ 'nokia': ('documentation.nokia.com',),
+ 'nvidia': ('docs.nvidia.com', 'raw.githubusercontent.com'),
+ 'paloalto': ('docs.paloaltonetworks.com',),
+}
+
+NOTICE = ('This catalogue was built from %s documentation for use within your organisation. '
+ 'It remains subject to the vendor\'s terms (%s); do not redistribute it.')
+
+
+def local_path(path):
+ """Resolve a file or directory named on the command line.
+
+ Only paths inside the user's home directory, the working directory or the
+ system temporary directory are accepted, so a mistyped or crafted argument
+ cannot read or overwrite files elsewhere.
+ """
+ resolved = os.path.realpath(os.path.expanduser(path))
+ roots = [os.path.realpath(os.path.expanduser('~')), os.path.realpath(os.getcwd()),
+ os.path.realpath(tempfile.gettempdir())]
+
+ for root in roots:
+ if resolved == root or resolved.startswith(root.rstrip(os.sep) + os.sep):
+ return resolved
+
+ raise SystemExit('error: %s is outside your home, working and temporary directories' % path)
+
+
+class Fetcher:
+ """Polite, cached HTTP access to a vendor's documentation."""
+
+ def __init__(self, cache_dir, delay, hosts=(), user_agent=USER_AGENT):
+ self.cache_dir = local_path(cache_dir)
+ self.hosts = frozenset(hosts)
+ self.delay = delay
+ self.user_agent = user_agent
+ self.last = 0.0
+ self.robots = {}
+ os.makedirs(self.cache_dir, exist_ok=True)
+
+ def _robots(self, url):
+ parts = urllib.parse.urlsplit(url)
+ root = '%s://%s' % (parts.scheme, parts.netloc)
+
+ if root not in self.robots:
+ parser = urllib.robotparser.RobotFileParser(root + '/robots.txt')
+
+ try:
+ parser.read()
+ except (urllib.error.URLError, OSError):
+ # An unreadable robots.txt is not permission to crawl.
+ parser = None
+ self.robots[root] = parser
+
+ return self.robots[root]
+
+ def allowed(self, url):
+ parser = self._robots(url)
+
+ return parser is not None and parser.can_fetch(self.user_agent, url)
+
+ def wait_for(self, url):
+ """Seconds to wait between requests to url's site: --delay, or the site's Crawl-delay if longer."""
+ parser = self._robots(url)
+ crawl = parser.crawl_delay(self.user_agent) if parser else None
+
+ return max(self.delay, float(crawl or 0))
+
+ def get(self, url, binary=False, headers=None, data=None):
+ """Return the body of url (str, or bytes when binary), from the cache when possible.
+
+ data, when given, is sent as a POST body and is part of the cache key. Only
+ HTTPS URLs on the vendor's documentation hosts are fetched.
+ """
+ parts = urllib.parse.urlsplit(url)
+
+ if parts.scheme != 'https' or parts.hostname not in self.hosts:
+ raise PermissionError('refusing to fetch %s: only https on %s' % (url, ', '.join(sorted(self.hosts)) or 'no host'))
+
+ key = hashlib.sha256((url + '\0' + (data.decode('utf-8', 'replace') if data else '')).encode('utf-8')).hexdigest()
+ path = os.path.join(self.cache_dir, key)
+
+ if os.path.exists(path):
+ with open(path, 'rb') as fh:
+ body = fh.read()
+ else:
+ if self._robots(url) is None:
+ raise PermissionError('robots.txt for %s could not be read; not fetching %s' % (parts.hostname, url))
+
+ if not self.allowed(url):
+ raise PermissionError('robots.txt disallows %s' % url)
+
+ wait = self.wait_for(url) - (time.time() - self.last)
+
+ if wait > 0:
+ time.sleep(wait)
+
+ request = urllib.request.Request(url, data=data, headers=dict({'User-Agent': self.user_agent}, **(headers or {})))
+ body = None
+
+ for attempt in range(3):
+ try:
+ with urllib.request.urlopen(request, timeout=60) as response:
+ body = response.read()
+ break
+ except urllib.error.HTTPError as e:
+ if e.code in (401, 403, 404, 410):
+ raise
+ time.sleep(max(self.wait_for(url), 5 * (attempt + 1)))
+ except (urllib.error.URLError, OSError):
+ time.sleep(max(self.wait_for(url), 5 * (attempt + 1)))
+ self.last = time.time()
+
+ if body is None:
+ raise IOError('could not fetch %s' % url)
+
+ with open(path + '.tmp', 'wb') as fh:
+ fh.write(body)
+ os.replace(path + '.tmp', path)
+
+ return body if binary else body.decode('utf-8', errors='replace')
+
+
+def arguments(description, extra=None):
+ """Parse the common collector options; extra(parser) may add vendor options."""
+ parser = argparse.ArgumentParser(description=description)
+ parser.add_argument('-o', '--output', required=True,
+ help='catalogue to write: a .json or .json.gz file, kept outside the plugin directory')
+ parser.add_argument('--cache', default=os.path.join(os.path.expanduser('~'), '.cache', 'cacti-syslog-collectors'),
+ help='page cache directory (default: %(default)s)')
+ parser.add_argument('--delay', type=float, default=1.5, help='seconds between requests (default: %(default)s)')
+ parser.add_argument('--limit', type=int, default=0, help='stop after this many source pages or documents, for testing')
+
+ if extra:
+ extra(parser)
+
+ return parser.parse_args()
+
+
+def fetcher(args, vendor):
+ return Fetcher(os.path.join(args.cache, vendor), args.delay, HOSTS.get(vendor, ()))
+
+
+def clean(text):
+ return ' '.join((text or '').split())
+
+
+def severity(value):
+ """Map a documented severity word or number to the syslog 0-7 scale, or None."""
+ if value is None:
+ return None
+
+ text = str(value).strip().lower()
+
+ if text.isdigit() and 0 <= int(text) <= 7:
+ return int(text)
+
+ words = {'emergency': 0, 'emergencies': 0, 'emerg': 0, 'alert': 1, 'alerts': 1, 'critical': 2, 'crit': 2,
+ 'error': 3, 'errors': 3, 'err': 3, 'warning': 4, 'warnings': 4, 'warn': 4, 'notice': 5,
+ 'notifications': 5, 'notification': 5, 'informational': 6, 'information': 6, 'info': 6, 'debug': 7,
+ 'debugging': 7}
+
+ return words.get(text)
+
+
+def write(vendor_key, vendor_name, records, output, source, exclude=()):
+ """Normalise, de-duplicate and write records as a syslog-recommendations document."""
+ exclude = {x.lower() for x in exclude}
+ seen, out, dropped = set(), [], 0
+
+ for record in records:
+ identifier = clean(record.get('identifier')).rstrip(':')
+ explanation = (record.get('explanation') or '').strip()
+ action = (record.get('recommended_action') or '').strip()
+
+ if not identifier or ' ' in identifier or not (explanation or action) or identifier.lower() in exclude \
+ or identifier.lower() in seen:
+ dropped += 1
+ continue
+
+ seen.add(identifier.lower())
+ row = {field: record.get(field, None if field == 'severity' else '') for field in FIELDS}
+ row.update({'vendor': vendor_name, 'identifier': identifier, 'explanation': explanation, 'recommended_action': action})
+
+ for field in ('component', 'message', 'reference'):
+ row[field] = (row[field] or '').strip()
+ out.append(row)
+
+ if not out:
+ raise SystemExit('%s: no records collected (%d dropped); %s left unchanged' % (vendor_key, dropped, output))
+
+ copyright, license, license_url = LICENSING[vendor_key]
+ document = {
+ 'format': 'syslog-recommendations', 'version': 1,
+ 'copyright': copyright, 'license': license, 'license_url': license_url, 'source': source,
+ 'notice': NOTICE % (vendor_name, license_url),
+ 'recommendations': out,
+ }
+ text = json.dumps(document, indent=2, ensure_ascii=False) + '\n'
+
+ output = local_path(output)
+ plugin = os.path.dirname(os.path.dirname(os.path.dirname(os.path.dirname(os.path.abspath(__file__)))))
+
+ if os.path.abspath(output).startswith(plugin + os.sep):
+ sys.stderr.write('warning: writing inside the plugin directory; do not commit or redistribute %s\n' % output)
+
+ if output.endswith('.gz'):
+ with open(output, 'wb') as fh, gzip.GzipFile(filename='', mode='wb', fileobj=fh, compresslevel=9, mtime=0) as gz:
+ gz.write(text.encode('utf-8'))
+ else:
+ with open(output, 'w', encoding='utf-8') as fh:
+ fh.write(text)
+
+ sys.stderr.write('%s: wrote %d records to %s (%d dropped: empty, excluded or duplicate)\n'
+ % (vendor_key, len(out), output, dropped))
+ sys.stderr.write(document['notice'] + '\n')
+
+ return len(out)
diff --git a/contrib/recommendations/vendors/index.php b/contrib/recommendations/vendors/index.php
new file mode 100644
index 00000000..84595bb6
--- /dev/null
+++ b/contrib/recommendations/vendors/index.php
@@ -0,0 +1,25 @@
+.json.gz` files are catalogues in the `syslog-recommendations` format (version 1) that can be
-imported manually. Each was built from public vendor documentation. No login-protected portals were used.
+The `docs/*.json.gz` files are catalogues in the `syslog-recommendations` format (version 1) that can be
+imported manually. All three are openly licensed: each record's `reference` field links to the document or page
+it came from, and each file's `.license` file and JSON `license` field give its license.
-- Explanations and recommended actions are condensed from the vendor's text. For **Fortinet**, and for most
- **Palo Alto Networks** records, the vendor documents only message formats, so the explanations are short
- sentences generated from the documented message text, type/subtype and severity.
-- Each record's `reference` field links to the document or page it came from.
-- Retrieval dates are the dates the documents were fetched.
-
-Catalogues that are not covered by this build:
-
-- `docs/cisco.json.gz`: Cisco CEMDB data via php-syslog-ng. It is no longer loaded automatically.
-- `docs/juniper.json.gz`: Juniper System Log Explorer, 14 curated EX Series `ESWD` records.
+Catalogues for network vendors are not shipped; sites build them for their own use with the scripts described
+in [VENDOR_COLLECTORS.md](VENDOR_COLLECTORS.md).
## Build
-The final step is `contrib/recommendations/build_catalogues.py`. It is run once per vendor, with the
-extracted JSON on standard input (`build_catalogues.py hpe < hpe.json`), and writes `docs/.json.gz`.
-For Linux, `contrib/recommendations/extract_systemd_catalog.py` produces the extracted JSON (see [Linux](#linux)),
-and `contrib/recommendations/extract_wazuh_rules.py` produces it for `linux-wazuh` (see
-[Linux (Wazuh)](#linux-wazuh)).
-For each vendor it:
+The final step is `contrib/recommendations/build_catalogues.py`. It is run once per catalogue, with the
+extracted JSON on standard input (`build_catalogues.py linux < linux.json`), and writes `docs/.json.gz`.
+`contrib/recommendations/extract_systemd_catalog.py` produces the extracted JSON for `linux` (see [Linux](#linux)),
+`contrib/recommendations/extract_wazuh_rules.py` for `linux-wazuh` (see [Linux (Wazuh)](#linux-wazuh)), and
+`linux-curated` is built from `contrib/recommendations/linux-curated.json` (see [Linux (curated)](#linux-curated)).
+For each catalogue it:
-1. Reads the extracted `.json` (envelope `{"format":"syslog-recommendations","version":1,"recommendations":[...]}`).
+1. Reads the extracted JSON (envelope `{"format":"syslog-recommendations","version":1,"recommendations":[...]}`).
2. Drops records that have neither an `explanation` nor a `recommended_action` (both empty after trimming),
because the importer rejects them.
-3. Drops the vendor's excluded identifiers (listed below), compared case-insensitively.
-4. Drops case-insensitive duplicate identifiers. The first occurrence is kept.
-5. Keeps these 8 fields, in this order: `vendor`, `identifier`, `component`, `severity`, `message`,
+3. Drops case-insensitive duplicate identifiers. The first occurrence is kept.
+4. Keeps these 8 fields, in this order: `vendor`, `identifier`, `component`, `severity`, `message`,
`explanation`, `recommended_action`, `reference`. Missing fields become `""`, or `null` for `severity`.
The pattern-record fields `regex` and `program` follow when they are set.
-6. Writes UTF-8 JSON with 2-space indentation (`ensure_ascii=False`) and a trailing newline, compressed with
+5. Writes UTF-8 JSON with 2-space indentation (`ensure_ascii=False`) and a trailing newline, compressed with
gzip level 9, `mtime=0` and an empty file name, so the output is reproducible.
-7. Adds the `copyright`, `license` (SPDX expression), `license_url` and `source` fields from the `LICENSING`
+6. Adds the `copyright`, `license` (SPDX expression), `license_url` and `source` fields from the `LICENSING`
table to the document, and writes the same copyright and license as SPDX tags to
- `docs/.json.gz.license`. `build_catalogues.py --metadata-only ` refreshes only these, keeping
- the shipped records exactly; it is the way to update `cisco` and `juniper`, which have no extractor.
-
-Excluded identifiers. These are generic words that would match other vendors' messages:
-
-| Vendor | Excluded identifiers |
-|---|---|
-| Palo Alto Networks (34) | `admin-down`, `auth-fail`, `auth-success`, `link-down`, `link-change`, `lacp-down`, `lacp-up`, `state-change`, `neighbor-down`, `connect-fail`, `connect-client`, `nh-down`, `nh-up`, `speed-duplex`, `unresponsive`, `fan-failure`, `fan-removed`, `fan-inserted`, `ps-failure`, `ps-inserted`, `slot-up`, `lease-start`, `lease-end`, `cert-expiry`, `if-add`, `if-del`, `if-clear`, `relay-on`, `server-on`, `expired-time`, `load-success`, `nego-fail`, `cache-cleared`, `agent-event` |
-| MikroTik (8) | `ph1`, `phase1`, `conntrack`, `cme`, `fcs`, `cmd-failed`, `no-proposal-chosen`, `3way` |
-| Other vendors | none |
+ `docs/.json.gz.license`. `build_catalogues.py --metadata-only ` refreshes only these, keeping
+ the shipped records exactly.
The lookup tokenizer regex used to check every identifier is `%?[A-Za-z0-9_](?:[A-Za-z0-9_.\/-]*[A-Za-z0-9_])?`.
-## Arista
-
-**Records: 1,047** (95 facilities, all EOS).
-
-| Document | Release | URL | Retrieved |
-|---|---|---|---|
-| EOS System Message Guide (`SysMsgGuide.pdf`), Dec 3, 2015. Primary source, 1,046 entries | EOS 4.15.3F | https://archive.org/details/manualzilla-id-5674789 | 2026-11-20 |
-| EOS System Message Guide, Sep 26, 2015. Adds 1 entry (`%VXLAN-4-DYNA_VLANVNI_INVALID_PORT_NAME`) | EOS 4.15.2F | https://archive.org/details/manualzilla-id-5830366 | 2026-11-20 |
-| EOS manual, system event logging (confirms where the guide is distributed) | current | https://www.arista.com/en/um-eos/eos-system-event-logging | 2026-11-20 |
-
-- **Identifier:** `%FACILITY--MNEMONIC`. The trailing `:` is dropped by the tokenizer.
- `Nov 20 17:01:02 leaf1 Ebra: %LINEPROTO-5-UPDOWN: Line protocol on Interface Ethernet1, changed state to down`
- gives `%LINEPROTO-5-UPDOWN`.
-- **Severity:** the guide's severity word maps to RFC 5424: Emergency 0, Alert 1, Critical 2, Error 3, Warning 4,
- Notice 5, Info 6, Debug 7.
-- **Gaps and notes:**
- - Arista publishes current guides only behind its login-protected download portal, so Internet Archive copies
- of the EOS 4.15 (2015) guide were used. Messages added after 4.15 are missing, and some may have changed.
- - CloudVision and other non-EOS messages are not included.
- - The PDF draws mnemonic underscores as rules. They were restored from word gaps (pdfminer.six) and the
- letters cross-checked with pypdf.
- - Line-break hyphenation was repaired heuristically.
- - `%DATAPLANE-4-MIRROR_DESTINATION_LAG_RESOURCE_FULL` has an empty explanation in the guide, which is kept.
- Some mnemonics that look truncated are reproduced as published (for example under VRRP).
-
-## Dell
-
-**Records: 7,142**: PowerEdge iDRAC/CMC 6,811; SmartFabric OS10 327; Networking OS9 4.
-
-| Document | Version | URL | Retrieved |
-|---|---|---|---|
-| PowerEdge Servers Error and Event Messages Reference Guide (EEMI) | iDRAC9 / Lifecycle Controller v6.x | https://www.dell.com/support/manuals/en-us/idrac9-lifecycle-controller-v6.x-series/error_event_message_guide/Getting-help (PDF: https://dl.dell.com/content/manual64973867-poweredge-servers-error-and-event-messages-reference-guide.pdf) | 2026-11-20 |
-| SmartFabric OS10 System Log Message Reference | rev. A06, up to 10.6.0.2 | https://www.dell.com/support/manuals/en-us/smartfabric-os10-emp-partner/os10-syslog-reference-guide/view-system-logs | 2026-11-20 |
-| Dell EMC Networking OS Configuration Guide for the S5048F-ON (overtemperature and syslog-server pages) | OS9 9.14.2.8 | linked per record | 2026-11-20 |
-
-- **Identifiers and example lines:**
- - iDRAC uses the EEMI MessageID:
- `<171>Severity: Critical, Category: System Health, MessageID: PSU0003, Message: ...` gives `PSU0003`.
- - OS10 uses `%EVENT_NAME`. The lookup tries both the `%`-prefixed and the bare form.
- `... %log-alert:EQM_MORE_PSU_FAULT: More power supply unit (PSU) fault ...` gives `EQM_MORE_PSU_FAULT`.
- For `INFRA_AFS` sub-events, the second token is the identifier (for example `MAC_LEARN_LIMIT_VIOLATION`).
- - OS9 uses `%FACILITY-SEV-MNEMONIC`, for example `%CHMGR-2-MAJOR_TEMP`.
-- **Severity:**
- - iDRAC: Critical 2, Warning 4, Informational 6.
- - OS10: CRITICAL 2, WARNING 4, INFORMATIONAL 5. OS10 emits informational events as `%log-notice`.
- - OS9: the digit in the mnemonic.
-- **Filtering and gaps:**
- - iDRAC: only messages whose alert types include Remote System Log are included (6,811 of about 9,865 IDs).
- If an ID appears in more than one category, the first occurrence is kept.
- - OS10: event names that cover several messages are merged, with variants joined by ` | ` and the worst
- severity used. CLI errors without an event name are excluded.
- - OS9: there is no public message reference, so only the 4 messages explained in the configuration guide are
- included.
- - PowerSwitch N-series (OS6) is excluded: its messages have no stable identifiers.
- - dell.com/support/manuals returns 403 to scripts. The content came from the public `dl.dell.com` topic HTML,
- read through a browser session.
-
-## Fortinet
-
-**Records: 1,462**: traffic 23, event 1,165, UTM 274. There were no skips or duplicates.
-
-| Document | Version | URL | Retrieved |
-|---|---|---|---|
-| FortiOS Log Message Reference (one page per log message) | FortiOS 7.6.8 | https://docs.fortinet.com/document/fortigate/7.6.8/fortios-log-message-reference | 2026-11-21 |
-| Log ID numbers | 7.6.8 | https://docs.fortinet.com/document/fortigate/7.6.8/fortios-log-message-reference/34314/log-id-numbers | 2026-11-21 |
-| Log ID definitions (type/subtype codes) | 7.6.8 | https://docs.fortinet.com/document/fortigate/7.6.8/fortios-log-message-reference/656858/log-id-definitions | 2026-11-21 |
-| FortiOS priority levels | 7.6.8 | https://docs.fortinet.com/document/fortigate/7.6.8/fortios-log-message-reference/446022/fortios-priority-levels | 2026-11-21 |
-
-- **Identifier:** the 10-digit `logid` value with leading zeros: 2-digit type + 2-digit subtype (the UTM
- `eventtype`) + 6-digit message ID. In `... logid="0100032001" type="event" subtype="system" ...`, the token is
- `0100032001`.
-- **Severity:** the documented level: Emergency 0, Alert 1, Critical 2, Error 3, Warning 4, Notice 5,
- Information 6, Debug 7.
-- **Gaps and notes:**
- - The full 10-digit IDs are not printed in the reference. They are derived from the documented codes and were
- checked against known IDs (`0000000013`, `0100032001`, `0211008192`, `0316013056`, `0419016384`,
- `0720018432`, `1059028704`).
- - `message` is the documented Message Meaning (the `logdesc` value).
- - `explanation` is generated from the type/subtype, logid, ID name, meaning and level.
- - `recommended_action` is always empty because the reference documents no operator actions.
- - Fortinet notes that `level` is not always uniform. Bare numeric IDs can collide with other numbers, so rely
- on vendor scoping.
-
-## HPE
-
-**Records: 4,883**. Comware 7 412, Comware 5 846, AOS-CX and ArubaOS-Switch as listed below. The source file
-had 5,578 records: the build drops the 694 without a description and one case-only duplicate
-(`%10QOS/4/QOS_POLICY_APPLYVLAN_CBFAIL`, kept as the Comware 7 `%10QoS/...` record).
-
-| Document | Version | Doc ID | URL | Retrieved |
-|---|---|---|---|---|
-| HP 5920 & 5900 Switch Series System Log Messages Reference (2014) | Comware 7 | c04532301 | https://support.hpe.com/hpesc/public/docDisplay?docId=c04532301 | 2026-11-20 (re-fetched 2026-11-21) |
-| HP FlexFabric 12900 Switch Series System Log Messages Reference (2014); 8 records not in the 5900 guide | Comware 7 | c04532292 | https://support.hpe.com/hpesc/public/docDisplay?docId=c04532292 | 2026-11-20 (re-fetched 2026-11-21) |
-| HP 5500 EI & 5500 SI Switch Series System Log Messages Reference (2014); only messages not in Comware 7 | Comware 5 | c04532298 | https://support.hpe.com/hpesc/public/docDisplay?docId=c04532298 | 2026-11-20 (re-fetched 2026-11-21) |
-| AOS-CX Event Log Message Reference Guide (All Switch Series) | AOS-CX 10.17 | sd00007159en_us | https://support.hpe.com/hpesc/public/docDisplay?docId=sd00007159en_us | 2026-11-20 (re-fetched 2026-11-21) |
-| Aruba Event Log Message Reference Guide for ArubaOS-Switch | AOS-S 16.10 | a00093582en_us | https://support.hpe.com/hpesc/public/docDisplay?docId=a00093582en_us | 2026-11-20 (re-fetched 2026-11-21) |
-
-- **Identifiers:**
- - Comware: `%10MODULE/LEVEL/MNEMONIC`.
- `<187>Nov 20 17:00:00 2026 SW1 %%10IFNET/3/PHY_UPDOWN: Ethernet0/0: link status is down.` gives
- `%10IFNET/3/PHY_UPDOWN`. The tokenizer allows only one leading `%`.
- - AOS-CX: the plain event ID.
- `... Event|4701|LOG_INFO|||User user1 added user2 ...` gives `4701`.
- - AOS-S: the event ID zero-padded to 5 digits.
- `<14>Jan 1 00:15:35 10.0.0.2 00076 ports: port 2 is now on-line` gives `00076`.
-- **Severity:**
- - Comware: the documented level 0-7. For 11 Comware 5 messages whose severity row disagrees with the example,
- both token forms are present.
- - AOS-CX: EMERG 0 … DEBUG 7.
- - AOS-S: Information 6, Warning 4, Debug 7, and Fatal 2 (an interpretation). AOS-S "None" and "Standard" are
- `null`.
-- **Filtering and gaps:**
- - **694 events are omitted** (689 ArubaOS-Switch, 5 AOS-CX) because the guides give no description and no
- action for them. The source blocks were re-checked: the tables end at Message/Platforms/Category/Severity
- with no Description row. For example, AOS-S `00213`–`00215`, `03077`, `05316`, and AOS-CX `405`, `8809` and
- `5401`–`5403`. The importer would reject them.
- - **Comware 5 parsing fix:** in the narrow label column of the 5500 PDF, labels wrap mid-word (`Explanati`/`on`,
- `Recommende`/`d action`). The original parser left 5 records empty and put the action text into the
- explanation of 28 others. A re-parse that tolerates line breaks inside labels, keyed by MODULE/MNEMONIC,
- fixed these 33 records. The 5900 and 12900 guides have no split labels.
- - The AOS-CX and AOS-S guides contain no recommended actions, so `recommended_action` is empty for those
- families.
- - The Comware guides are 2014 HP editions. No newer public HPE Comware log references were found, and H3C
- guides were not used.
- - Comware 5 mnemonics that contain spaces were skipped.
- - HPE iLO and server messages are out of scope.
- - Numeric AOS-CX/AOS-S IDs can collide with other numbers in a message.
- - arubanetworking.hpe.com returns 403 to scripts. All documents were fetched through the public HPE Support
- Center API.
-
-## Huawei
-
-**Records: 3,686** (about 180 modules).
-
-| Priority | Document | Release | nid | Records | Retrieved |
-|---|---|---|---|---|---|
-| 1 | CloudEngine S16700 Log Reference | V600R024C10 | EDOC1100459363 | 1,689 | 2026-11-20 |
-| 2 | CloudEngine 9800, 8800, and 6800 Log Reference (only logs not in #1) | V300R026C00 | EDOC1100613732 | 296 | 2026-11-20 |
-| 3 | S1720, S2700, S5700, and S6720 Log Reference | V200R011C10 | EDOC1000178180 | 1,701 | 2026-11-20 |
-
-- References use the form `https://support.huawei.com/enterprise/en/doc///`. VRP5 records
- link to the module page.
-- **Identifier:** `%01MODULE/SEVERITY/MNEMONIC`, with the mnemonic's case kept as documented.
- `2020-08-18 18:08:56 HUAWEI %%01CLI/5/LOGIN(l):CID=2160731923;VTY0 login from 192.168.0.1 succeed.` gives
- `%01CLI/5/LOGIN`.
-- **Severity:** the level in the mnemonic (0-7), which is already RFC 5424.
-- **Gaps and notes:**
- - support.huawei.com returned 403 (Akamai) from the build host. The same documents were fetched from Huawei's
- regional mirror of the documentation API at `https://support.huawei.ru/supportgateway/view/v1/enterprise/doc/...`.
- About 2,130 pages were fetched, 1.5 s apart.
- - The CE V200R005C10 (EDOC1100074768), CE V200R021C00 (EDOC1100219294) and AR600/AR6000 V300R021
- (EDOC1100203218) references return "unreleased" or are blocked, so there are no AR- or NE-specific documents.
- - The WLAN and PKI modules of the V600/V300 documents were skipped.
- - If the same identifier is in more than one document, the higher-priority document wins. Within a VRP5 module,
- the first variant is kept.
- - `FECD/5/PARITY ERROR` was skipped because its mnemonic contains a space.
- - Lines with a format version other than `%%01`, or without the `%%dd` header, will not match.
-
## Linux
**Records: 102** (systemd's own journal messages: units and jobs, PID 1, journald, logind sessions and seats,
@@ -344,118 +170,3 @@ contrib/recommendations/build_catalogues.py linux-curated < contrib/recommendati
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
-
-**Records: 11.** MikroTik publishes no catalogue of RouterOS log messages, and RouterOS has no message IDs.
-MikroTik support confirmed that "such a list is not something we can provide" (forum thread
-https://forum.mikrotik.com/t/271114). Records exist only where a documented message contains a distinctive
-single token.
-
-| Document | URL | Records used | Retrieved |
-|---|---|---|---|
-| IPsec (Troubleshooting/FAQ) | https://help.mikrotik.com/docs/spaces/ROS/pages/11993097/IPsec | `hashtype`, `enctype` | 2026-11-21 |
-| Ethernet (Forced Mode) | https://help.mikrotik.com/docs/spaces/ROS/pages/8323191/Ethernet | `auto-initialization` | 2026-11-21 |
-| PoE-Out (PoE-Out Logs) | https://help.mikrotik.com/docs/spaces/ROS/pages/19136769/PoE-Out | `hw-limit`, `class-limit` | 2026-11-21 |
-| Log | https://help.mikrotik.com/docs/spaces/ROS/pages/328094/Log | `deassigned`, `KeepaliveTimer` | 2026-11-21 / 2026-11-22 |
-| manual.mikrotik.com VRRP page (v7.26) | manual.mikrotik.com | `CTSYNC` | 2026-11-22 |
-| manual.mikrotik.com Bridging and Switching page | manual.mikrotik.com | `bpdu-guard` | 2026-11-22 |
-| manual.mikrotik.com PoE-out page | manual.mikrotik.com | `current-too-low`, `voltage-on-poe-in` | 2026-11-22 |
-
-- **Identifier:** a distinctive token in the message text.
- `interface,warning sfp-sfpplus1 module auto-initialization failed, try forced-mode` gives `auto-initialization`.
-- **Severity:** the topic in the documented example line maps to critical 2, error 3, warning 4, info 6,
- debug 7. Severity is `null` when the documented line has no severity topic (`hashtype`, `enctype`). The actual
- syslog severity depends on `/system logging action syslog-severity`.
-- **Filtering and gaps:**
- - The source had 19 records. The build excludes 8 identifiers that are too generic: `ph1`, `phase1`,
- `CONNTRACK`, `CME`, `fcs`, `cmd-failed`, `NO-PROPOSAL-CHOSEN`, `3way`.
- - Most RouterOS messages are plain English (login failure, link up/down, assigned), and topic names appear on
- every line, so neither can be used as an identifier.
- - The forum, third-party parsers, changelogs and `.npk` binaries were not used as sources.
- - The PoE status template comes from the documented `status: on` example. `KeepaliveTimer` is a v6-era debug
- line.
- - Wording can differ between RouterOS v6 and v7. Several records have no documented action.
-
-## Nokia
-
-**Records: 2,016** (83 SR OS applications).
-
-| Document | Release | Document ID | URL | Retrieved |
-|---|---|---|---|---|
-| SR OS Log Events Guide (HTML, one page per application) | 25.10.R1 | — | https://documentation.nokia.com/sr/25-10/7750-sr/titles/log-events.html | 2026-11-21 |
-| SR OS Log Events Guide (PDF; used only to check the event count, 2,044 tables) | 25.10.R1 | 3HE 21208 AAAD TQZZA 01 | https://documentation.nokia.com/sr/25-10/7750-sr/pdf/Log_Events_Guide_25.10.R1.pdf | 2026-11-21 |
-| System Management Guide, "Syslog implementation overview" | 22.2.R1 | — | https://infocenter.nokia.com/public/7750SR222R1A/topic/com.nokia.System_Mgmt_Guide/syslog_implemen-ai9exj5x1i.html | 2026-11-21 |
-
-- References point to the application page plus the event anchor, for example `log-snmp.html#evnt1623`.
-- **Identifier:** `APPLICATION-SEVERITY-EventName-EventID`, using the default severity.
- `<188>Jan 2 18:43:23 10.221.38.108 TMNX: 17 Base SYSTEM-WARNING-tmnxStateChange-2009 [CHASSIS]: ...` gives
- `SYSTEM-WARNING-tmnxStateChange-2009`.
-- **Severity:** critical 2, major 3, minor 4, warning 4, cleared 6, indeterminate 6. Nokia's own syslog PRI
- mapping differs: critical 1, major 2, minor 3.
-- **Filtering and gaps:**
- - 28 events whose Cause, Effect and Recovery are all "N/A" are omitted.
- - 706 records have no action.
- - 7210 SAS and SR Linux are not covered. SR Linux lines carry no stable event token.
- - If an operator changes a severity with `log event-control`, the token changes and will not match.
- - The words `CLEARED`, `INDETERMINATE` and `CRITICAL` in tokens are assumed by analogy; no example shows them.
-
-## NVIDIA
-
-**Records: 251**: Cumulus `switchd` 121, Cumulus FRR error categories 128, GPU `Xid` 1, NVSwitch `SXid` 1.
-
-| Document | Version | URL | Retrieved |
-|---|---|---|---|
-| switchd Log Message Reference | Cumulus Linux 5.18 | https://docs.nvidia.com/networking-ethernet-software/cumulus-linux-518/Monitoring-and-Troubleshooting/switchd-Log-Message-Reference/ | 2026-11-20 |
-| FRRouting Log Message Reference | Cumulus Linux 5.18 | https://docs.nvidia.com/networking-ethernet-software/cumulus-linux-518/Monitoring-and-Troubleshooting/FRRouting-Log-Message-Reference/ | 2026-11-20 |
-| Xid Errors (Working with / Analyzing Xid Errors) | latest | https://docs.nvidia.com/deploy/xid-errors/latest/working-with-xid-errors.html | 2026-11-20 |
-| Fabric Manager User Guide, NVSwitch SXid errors | — | https://docs.nvidia.com/datacenter/tesla/fabric-manager-user-guide/index.html#nvswitch-sxid-errors | 2026-11-20 |
-
-- **Identifiers:**
- - switchd: the C symbol in the message text. In `switchd[1234]: .c: _range_limits_get: ...`, it is
- `_range_limits_get`.
- - FRR: the `[EC n]` number. `bgpd[1559]: [EC 33554454] ...` gives `33554454`.
- - GPU and NVSwitch: the family tokens `Xid` and `SXid`.
-- **Severity:**
- - switchd: CRITICAL 2, ERROR 3, WARNING 4. Merged records use the most severe level.
- - FRR: 3, because these are logged through `flog_err` at LOG_ERR.
- - Xid/SXid: `null`, because the docs state no syslog priority.
-- **Filtering and gaps:**
- - 677 of 835 distinct switchd messages have no distinctive token and are omitted. 19 records merge messages
- that share a token. `vlan_range_confi`, which looks truncated, was dropped.
- - FRR records give the category title, not the exact log text.
- - There are no per-code Xid/SXid records, because bare numbers would collide.
- - Onyx, UFM, NVSM/DGX, SONiC, NVOS and BlueField are excluded: there is no stable token in syslog or no public
- reference.
- - `sx_api_*` symbols may also appear in other software built on the Spectrum SDK.
-
-## Palo Alto Networks
-
-**Records: 364** (PAN-OS / Panorama System log).
-
-| Document | URL | Retrieved |
-|---|---|---|
-| Syslog Severity Reference (System Log Reference), with the critical/high/medium/low/informational pages | https://docs.paloaltonetworks.com/ngfw/administration/monitoring/use-syslog-for-monitoring/system-log-reference | 2026-11-21 |
-| System Log Fields | https://docs.paloaltonetworks.com/ngfw/administration/monitoring/use-syslog-for-monitoring/syslog-field-descriptions/system-log-fields | 2026-11-21 |
-| Master Key help page (PAN-OS 11.1); source of the `mkey-*` actions | https://docs.paloaltonetworks.com/ngfw/help/11-1/device/device-master-key-and-diagnostics | 2026-11-21 |
-| Knowledge Base articles kA1Ki000000TO8lKAG, kA14u0000004O9QCAU, kA14u000000g1HpCAI, kA10g000000CloXCAS, kA10g000000PNcBCAW, kA14u000000CqYPCA0, kA1Ki000000TNN1KAO, kA10g000000PMK1CAO, kA14u000000wkqJCAQ | linked per record | 2026-11-21 |
-
-- The reference pages describe current PAN-OS (10.1–12.2 selectable).
-- **Identifier:** the Event ID (CSV field 9). Commas end tokens.
- `... SYSTEM,vpn,0,2026/11/20 17:00:01,,tunnel-status-down,IPSEC-Tunnel-Primary,...` gives `tunnel-status-down`.
-- **Severity:** the severity page maps as critical 2, high 3, medium 4, low 5, informational 6. Severity is
- `null` when an ID is documented at more than one severity.
-- **Filtering and gaps:**
- - The source had 398 records. The build excludes the 34 generic identifiers listed under [Build](#build),
- including some KB-backed ones such as `link-change`, `state-change` and `fan-failure`.
- - Excluded during extraction:
- - generic one-word IDs (`general`, `auth`, `api`, `cli`, `gnmi`, `connect`, `initiate`, `terminate`,
- `restart`, `sync`, `N/A`);
- - IDs that contain spaces;
- - IDs whose message is only placeholders;
- - two `user-password-change-*` IDs whose documented text does not match the ID.
- - Explanations are generated from the documented message, subtype and severity. About 15 are hand-written
- from KB/doc material.
- - Recommended actions exist only where a KB or doc page gives steps, which is 12 records in the source.
- - The vendor tables are partly inconsistent. HA coverage is thin: only KB-evidenced IDs are included, and
- `ha-link-down` was not found. GlobalProtect `eventid` values are not documented.
diff --git a/docs/VENDOR_COLLECTORS.md b/docs/VENDOR_COLLECTORS.md
new file mode 100644
index 00000000..d156da3c
--- /dev/null
+++ b/docs/VENDOR_COLLECTORS.md
@@ -0,0 +1,217 @@
+# Building vendor recommendation catalogues
+
+The Syslog plugin ships only openly licensed recommendation catalogues (see
+[Recommendation sources and licensing](../README.md#recommendation-sources-and-licensing)).
+Network vendors publish their system log message references under terms that
+allow reading and internal use but not redistribution, so the plugin cannot
+include catalogues built from them.
+
+The scripts in [contrib/recommendations/vendors/](../contrib/recommendations/vendors/)
+let each site build these catalogues itself, from the vendor's own published
+documentation, and import them on its own Recommendations page. The scripts are
+part of the plugin and licensed GPL-2.0-or-later; **the catalogues they produce
+are not**. A catalogue you build is a copy of the vendor's text and stays under
+the vendor's terms:
+
+- Use it within your own organisation.
+- Do not redistribute it, commit it to a repository, attach it to issues or
+ publish it.
+- Keep it outside the plugin directory, so it is not copied with the plugin.
+ The scripts warn if the output path is inside the plugin.
+
+Every catalogue a script writes records its source, the vendor's copyright and
+license reference, and that notice in its `copyright`, `license`,
+`license_url`, `source` and `notice` fields. The plugin's importer ignores those
+fields.
+
+This page describes how to run the scripts and is not legal advice. Check the
+vendor's current terms of use before you build or use a catalogue.
+
+## Requirements
+
+- Python 3.9 or later.
+- `pypdf` and `pdfminer.six` for the scripts that read PDF documents (Arista,
+ Dell, Fortinet `--pdf`, HPE and Huawei):
+ `pip install --user pypdf pdfminer.six`.
+- Internet access for the scripts that download documentation, or the vendor
+ documents saved with a browser for those that cannot.
+
+The scripts do not need Cacti or the plugin and can run on any machine; copy
+the output to a workstation and import it from the browser.
+
+## Common options
+
+All scripts share these options:
+
+| Option | Meaning |
+|--------|---------|
+| `-o FILE`, `--output FILE` | Catalogue to write (required). A name ending in `.gz` is compressed. Keep it outside the plugin directory. |
+| `--cache DIR` | Where downloaded pages are kept (default `~/.cache/cacti-syslog-collectors`). An interrupted run resumes from the cache, and later runs are fast. |
+| `--delay SECONDS` | Pause between requests (default 1.5). A site's own `Crawl-delay` is honoured if it is longer. |
+| `--limit N` | Stop after N pages or documents; useful for a quick test. |
+
+Files and directories named on the command line (the output, the cache, and a
+script's `--pdf`, `--file` or `--from`) must be inside your home directory, the
+working directory or the system temporary directory; anything else is refused.
+Downloads are made over HTTPS from the vendor's own documentation hosts only.
+
+The scripts identify themselves with their own User-Agent, obey each site's
+`robots.txt` (a site whose `robots.txt` cannot be read is not fetched from),
+space retries by at least the request delay, and never try to get around a
+block, login or paywall. A run that collects no records exits with an error and
+leaves an existing output file unchanged. When a
+site does not allow scripted downloads, the script says so and asks for files
+you saved with a browser.
+
+## Vendors
+
+| Vendor | Script | Source | How the documents are obtained | Approximate result |
+|--------|--------|--------|--------------------------------|--------------------|
+| Arista | `collect_arista.py` | EOS System Message Guide (PDF) | You download the guide from Arista's support portal (login required) and pass it with `--pdf` | About 1,050 records from the 4.15 guide |
+| Cisco | `collect_cisco.py` | Cisco Error Message Database (CEMDB) dump in the php-syslog-ng project | Downloaded from GitHub, pinned to a commit; `--file` reads another copy | About 27,300 records |
+| Dell | `collect_dell.py` | PowerEdge Error and Event Messages Reference (EEMI) and SmartFabric OS10 System Log Message Reference (PDFs) | You download both PDFs with a browser (Dell does not allow scripted downloads) | About 7,100 records, about 4.5 minutes for the first run |
+| Fortinet | `collect_fortinet.py` | FortiOS Log Message Reference (`--version`, default 7.6.8) | Fetched page by page from docs.fortinet.com, or read from the reference's PDF with `--pdf` | About 1,460 records; about 70 minutes page by page, 1 minute from the PDF |
+| HPE | `collect_hpe.py` | Comware 7, Comware 5, AOS-CX and ArubaOS-Switch log message references | Fetched from the HPE Support Center; `--from DIR` reads saved copies | About 4,900 records, about 6 minutes |
+| Huawei | `collect_huawei.py` | CloudEngine and S-series Log References | You save the documents with a browser (Huawei does not allow scripted downloads) and pass `--from DIR` | Depends on the documents saved |
+| Juniper | `collect_juniper.py` | Juniper System Log Explorer (Junos OS and Junos OS Evolved) | Fetched from the explorer's public data | About 6,900 records, about 3 hours |
+| Nokia | `collect_nokia.py` | SR OS Log Events Guide (`--release`, default 25-10) | Fetched from documentation.nokia.com | About 2,000 records, about 3 minutes |
+| NVIDIA | `collect_nvidia.py` | Cumulus Linux switchd and FRRouting log message references, Xid errors, Fabric Manager SXid errors | Fetched from docs.nvidia.com and NVIDIA's public Cumulus documentation repository | About 260 records, seconds |
+| Palo Alto Networks | `collect_paloalto.py` | PAN-OS System Log Reference | Fetched from docs.paloaltonetworks.com | About 360 records, seconds |
+
+Counts and times depend on the document versions and your connection. Each
+script's header describes its sources, identifier form, severity mapping and
+any records it leaves out; run a script with `--help` for its options.
+
+### Arista
+
+```sh
+python3 contrib/recommendations/vendors/collect_arista.py \
+ --pdf ~/Downloads/EOS-System-Message-Guide.pdf -o ~/catalogues/arista.json.gz
+```
+
+Sign in to Arista's support portal and download the EOS System Message Guide.
+`--pdf` may be repeated to combine guides for several releases; a message found
+in an earlier file wins. `--reference URL` records where you obtained the guide.
+The script downloads nothing.
+
+### Cisco
+
+```sh
+python3 contrib/recommendations/vendors/collect_cisco.py -o ~/catalogues/cisco.json.gz
+```
+
+Downloads `html/install/sql/cemdb.sql.gz` from the
+[daedalus/php-syslog-ng](https://github.com/daedalus/php-syslog-ng) repository
+at a pinned commit, the same source as earlier releases of this catalogue. The
+repository's license covers the php-syslog-ng code; the message texts remain
+Cisco's. Use `--file` for a local copy of the dump, such as one downloaded from another mirror.
+
+### Dell
+
+```sh
+python3 contrib/recommendations/vendors/collect_dell.py -o ~/catalogues/dell.json.gz \
+ --pdf ~/Downloads/poweredge-eemi.pdf --os10-pdf ~/Downloads/os10-syslog-reference.pdf
+```
+
+Download with a browser:
+
+- [PowerEdge Servers Error and Event Messages Reference Guide](https://dl.dell.com/content/manual64973867-poweredge-servers-error-and-event-messages-reference-guide.pdf)
+- [Dell SmartFabric OS10 System Log Message Reference](https://dl.dell.com/content/manual23434279-dell-smartfabric-os10-system-log-message-reference.pdf)
+
+Alternatively put the PDFs, or OS10 topic pages saved with "Save Page As", in a
+directory and pass `--from DIR`. Only EEMI messages that iDRAC can send to a
+remote syslog server are kept. OS9 messages are not collected.
+
+### Fortinet
+
+```sh
+python3 contrib/recommendations/vendors/collect_fortinet.py -o ~/catalogues/fortinet.json.gz \
+ --pdf ~/Downloads/FortiOS_7.6.8_Log_Reference.pdf
+```
+
+Without `--pdf` the script fetches every message page of the reference, which
+takes over an hour because docs.fortinet.com asks for two seconds between
+requests. The PDF, saved from the reference's "Download PDF" link, gives the
+same records in about a minute. The identifier is the 10-digit `logid`.
+
+### HPE
+
+```sh
+python3 contrib/recommendations/vendors/collect_hpe.py -o ~/catalogues/hpe.json.gz
+```
+
+`--doc` selects documents (`c7-5900`, `c7-12900`, `c5-5500`, `aoscx`, `aoss`, or
+their docIds). If the HPE Support Center refuses scripted access, save the
+documents with a browser as `.pdf` (or the AOS-CX pages as
+`.html` or `/*.html`) and pass `--from DIR`.
+
+### Huawei
+
+```sh
+python3 contrib/recommendations/vendors/collect_huawei.py --from ~/huawei-docs \
+ -o ~/catalogues/huawei.json.gz
+```
+
+Huawei's `robots.txt` does not allow scripts, so save these Log References with
+a browser, each in a subdirectory named after its document ID:
+
+- `EDOC1100459363`: [CloudEngine S16700 Log Reference](https://support.huawei.com/enterprise/en/doc/EDOC1100459363)
+- `EDOC1100613732`: [CloudEngine 9800, 8800, and 6800 Log Reference](https://support.huawei.com/enterprise/en/doc/EDOC1100613732)
+- `EDOC1000178180`: [S1720, S2700, S5700, and S6720 Log Reference](https://support.huawei.com/enterprise/en/doc/EDOC1000178180)
+
+Use the document's Download button (a `.zip`, an unpacked `.chm` or a `.pdf`),
+or "Save Page As" on each log topic. The script header has the details. This
+parser has been tested only on sample pages, not on a complete download; please
+report any document it fails to read.
+
+### Juniper
+
+```sh
+python3 contrib/recommendations/vendors/collect_juniper.py -o ~/catalogues/juniper.json.gz
+```
+
+By default the script collects the newest and oldest release of Junos OS and
+Junos OS Evolved listed by the Juniper System Log Explorer: about 6,900
+messages, each needing one request, so a full run takes about three hours at
+the default delay. Narrow it with `--product junos` or `--release 24.4R2`, and
+rerun after an interruption to continue from the cache.
+
+### Nokia
+
+```sh
+python3 contrib/recommendations/vendors/collect_nokia.py -o ~/catalogues/nokia.json.gz
+```
+
+The identifier is `APPLICATION-SEVERITY-EventName-EventID`, with the event's
+default severity. Use `--release` (for example `24-10`) for another SR OS
+documentation release.
+
+### NVIDIA
+
+```sh
+python3 contrib/recommendations/vendors/collect_nvidia.py -o ~/catalogues/nvidia.json.gz
+```
+
+The Cumulus Linux documentation is licensed CC BY-NC-SA 4.0 (non-commercial,
+share-alike); the Xid and Fabric Manager pages are under NVIDIA's terms of
+service. Use `--cumulus-release` (for example `517`) for another Cumulus Linux
+release.
+
+### Palo Alto Networks
+
+```sh
+python3 contrib/recommendations/vendors/collect_paloalto.py -o ~/catalogues/paloalto.json.gz
+```
+
+Generic event IDs such as `auth-fail` and `link-down`, which other vendors'
+messages also contain, are left out. Records have no recommended action.
+
+## Importing a catalogue
+
+1. Copy the catalogue to the machine you browse from.
+2. In Cacti, open Console > Syslog Settings > Recommendations.
+3. Choose Import and select the file. Both `.json` and `.json.gz` are accepted.
+
+Records are keyed by vendor and identifier, so importing a newer build replaces
+the matching records. To remove a vendor's records, filter the Recommendations
+page by that vendor and use the Delete action.
diff --git a/docs/arista.json.gz b/docs/arista.json.gz
deleted file mode 100644
index c3c2bd65..00000000
Binary files a/docs/arista.json.gz and /dev/null differ
diff --git a/docs/arista.json.gz.license b/docs/arista.json.gz.license
deleted file mode 100644
index 6524f09c..00000000
--- a/docs/arista.json.gz.license
+++ /dev/null
@@ -1,2 +0,0 @@
-SPDX-FileCopyrightText: Arista Networks, Inc.
-SPDX-License-Identifier: LicenseRef-Arista-Terms-of-Use
diff --git a/docs/cisco.json.gz b/docs/cisco.json.gz
deleted file mode 100644
index e49987ea..00000000
Binary files a/docs/cisco.json.gz and /dev/null differ
diff --git a/docs/cisco.json.gz.license b/docs/cisco.json.gz.license
deleted file mode 100644
index 3b8bde4e..00000000
--- a/docs/cisco.json.gz.license
+++ /dev/null
@@ -1,2 +0,0 @@
-SPDX-FileCopyrightText: Cisco Systems, Inc. and/or its affiliates
-SPDX-License-Identifier: LicenseRef-Cisco-Terms-of-Use
diff --git a/docs/dell.json.gz b/docs/dell.json.gz
deleted file mode 100644
index 59d1d2d4..00000000
Binary files a/docs/dell.json.gz and /dev/null differ
diff --git a/docs/dell.json.gz.license b/docs/dell.json.gz.license
deleted file mode 100644
index b88f933b..00000000
--- a/docs/dell.json.gz.license
+++ /dev/null
@@ -1,2 +0,0 @@
-SPDX-FileCopyrightText: Dell Inc. or its subsidiaries
-SPDX-License-Identifier: LicenseRef-Dell-Terms-of-Use
diff --git a/docs/fortinet.json.gz b/docs/fortinet.json.gz
deleted file mode 100644
index 66a6bc9a..00000000
Binary files a/docs/fortinet.json.gz and /dev/null differ
diff --git a/docs/fortinet.json.gz.license b/docs/fortinet.json.gz.license
deleted file mode 100644
index e091338a..00000000
--- a/docs/fortinet.json.gz.license
+++ /dev/null
@@ -1,2 +0,0 @@
-SPDX-FileCopyrightText: Fortinet, Inc.
-SPDX-License-Identifier: LicenseRef-Fortinet-Terms-of-Use
diff --git a/docs/hpe.json.gz b/docs/hpe.json.gz
deleted file mode 100644
index 25cf6a0a..00000000
Binary files a/docs/hpe.json.gz and /dev/null differ
diff --git a/docs/hpe.json.gz.license b/docs/hpe.json.gz.license
deleted file mode 100644
index 7ed7af32..00000000
--- a/docs/hpe.json.gz.license
+++ /dev/null
@@ -1,2 +0,0 @@
-SPDX-FileCopyrightText: Hewlett Packard Enterprise Development LP
-SPDX-License-Identifier: LicenseRef-HPE-Terms-of-Use
diff --git a/docs/huawei.json.gz b/docs/huawei.json.gz
deleted file mode 100644
index 23a48f06..00000000
Binary files a/docs/huawei.json.gz and /dev/null differ
diff --git a/docs/huawei.json.gz.license b/docs/huawei.json.gz.license
deleted file mode 100644
index 5e2affd2..00000000
--- a/docs/huawei.json.gz.license
+++ /dev/null
@@ -1,2 +0,0 @@
-SPDX-FileCopyrightText: Huawei Technologies Co., Ltd.
-SPDX-License-Identifier: LicenseRef-Huawei-Terms-of-Use
diff --git a/docs/juniper.json.gz b/docs/juniper.json.gz
deleted file mode 100644
index 5c5a1fe3..00000000
Binary files a/docs/juniper.json.gz and /dev/null differ
diff --git a/docs/juniper.json.gz.license b/docs/juniper.json.gz.license
deleted file mode 100644
index 17a21b3b..00000000
--- a/docs/juniper.json.gz.license
+++ /dev/null
@@ -1,2 +0,0 @@
-SPDX-FileCopyrightText: Juniper Networks, Inc.
-SPDX-License-Identifier: LicenseRef-Juniper-Terms-of-Use
diff --git a/docs/mikrotik.json.gz b/docs/mikrotik.json.gz
deleted file mode 100644
index 7dc5d2fb..00000000
Binary files a/docs/mikrotik.json.gz and /dev/null differ
diff --git a/docs/mikrotik.json.gz.license b/docs/mikrotik.json.gz.license
deleted file mode 100644
index 28ae7f04..00000000
--- a/docs/mikrotik.json.gz.license
+++ /dev/null
@@ -1,2 +0,0 @@
-SPDX-FileCopyrightText: SIA Mikrotikls (MikroTik)
-SPDX-License-Identifier: LicenseRef-MikroTik-Documentation
diff --git a/docs/nokia.json.gz b/docs/nokia.json.gz
deleted file mode 100644
index 3408be01..00000000
Binary files a/docs/nokia.json.gz and /dev/null differ
diff --git a/docs/nokia.json.gz.license b/docs/nokia.json.gz.license
deleted file mode 100644
index 35af3b2e..00000000
--- a/docs/nokia.json.gz.license
+++ /dev/null
@@ -1,2 +0,0 @@
-SPDX-FileCopyrightText: Nokia
-SPDX-License-Identifier: LicenseRef-Nokia-Terms-of-Use
diff --git a/docs/nvidia.json.gz b/docs/nvidia.json.gz
deleted file mode 100644
index 36e723b2..00000000
Binary files a/docs/nvidia.json.gz and /dev/null differ
diff --git a/docs/nvidia.json.gz.license b/docs/nvidia.json.gz.license
deleted file mode 100644
index 44ce5c55..00000000
--- a/docs/nvidia.json.gz.license
+++ /dev/null
@@ -1,2 +0,0 @@
-SPDX-FileCopyrightText: NVIDIA Corporation & affiliates
-SPDX-License-Identifier: CC-BY-NC-SA-4.0 AND LicenseRef-NVIDIA-Terms-of-Service
diff --git a/docs/paloalto.json.gz b/docs/paloalto.json.gz
deleted file mode 100644
index b4d834f1..00000000
Binary files a/docs/paloalto.json.gz and /dev/null differ
diff --git a/docs/paloalto.json.gz.license b/docs/paloalto.json.gz.license
deleted file mode 100644
index d1d3b66f..00000000
--- a/docs/paloalto.json.gz.license
+++ /dev/null
@@ -1,2 +0,0 @@
-SPDX-FileCopyrightText: Palo Alto Networks, Inc.
-SPDX-License-Identifier: LicenseRef-PaloAltoNetworks-Terms-of-Use
diff --git a/manifest.json b/manifest.json
index da85c626..35837f86 100644
--- a/manifest.json
+++ b/manifest.json
@@ -6,6 +6,28 @@
"cli/updatedb_convert_ms.php",
"compatibility.php",
"database.php",
+ "docs/arista.json.gz",
+ "docs/arista.json.gz.license",
+ "docs/cisco.json.gz",
+ "docs/cisco.json.gz.license",
+ "docs/dell.json.gz",
+ "docs/dell.json.gz.license",
+ "docs/fortinet.json.gz",
+ "docs/fortinet.json.gz.license",
+ "docs/hpe.json.gz",
+ "docs/hpe.json.gz.license",
+ "docs/huawei.json.gz",
+ "docs/huawei.json.gz.license",
+ "docs/juniper.json.gz",
+ "docs/juniper.json.gz.license",
+ "docs/mikrotik.json.gz",
+ "docs/mikrotik.json.gz.license",
+ "docs/nokia.json.gz",
+ "docs/nokia.json.gz.license",
+ "docs/nvidia.json.gz",
+ "docs/nvidia.json.gz.license",
+ "docs/paloalto.json.gz",
+ "docs/paloalto.json.gz.license",
"docs/recommendations.sql.gz",
"functions.php",
"html/",
diff --git a/tests/Unit/RecommendationsTest.php b/tests/Unit/RecommendationsTest.php
index 764c16c6..99edc0e5 100644
--- a/tests/Unit/RecommendationsTest.php
+++ b/tests/Unit/RecommendationsTest.php
@@ -306,17 +306,6 @@ function recommendation_sample(array $override = []): array {
->and(hash('sha256', json_encode($parsed['records'])))->toBe($digest)
->and(array_unique(array_column($parsed['records'], 'vendor')))->toBe([$vendor]);
})->with([
- 'Cisco' => ['cisco.json.gz', 'Cisco', 27318],
- 'Juniper' => ['juniper.json.gz', 'Juniper', 14],
- 'Arista' => ['arista.json.gz', 'Arista', 1047],
- 'Dell' => ['dell.json.gz', 'Dell', 7142],
- 'HPE' => ['hpe.json.gz', 'HPE', 4883],
- 'Huawei' => ['huawei.json.gz', 'Huawei', 3686],
- 'NVIDIA' => ['nvidia.json.gz', 'NVIDIA', 251],
- 'Nokia' => ['nokia.json.gz', 'Nokia', 2016],
- 'Fortinet' => ['fortinet.json.gz', 'Fortinet', 1462],
- '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 (curated)' => ['linux-curated.json.gz', 'Linux', 70]
diff --git a/tests/bin/patch-coverage.php b/tests/bin/patch-coverage.php
index ac2664a5..c9a93439 100644
--- a/tests/bin/patch-coverage.php
+++ b/tests/bin/patch-coverage.php
@@ -227,6 +227,7 @@ function changed_lines($base_ref) {
'cli/index.php',
'contrib/index.php',
'contrib/recommendations/index.php',
+ 'contrib/recommendations/vendors/index.php',
'includes/index.php',
'lib/index.php',
// Web and CLI entry points: each chdir()s and includes auth.php (or runs