Network usage

Hello,

I need to collect the network usage in linux 6.5 version ,report like max/min/average speed ,I know some of the command like netstats -s /ifconfig but I am not sure which part of the output will be used to extract this info.I can't install any new tool like nload,iftop,vnstat.

Start with the array of /proc/net entries.

"speed" is how you choose to measure it. Unless you monitor constantly you cannot get anything meaningful for:max,min, or average. Unless one of your /proc/net entries has something useful. I do not know what 6.5 has offhand.

/proc/net has all other files which mainly has zero size files.I am not sure what do you mean by monitoring constantly, if i can put some script that collect the stats constantly say for every 5 minutes or so but i need the command specifically used to collect the stats of the network so that i can calculate the speed.And I don't have option to install anything new tools on the server as I am not the root user.

They are not real files. Everything in /proc is an interface to the kernel itself.

$ ls -l /proc/net/netstat
-r--r--r-- 1 root root 0 Sep 18 16:26 /proc/net/netstat
$ cat /proc/net/netstat
TcpExt: SyncookiesSent SyncookiesRecv SyncookiesFailed EmbryonicRsts PruneCalled RcvPruned OfoPruned OutOfWindowIcmps LockDroppedIcmps ArpFilter TW TWRecycled TWKilled PAWSPassive PAWSActive PAWSEstab DelayedACKs DelayedACKLocked DelayedACKLost ListenOverflows ListenDrops TCPPrequeued TCPDirectCopyFromBacklog TCPDirectCopyFromPrequeue TCPPrequeueDropped TCPHPHits TCPHPHitsToUser TCPPureAcks TCPHPAcks TCPRenoRecovery TCPSackRecovery TCPSACKReneging TCPFACKReorder TCPSACKReorder TCPRenoReorder TCPTSReorder TCPFullUndo TCPPartialUndo TCPDSACKUndo TCPLossUndo TCPLostRetransmit TCPRenoFailures TCPSackFailures TCPLossFailures TCPFastRetrans TCPForwardRetrans TCPSlowStartRetrans TCPTimeouts TCPLossProbes TCPLossProbeRecovery TCPRenoRecoveryFail TCPSackRecoveryFail TCPSchedulerFailed TCPRcvCollapsed TCPDSACKOldSent TCPDSACKOfoSent TCPDSACKRecv TCPDSACKOfoRecv TCPAbortOnData TCPAbortOnClose TCPAbortOnMemory TCPAbortOnTimeout TCPAbortOnLinger TCPAbortFailed TCPMemoryPressures TCPSACKDiscard TCPDSACKIgnoredOld TCPDSACKIgnoredNoUndo TCPSpuriousRTOs TCPMD5NotFound TCPMD5Unexpected TCPSackShifted TCPSackMerged TCPSackShiftFallback TCPBacklogDrop TCPMinTTLDrop TCPDeferAcceptDrop IPReversePathFilter TCPTimeWaitOverflow TCPReqQFullDoCookies TCPReqQFullDrop TCPRetransFail TCPRcvCoalesce TCPOFOQueue TCPOFODrop TCPOFOMerge TCPChallengeACK TCPSYNChallenge TCPFastOpenActive TCPFastOpenPassive TCPFastOpenPassiveFail TCPFastOpenListenOverflow TCPFastOpenCookieReqd TCPSpuriousRtxHostQueues BusyPollRxPackets
TcpExt: 0 0 828 5266 0 0 0 0 0 0 25027 0 0 0 0 85 1948860 109 23279 0 170 807422 1317512610 13249058936 0 6551001 1197354 4224002 8279131 3 4879 0 0 0 0 3 0 1 157 8790 416 1 419 88 18717 769 121 54185 105713 83035 1 392 1 0 23180 6 64711 6 93 155 0 246 0 0 0 0 13 53213 184 0 0 3 36 190460 0 0 79024 17589 0 0 0 128 595040 22682 0 6 77 45 0 5 0 0 0 10229 0
IpExt: InNoRoutes InTruncatedPkts InMcastPkts OutMcastPkts InBcastPkts OutBcastPkts InOctets OutOctets InMcastOctets OutMcastOctets InBcastOctets OutBcastOctets InCsumErrors InNoECTPkts InECT1Pkts InECT0Pkts InCEPkts
IpExt: 12 0 0 52 582381 52109 448897330878 274484526007 0 2080 59642175 12404543 95 391927770 58 4834 752
$

I can see the file content of cat /proc/net/netstat ,but my question was how to use this information to create some reports which says the speed of the network usage.

Exploring the <tt>/proc/net/</tt> Directory - O'Reilly Media