Skip to content

feature: Add Arista, Dell, Fortinet, HPE, Huawei, MikroTik, Nokia, NVIDIA and Palo Alto Networks recommendation catalogues with vendor-scoped matching - #477

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

TheWitness wants to merge 4 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 nine 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,883 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
nokia.json.gz 2,016 SR OS Log Events Guide 25.10 SYSTEM-WARNING-tmnxStateChange-2009 (default severity)
fortinet.json.gz 1,462 FortiOS 7.6.8 Log Message Reference (traffic, event, UTM) 10-digit logid such as 0100032001
paloalto.json.gz 398 PAN-OS Syslog Severity Reference (System log event IDs) and public KB articles tunnel-status-down
mikrotik.json.gz 6 help.mikrotik.com (RouterOS has no message IDs; only messages with a distinctive token) hw-limit, hashtype

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 694 HPE AOS-CX/ArubaOS-Switch events that have neither an explanation nor an action, because the importer would reject them. HPE's guides give no description for them. I also removed one HPE duplicate that differed only in case. A Comware 5 PDF parsing issue, where labels were split mid-word, was fixed; it had left 5 records empty and merged the action into the explanation in 28 others. I dropped seven generic MikroTik words (ph1, phase1, fcs, CME, CONNTRACK, cmd-failed, NO-PROPOSAL-CHOSEN) because they would match other vendors' messages. 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, Fortinet, HPE, Huawei, Juniper, MikroTik, Nokia, NVIDIA and Palo Alto Networks.
  • 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. Nokia identifiers embed the default severity, so events re-severitised on the router won't match. Fortinet full log IDs are derived from the documented type, subtype and message ID, and Fortinet documents no actions. Palo Alto has only 12 records with actions.
  • Numeric identifiers (HPE event IDs, Fortinet log IDs, FRR error codes) are only reliable when the sending host resolves to a Cacti device with a recognised vendor.

Testing

  • pest full suite: 881 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 eleven 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; logid="0100032001" matches 0100032001).

…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.

bmfmancini
bmfmancini previously approved these changes Nov 21, 2026

@somethingwithproof somethingwithproof left a comment •

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

No blockers found.

Copilot's two open comments on syslog_recommendation_host_vendors() (the case-sensitive lookup and the first match winning) are valid and worth fixing. Two things beyond those:

Suggestion: once hpe.json.gz is imported, hosts that are not Cacti devices match numeric identifiers such as 4701 against any number in a message. Consider skipping purely numeric identifiers unless the vendor is known.

Question: the catalogues condense vendor text, and the Arista source is an archived copy of a guide that is now behind a login. Are we comfortable redistributing these under the plugin's licence?

TheWitness and others added 2 commits November 21, 2026 14:16
…ndation catalogues

Add docs/nokia.json.gz (SR OS Log Events Guide 25.10), docs/fortinet.json.gz
(FortiOS 7.6.8 Log Message Reference), docs/paloalto.json.gz (PAN-OS System
log event IDs) and docs/mikrotik.json.gz (the few RouterOS messages with a
distinctive token), and recognise these vendors from the device sysDescr.

Fix the HPE Comware 5 catalogue, whose split "Explanation" and "Recommended
action" PDF labels left 5 records empty and appended the action to the
explanation in 28 others. The remaining 694 omitted AOS-CX and ArubaOS-Switch
events have no description in HPE's guides.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
…talogues' into feature/vendor-recommendation-catalogues
@TheWitness TheWitness changed the title feature: Add Arista, Dell, HPE, Huawei and NVIDIA recommendation catalogues with vendor-scoped matching feature: Add Arista, Dell, Fortinet, HPE, Huawei, MikroTik, Nokia, NVIDIA and Palo Alto Networks recommendation catalogues with vendor-scoped matching Nov 21, 2026
@sonarqubecloud

Copy link
Copy Markdown

@somethingwithproof somethingwithproof left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

No blockers found.

The three open Copilot comments on syslog_recommendation_host_vendors() still apply on 346509d. Each reproduces:

  • Suggestion: includes/recommendations.php:597 compares the stored device spelling with the sender's. Device hostname SW01.Example.com and sender sw01.example.com leaves the vendor unknown, so scoping never engages. Key $found by lowercased name and add a mixed-case test; the current stub echoes the requested spelling and cannot catch it.
  • Suggestion: :591-599, two devices with the same description (Cisco id 1, HPE id 2) resolve to Cisco and the HPE sender's records are hidden. Scope only when all matching devices agree.
  • Suggestion: :603, array_merge() renumbers numeric host names. A device described 123 loses its vendor, and a later host 0 picks it up. Use $found + $cache.

Beyond those:

  • Suggestion: :635-642 and :693 scope to the detected vendor even when that vendor has no rows. With only the seeded Cisco catalogue, an Arista device stops showing %LINEPROTO-5-UPDOWN, which it shows on develop, until arista.json.gz is imported. The same happens to user records whose vendor is spelled differently (Aruba vs HPE). Scope only when the table has rows for that vendor, or say in the README that recognised devices lose other vendors' matches.
  • Suggestion: :537-549, a Net-SNMP sysDescr contains the hostname, so Linux cisco-syslog01 ... is Cisco and Linux hp-dl380-01 ... is HPE. Alcatel-Lucent Enterprise OS6860E becomes Nokia. Since scoping only removes matches, I would drop bare hp and alcatel-lucent and ignore the hostname in Linux descriptions. The GPU Xid records also come from Linux servers that will never detect as NVIDIA.
  • Suggestion: hpe.json.gz has 3,626 all-digit identifiers; the 2,000 without a leading zero cover about 3% of 1..65535 (1024 and 4701 included). On any host without a recognised vendor a port or PID in the message lights the bulb. Palo Alto adds link-down, auth-fail and admin-down. Match all-digit identifiers only when the vendor is known.
  • Suggestion: there is no generator or source manifest for the nine docs/*.json.gz files, so the cleanup described in the PR (694 HPE events dropped, the Comware parsing fix) cannot be reproduced or reviewed. Please add the scripts or a per-file source list with document version and retrieval date.
  • Suggestion: add tests for the host resolution cases above and for the alert-tab host path in syslog.php.
  • Nit: README says the template name is used when sysDescr is empty; the code also uses it when sysDescr is set but unrecognised.

Question, still open from before: the Arista, Dell, HPE, Huawei and Nokia records carry full vendor sentences, and all 1,047 Arista references point at archive.org copies of a guide now behind a login. Are we comfortable shipping these under GPLv2?

Record counts match the table, every identifier is matchable, there are no duplicates, and catalogue text is only ever inserted as text.

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.

5 participants