Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[RFC] netstat/nstat plugin #1104

Closed
daviesalex opened this issue Apr 27, 2016 · 5 comments
Closed

[RFC] netstat/nstat plugin #1104

daviesalex opened this issue Apr 27, 2016 · 5 comments

Comments

@daviesalex
Copy link

daviesalex commented Apr 27, 2016

We plan to add the metrics that are available via nstat to telegraf. This is effectively everything in netstat, with a few more[1]. Example output below.

Ideally we will figure out an elegant way to list the available metrics dynamically, and access them directly via /proc/ (we have not dug into this).

Before we spend time looking at this, comments welcome from others.

[root@hostname memory]# nstat
#kernel
IpInReceives                    510275104          0.0
IpInDelivers                    510270183          0.0
IpOutRequests                   509595531          0.0
IpOutDiscards                   2570               0.0
IpOutNoRoutes                   39                 0.0
IcmpInErrors                    51828              0.0
IcmpInCsumErrors                8                  0.0
IcmpInTimeExcds                 25040              0.0
IcmpInEchoReps                  26313              0.0
IcmpInTimestamps                466                0.0
IcmpInTimestampReps             6                  0.0
IcmpInAddrMaskReps              3                  0.0
IcmpOutErrors                   27604              0.0
IcmpOutTimeExcds                819                0.0
IcmpOutEchoReps                 466                0.0
IcmpOutTimestamps               26313              0.0
IcmpOutAddrMasks                6                  0.0
IcmpMsgInType0                  466                0.0
IcmpMsgInType3                  25040              0.0
IcmpMsgInType8                  26313              0.0
IcmpMsgInType13                 6                  0.0
IcmpMsgInType17                 3                  0.0
IcmpMsgOutType0                 26313              0.0
IcmpMsgOutType3                 819                0.0
IcmpMsgOutType8                 466                0.0
IcmpMsgOutType14                6                  0.0
TcpActiveOpens                  2274662            0.0
TcpPassiveOpens                 342602             0.0
TcpAttemptFails                 719677             0.0
TcpEstabResets                  222007             0.0
TcpInSegs                       503521447          0.0
TcpOutSegs                      515627372          0.0
TcpRetransSegs                  40593              0.0
TcpInErrs                       720                0.0
TcpOutRsts                      961218             0.0
UdpInDatagrams                  1458988            0.0
UdpNoPorts                      1476               0.0
UdpInErrors                     5150740            0.0
UdpOutDatagrams                 22976178           0.0
UdpSndbufErrors                 1                  0.0
TcpExtSyncookiesFailed          138                0.0
TcpExtEmbryonicRsts             45                 0.0
TcpExtPruneCalled               13                 0.0
TcpExtTW                        1316165            0.0
TcpExtDelayedACKs               16883624           0.0
TcpExtDelayedACKLocked          1127               0.0
TcpExtDelayedACKLost            8428               0.0
TcpExtTCPHPHits                 320148707          0.0
TcpExtTCPPureAcks               18670050           0.0
TcpExtTCPHPAcks                 158731034          0.0
TcpExtTCPRenoRecovery           96                 0.0
TcpExtTCPSackRecovery           580                0.0
TcpExtTCPFACKReorder            12                 0.0
TcpExtTCPRenoReorder            3                  0.0
TcpExtTCPTSReorder              85                 0.0
TcpExtTCPFullUndo               178                0.0
TcpExtTCPPartialUndo            727                0.0
TcpExtTCPDSACKUndo              200                0.0
TcpExtTCPLossUndo               4282               0.0
TcpExtTCPLostRetransmit         34                 0.0
TcpExtTCPRenoFailures           13                 0.0
TcpExtTCPSackFailures           13                 0.0
TcpExtTCPLossFailures           267                0.0
TcpExtTCPFastRetrans            1410               0.0
TcpExtTCPForwardRetrans         51                 0.0
TcpExtTCPSlowStartRetrans       290                0.0
TcpExtTCPTimeouts               14295              0.0
TcpExtTCPLossProbes             26721              0.0
TcpExtTCPLossProbeRecovery      22526              0.0
TcpExtTCPRenoRecoveryFail       19                 0.0
TcpExtTCPSackRecoveryFail       53                 0.0
TcpExtTCPRcvCollapsed           39                 0.0
TcpExtTCPDSACKOldSent           6761               0.0
TcpExtTCPDSACKOfoSent           5                  0.0
TcpExtTCPDSACKRecv              23536              0.0
TcpExtTCPAbortOnData            228658             0.0
TcpExtTCPAbortOnClose           60                 0.0
TcpExtTCPAbortOnTimeout         85                 0.0
TcpExtTCPDSACKIgnoredNoUndo     21808              0.0
TcpExtTCPSpuriousRTOs           64                 0.0
TcpExtTCPSackShifted            280                0.0
TcpExtTCPSackMerged             300                0.0
TcpExtTCPSackShiftFallback      2252               0.0
TcpExtTCPRetransFail            66                 0.0
TcpExtTCPRcvCoalesce            73223366           0.0
TcpExtTCPOFOQueue               342045             0.0
TcpExtTCPOFOMerge               5                  0.0
TcpExtTCPChallengeACK           850                0.0
TcpExtTCPSYNChallenge           847                0.0
TcpExtTCPSpuriousRtxHostQueues  11862              0.0
IpExtInBcastPkts                5236425            0.0
IpExtInOctets                   1700936538759      0.0
IpExtOutOctets                  154586125605       0.0
IpExtInBcastOctets              1403487865         0.0

[1] http://loicpefferkorn.net/2016/03/linux-network-metrics-why-you-should-use-nstat-instead-of-netstat/

@sparrc
Copy link
Contributor

sparrc commented Apr 27, 2016

from https://github.com/shemminger/iproute2/blob/master/misc/nstat.c it looks like it's just the counters available in /proc/net/netstat, /proc/net/snmp and /proc/net/snmp6,

would be a fun project to make a Go clone of the above C code :-)

@daviesalex
Copy link
Author

@sparrc I think that basically is the task...

@maksadbek
Copy link
Contributor

@sparrc The implementation of this plugin is interesting for, I have started the development, and going to send PR soon

@sparrc
Copy link
Contributor

sparrc commented Apr 30, 2016

oops, hope you haven't done too much work on this yet @maksadbek, I was bored today and wrote a library before seeing this, feel free to use it as you see fit :) https://github.com/sparrc/nstat

@maksadbek
Copy link
Contributor

maksadbek commented May 1, 2016

Hi @sparrc , I have written the parsers but your looks better)

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

No branches or pull requests

3 participants