Skip to content

[Bug] Failed to get TCP metrics when linux kernel is 2.x #3920

@morningman

Description

@morningman

Describe the bug
In PR #3835, I get the tcp metrics from /proc/net/snmp.
But the content of /proc/net/snmp is different in linux kernel 2.x and kernel 3.x

In 2.x, the content of tcp is like:

Tcp: RtoAlgorithm RtoMin RtoMax MaxConn ActiveOpens PassiveOpens AttemptFails EstabResets CurrEstab InSegs OutSegs RetransSegs InErrs OutRsts
Tcp: 1 200 120000 -1 31802292 26291079 5229284 1561770 327 3168520693 3130748602 4190670 0 19075525

In 3.x, the content of tcp is like:

Tcp: RtoAlgorithm RtoMin RtoMax MaxConn ActiveOpens PassiveOpens AttemptFails EstabResets CurrEstab InSegs OutSegs RetransSegs InErrs OutRsts InCsumErrors
Tcp: 1 200 120000 -1 58962964 46828036 4108757 3626498 204 1242409051 1436033565 1146772 17207 30277468 0

You can see that in 3.x, there is addition metric InCsumErrors at the end.

So we should be able to get the metrics from different content.

Metadata

Metadata

Assignees

Labels

area/metricsIssues or PRs related to the metricskind/fixCategorizes issue or PR as related to a bug.

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions