Skip to content

feature: Add Arista, Dell, HPE, Huawei and NVIDIA recommendation catalogues with vendor-scoped matching - #477

Open
TheWitness wants to merge 2 commits into
developfrom
feature/vendor-recommendation-catalogues
Open

TheWitness wants to merge 2 commits into
developfrom
feature/vendor-recommendation-catalogues

Conversation

@TheWitness

@TheWitness TheWitness commented Nov 20, 2026 •

Copy link
Copy Markdown
Member

Summary

Adds manually importable recommendation catalogues for five more vendors, in the same syslog-recommendations JSON format as docs/juniper.json.gz (follow-up to #469). Also makes the recommendation lookup vendor-aware, so one vendor's short or numeric codes don't match another vendor's messages.

New catalogues (docs/<vendor>.json.gz, not auto-installed)

File Records Source (public vendor references) Identifier form
arista.json.gz 1,047 EOS System Message Guide (EOS 4.15, public archived copy; the current guide is behind a login) %LINEPROTO-5-UPDOWN
dell.json.gz 7,142 iDRAC/CMC Error and Event Message Reference (6,811 syslog-capable IDs), SmartFabric OS10 System Log Message Reference (327), OS9 configuration guide (4) PSU0003, %IFM_ASTATE_UP, %CHMGR-2-MAJOR_TEMP
hpe.json.gz 4,878 Comware 5/7 System Log Messages References, AOS-CX 10.17 and ArubaOS-Switch 16.10 Event Log Message References %10IFNET/3/PHY_UPDOWN, 4701, 00076
huawei.json.gz 3,686 CloudEngine S16700, CloudEngine 9800/8800/6800 and S1720-S6720 Log References %01IFNET/4/IF_STATE (the token read from %%01IFNET/4/IF_STATE(l))
nvidia.json.gz 251 Cumulus Linux 5.18 switchd and FRRouting Log Message References, GPU Xid / NVSwitch SXid guides function names, FRR [EC nnnnnnnn] codes

Every file was checked with syslog_recommendations_parse(). Every record imports, every identifier passes syslog_recommendation_matchable(), and there are no case-insensitive duplicates. I removed 699 HPE records that had neither an explanation nor an action, because the importer would reject them, plus one HPE duplicate that differed only in case. Each record's reference links to its source. Explanations and actions are condensed from the vendor text. Where the vendor gives no action, the field is left empty rather than invented.

Vendor-scoped matching

The unique key is already (vendor, identifier), so the same code can exist once per vendor. Until now, though, the lookup ignored the vendor. Now:

  • The syslog host is matched to a Cacti device by description or hostname, using batched, per-request cached queries.
  • The vendor is detected from host.snmp_sysDescr, falling back to the device template name. It maps to the catalogue names Arista, Cisco, Dell, HPE, Huawei, Juniper and NVIDIA.
  • With a known vendor, the flyout lookup, the message-only lookup and the list lightbulb batch check consider only that vendor's records plus records with no vendor.
  • Hosts not in Cacti, or with an unrecognised vendor, behave as before and match all vendors.

README, CHANGELOG, the on-page matching rules and cacti.pot are updated.

Caveats

  • Coverage is partial. Arista covers EOS 4.15 and is missing later messages. HPE's public Comware guides are 2014 editions. Huawei has no AR/NE router references, and devices sending a version prefix other than %%01 won't match. NVIDIA publishes few message IDs that appear in syslog. Dell's OS9 coverage is thin.
  • Numeric identifiers (HPE event IDs, FRR error codes) are only reliable when the sending host resolves to a Cacti device with a recognised vendor.

Testing

  • pest full suite: 868 passed (run with memory_limit=-1, as on CI; unchanged develop also hits the default 128M limit in the Cisco catalogue test).
  • New tests: vendor detection from sysDescr/template, and vendor-scoped matching for both the batch and single lookups. The bundled-catalogue round-trip test now covers all seven files.
  • tests/bin/check-i18n-pot.php passes.
  • Sample lines from each vendor match their catalogue (for example %%01IFNET/4/IF_STATE(l) matches %01IFNET/4/IF_STATE, and MessageID: PSU0003 matches PSU0003).

…logues with vendor-scoped matching

Add manually importable docs/<vendor>.json.gz catalogues built from each
vendor's public message references, in the same syslog-recommendations
format as docs/juniper.json.gz.

Recommendations are now 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, so short
numeric codes from one vendor do not match another vendor's messages.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Copilot AI balanced review requested due to automatic review settings November 20, 2026 23:41

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🟡 Changes recommended

Vendor lookup still mishandles mixed-case hostnames, conflicting device matches, and numeric host keys, potentially showing another vendor’s recommendations or reintroducing code collisions.

3 open issues
What changed in this PR

Extends Cacti Syslog recommendations with five optional vendor catalogues and vendor-aware matching, building on the compressed catalogue format introduced in #469.

Changes:

  • Adds manually importable catalogues for Arista, Dell, HPE, Huawei and NVIDIA.
  • Uses cached Cacti device lookups to scope list indicators and flyout recommendations to the detected vendor, while preserving vendor-neutral matches.
  • Expands regression tests and updates matching guidance, catalogue documentation and translation text.
File Description
tests/​Unit/​RecommendationsTest.php Adds catalogue validation, vendor detection and scoped lookup tests.
syslog.php Passes sender names into batch and message-only lookups.
syslog_recommendations.php Updates on-page matching guidance.
README.md Documents vendor scoping, catalogue coverage and limitations.
locales/​po/​cacti.pot Updates the translatable matching guidance.
js/​functions.js Includes the sender in fallback recommendation requests.
includes/​recommendations.php Implements vendor detection, cached host resolution and scoped matching.
includes/​functions.php Supplies the sender to message-details recommendation lookup.
CHANGELOG.md Records the new catalogues and vendor-aware behavior.

Review effort: Balanced

Comment on lines +580 to +588
$marks = implode(',', array_fill(0, count($batch), '?'));

foreach (['description', 'hostname'] as $column) {
$rows = db_fetch_assoc_prepared("SELECT h.$column AS name, h.snmp_sysDescr, ht.name AS template
FROM host AS h
LEFT JOIN host_template AS ht ON ht.id = h.host_template_id
WHERE h.$column IN ($marks)
ORDER BY h.id",
$batch, false);
Comment on lines +593 to +595
if (isset($found[$name]) && $found[$name] === '') {
$found[$name] = syslog_recommendation_vendor_from_device((string) ($row['snmp_sysDescr'] ?? ''), (string) ($row['template'] ?? ''));
}
}
}

$cache = array_merge($cache, $found);
@TheWitness

Copy link
Copy Markdown
Member Author

@copilot please fix the merge conflicts in this pull request.

…ommendation-catalogues

# Conflicts:
#	CHANGELOG.md

Co-authored-by: copilot-swe-agent[bot] <198982749+Copilot@users.noreply.github.com>

Copilot AI commented Nov 21, 2026

Copy link
Copy Markdown
Contributor

@copilot please fix the merge conflicts in this pull request.

Merged develop and resolved the CHANGELOG.md conflict, retaining entries from both branches. Merge commit: 95e2cc8.

@sonarqubecloud

Copy link
Copy Markdown

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants