mirror of
https://github.com/akvorado/akvorado.git
synced 2025-12-11 22:14:02 +01:00
inlet/metadata: prefer ifAlias over ifDescr for interface description
Some checks failed
CI / 🤖 Check dependabot status (push) Has been cancelled
CI / ⚖️ Check licenses (push) Has been cancelled
CI / 🐧 Build and test on Linux (push) Has been cancelled
CI / 🍏 Build and test on macOS (push) Has been cancelled
CI / 🔍 Upload code coverage (push) Has been cancelled
CI / 🔭 Build Go backend (1.23) (push) Has been cancelled
CI / 🔭 Build Go backend (1.24) (push) Has been cancelled
CI / 🔭 Build JS frontend (18) (push) Has been cancelled
CI / 🔭 Build JS frontend (20) (push) Has been cancelled
CI / 🔭 Build JS frontend (22) (push) Has been cancelled
CI / 🐋 Build Docker images (push) Has been cancelled
CI / 🚀 Publish release (push) Has been cancelled
Update Nix dependencies / Update Nix lockfile (asn2org) (push) Has been cancelled
Update Nix dependencies / Update Nix lockfile (nixpkgs) (push) Has been cancelled
Update Nix dependencies / Update dependency hashes (push) Has been cancelled
Some checks failed
CI / 🤖 Check dependabot status (push) Has been cancelled
CI / ⚖️ Check licenses (push) Has been cancelled
CI / 🐧 Build and test on Linux (push) Has been cancelled
CI / 🍏 Build and test on macOS (push) Has been cancelled
CI / 🔍 Upload code coverage (push) Has been cancelled
CI / 🔭 Build Go backend (1.23) (push) Has been cancelled
CI / 🔭 Build Go backend (1.24) (push) Has been cancelled
CI / 🔭 Build JS frontend (18) (push) Has been cancelled
CI / 🔭 Build JS frontend (20) (push) Has been cancelled
CI / 🔭 Build JS frontend (22) (push) Has been cancelled
CI / 🐋 Build Docker images (push) Has been cancelled
CI / 🚀 Publish release (push) Has been cancelled
Update Nix dependencies / Update Nix lockfile (asn2org) (push) Has been cancelled
Update Nix dependencies / Update Nix lockfile (nixpkgs) (push) Has been cancelled
Update Nix dependencies / Update dependency hashes (push) Has been cancelled
ifDescr is more likely to contain the interface name for compatibility with ancien stuff (part of the original ifTable). The heuristics about it being different than ifName is not 100% correct as some IOS XE device may use the short name for ifDescr and the long name for ifName. ifAlias contains the description for IOS XR and JunOS.
This commit is contained in:
@@ -13,6 +13,7 @@ identified with a specific icon:
|
||||
|
||||
## Unreleased
|
||||
|
||||
- 💥 *inlet*: in SNMP metadata provider, prefer ifAlias over ifDescr for interface description
|
||||
- 🌱 *build*: minimal Go version to build is now 1.23
|
||||
- 🌱 *orchestrator*: ability to override ClickHouse or Kafka configuration in some components
|
||||
|
||||
|
||||
@@ -211,10 +211,10 @@ func (p *Provider) Poll(ctx context.Context, exporter, agent netip.Addr, port ui
|
||||
// If we have ifName, use ifDescr if it is different and ifAlias
|
||||
// is not. Otherwise, keep description empty.
|
||||
name = ifNameVal
|
||||
if okDescr && ifDescrVal != ifNameVal {
|
||||
description = ifDescrVal
|
||||
} else if okAlias {
|
||||
if okAlias && ifAliasVal != ifNameVal {
|
||||
description = ifAliasVal
|
||||
} else if okDescr && ifDescrVal != ifNameVal {
|
||||
description = ifDescrVal
|
||||
}
|
||||
} else {
|
||||
// Don't handle the other case yet. It would be unexpected to
|
||||
|
||||
@@ -241,7 +241,7 @@ func TestPoller(t *testing.T) {
|
||||
OID: "1.3.6.1.2.1.31.1.1.1.18.645",
|
||||
Type: gosnmp.OctetString,
|
||||
OnGet: func() (interface{}, error) {
|
||||
return "GigabitEthernet-something", nil
|
||||
return "Gi0/0/0/5", nil
|
||||
},
|
||||
},
|
||||
},
|
||||
|
||||
Reference in New Issue
Block a user