Difference between revisions of "formatted netstat -i output"
From thelinuxwiki
m |
|||
(5 intermediate revisions by one user not shown) | |||
Line 1: | Line 1: | ||
− | + | nice output | |
− | netstat -i | awk '{printf "%- | + | # '''netstat -i | awk '{for (i=1; i<=12; i++) printf "%-12s",$i; printf "\n" }'''' |
+ | Kernel Interface table | ||
+ | Iface MTU Met RX-OK RX-ERR RX-DRP RX-OVR TX-OK TX-ERR TX-DRP TX-OVR Flg | ||
+ | Mgmt 1500 0 44798753 0 0 0 27975618 0 0 0 BMRU | ||
+ | Sync 1500 0 2963537772 3 0 0 1468012913 0 0 0 BMRU | ||
+ | eth1-01 1500 0 1411174596 900025 0 0 1700760266 0 0 0 BMRU | ||
+ | eth1-02 1500 0 621545020 0 0 0 699950334 0 0 0 BMRU | ||
+ | eth1-03 1500 0 42298254 0 0 0 41409697 0 0 0 BMRU | ||
+ | eth1-04 1500 0 118450353 0 0 0 91272698 0 0 0 BMRU | ||
+ | eth1-06 1500 0 842911465 0 0 0 769682478 0 0 0 BMRU | ||
+ | eth1-07 1500 0 1678630674 0 0 0 1262833128 0 0 0 BMRU | ||
+ | eth1-07:0 1500 0 0 0 0 0 0 0 0 0 BMRU | ||
+ | eth1-08 1500 0 66948888 0 0 0 42575976 0 0 0 BMRU | ||
+ | eth2-01 1500 0 27193173 0 0 0 26951616 0 0 0 BMRU | ||
+ | lo 16436 0 14102710 0 0 0 14102710 0 0 0 LRU | ||
− | Kernel | + | regular, unformatted command... |
− | Iface | + | |
− | Mgmt 1500 0 | + | # '''netstat -i''' |
− | + | Kernel Interface table | |
− | eth1-01 | + | Iface MTU Met RX-OK RX-ERR RX-DRP RX-OVR TX-OK TX-ERR TX-DRP TX-OVR Flg |
− | eth1-02 | + | Mgmt 1500 0 42971857 0 0 0 33031217 0 0 0 BMRU |
− | eth1-03 | + | Sync 1500 0 1437253374 0 26123 0 2901278387 0 0 0 BMRU |
− | eth1-04 | + | eth1-01 1500 0 3233824068 2214586 104401 104401 3882515746 0 0 0 BMRU |
− | eth1-06 | + | eth1-02 1500 0 2452468224 0 10073 10073 224918415 0 0 0 BMRU |
− | eth1-07 | + | eth1-03 1500 0 47909107 0 0 0 48619706 0 0 0 BMRU |
− | eth1-07:0 1500 | + | eth1-04 1500 0 2121384593 0 0 0 1424105000 0 0 0 BMRU |
− | eth1-08 | + | eth1-06 1500 0 3075678521 0 0 0 2825847210 0 0 0 BMRU |
− | eth2-01 | + | eth1-07 1500 0 2082965114 0 2642073 2642073 3603131206 0 0 0 BMRU |
− | lo | + | eth1-07:0 1500 0 0 0 0 0 0 0 0 0 BMRU |
+ | eth1-08 1500 0 72183010 0 0 0 47803595 0 0 0 BMRU | ||
+ | eth2-01 1500 0 25896410 0 0 0 26463622 0 0 0 BMRU | ||
+ | lo 16436 0 265912189 0 0 0 265912189 0 0 0 LRU | ||
+ | |||
+ | ezpz formatting via column - (x) | ||
+ | # '''netstat -i |column -t''' | ||
+ | Kernel Interface table | ||
+ | Iface MTU Met RX-OK RX-ERR RX-DRP RX-OVR TX-OK TX-ERR TX-DRP TX-OVR Flg | ||
+ | Mgmt 1500 0 42971857 0 0 0 33031217 0 0 0 BMRU | ||
+ | Sync 1500 0 1437253374 0 26123 0 2901278387 0 0 0 BMRU | ||
+ | eth1-01 1500 0 3233824068 2214586 104401 104401 3882515746 0 0 0 BMRU | ||
+ | eth1-02 1500 0 2452468224 0 10073 10073 224918415 0 0 0 BMRU | ||
+ | eth1-03 1500 0 47909107 0 0 0 48619706 0 0 0 BMRU | ||
+ | eth1-04 1500 0 2121384593 0 0 0 1424105000 0 0 0 BMRU | ||
+ | eth1-06 1500 0 3075678521 0 0 0 2825847210 0 0 0 BMRU | ||
+ | eth1-07 1500 0 2082965114 0 2642073 2642073 3603131206 0 0 0 BMRU | ||
+ | eth1-07:0 1500 0 0 0 0 0 0 0 0 0 BMRU | ||
+ | eth1-08 1500 0 72183010 0 0 0 47803595 0 0 0 BMRU | ||
+ | eth2-01 1500 0 25896410 0 0 0 26463622 0 0 0 BMRU | ||
+ | lo 16436 0 265912189 0 0 0 265912189 0 0 0 LRU | ||
+ | |||
+ | |||
+ | [[category:monitoring]] |
Latest revision as of 20:25, 1 January 2015
nice output
# netstat -i | awk '{for (i=1; i<=12; i++) printf "%-12s",$i; printf "\n" }' Kernel Interface table Iface MTU Met RX-OK RX-ERR RX-DRP RX-OVR TX-OK TX-ERR TX-DRP TX-OVR Flg Mgmt 1500 0 44798753 0 0 0 27975618 0 0 0 BMRU Sync 1500 0 2963537772 3 0 0 1468012913 0 0 0 BMRU eth1-01 1500 0 1411174596 900025 0 0 1700760266 0 0 0 BMRU eth1-02 1500 0 621545020 0 0 0 699950334 0 0 0 BMRU eth1-03 1500 0 42298254 0 0 0 41409697 0 0 0 BMRU eth1-04 1500 0 118450353 0 0 0 91272698 0 0 0 BMRU eth1-06 1500 0 842911465 0 0 0 769682478 0 0 0 BMRU eth1-07 1500 0 1678630674 0 0 0 1262833128 0 0 0 BMRU eth1-07:0 1500 0 0 0 0 0 0 0 0 0 BMRU eth1-08 1500 0 66948888 0 0 0 42575976 0 0 0 BMRU eth2-01 1500 0 27193173 0 0 0 26951616 0 0 0 BMRU lo 16436 0 14102710 0 0 0 14102710 0 0 0 LRU
regular, unformatted command...
# netstat -i Kernel Interface table Iface MTU Met RX-OK RX-ERR RX-DRP RX-OVR TX-OK TX-ERR TX-DRP TX-OVR Flg Mgmt 1500 0 42971857 0 0 0 33031217 0 0 0 BMRU Sync 1500 0 1437253374 0 26123 0 2901278387 0 0 0 BMRU eth1-01 1500 0 3233824068 2214586 104401 104401 3882515746 0 0 0 BMRU eth1-02 1500 0 2452468224 0 10073 10073 224918415 0 0 0 BMRU eth1-03 1500 0 47909107 0 0 0 48619706 0 0 0 BMRU eth1-04 1500 0 2121384593 0 0 0 1424105000 0 0 0 BMRU eth1-06 1500 0 3075678521 0 0 0 2825847210 0 0 0 BMRU eth1-07 1500 0 2082965114 0 2642073 2642073 3603131206 0 0 0 BMRU eth1-07:0 1500 0 0 0 0 0 0 0 0 0 BMRU eth1-08 1500 0 72183010 0 0 0 47803595 0 0 0 BMRU eth2-01 1500 0 25896410 0 0 0 26463622 0 0 0 BMRU lo 16436 0 265912189 0 0 0 265912189 0 0 0 LRU
ezpz formatting via column - (x)
# netstat -i |column -t Kernel Interface table Iface MTU Met RX-OK RX-ERR RX-DRP RX-OVR TX-OK TX-ERR TX-DRP TX-OVR Flg Mgmt 1500 0 42971857 0 0 0 33031217 0 0 0 BMRU Sync 1500 0 1437253374 0 26123 0 2901278387 0 0 0 BMRU eth1-01 1500 0 3233824068 2214586 104401 104401 3882515746 0 0 0 BMRU eth1-02 1500 0 2452468224 0 10073 10073 224918415 0 0 0 BMRU eth1-03 1500 0 47909107 0 0 0 48619706 0 0 0 BMRU eth1-04 1500 0 2121384593 0 0 0 1424105000 0 0 0 BMRU eth1-06 1500 0 3075678521 0 0 0 2825847210 0 0 0 BMRU eth1-07 1500 0 2082965114 0 2642073 2642073 3603131206 0 0 0 BMRU eth1-07:0 1500 0 0 0 0 0 0 0 0 0 BMRU eth1-08 1500 0 72183010 0 0 0 47803595 0 0 0 BMRU eth2-01 1500 0 25896410 0 0 0 26463622 0 0 0 BMRU lo 16436 0 265912189 0 0 0 265912189 0 0 0 LRU