My second dtrace script
This program is like top but monitors sockets, and displays them based on Bytes transferred per PID, and also shows direction and UID that the application is running the sample output is showing the activity from a pair of ssh logins plus 7 copies of wget running grabbing 7 different files from my web/fileserver box, it’s the last second then I hit ctrl-c, to show grand totals. The script is called sock_top.d click the link to download a copy if you have any comments please feel free to leave them, it makes me feel better knowing that someone reads this.
walltime : 2017 Jan 22 08:36:56
Stats for the active last Second
UID PID diretion Bytes
1000 7723 rcv'd 260
1000 6168 rcv'd 312
1000 7723 sent 660
1000 6168 sent 780
1000 8011 rcv'd 4380
1000 8001 rcv'd 7300
1000 8009 rcv'd 8760
1000 8003 rcv'd 11680
Totals for this second
Data Rcv'd ==23620 Data Sent == 1124 TOTAL 24744
TOTALS
Data Rcv'd == 335672 Data Sent ==33620 Total TRANSFERRED == 369292
Grand Totals
UID PID diretion Bytes
1000 8013 sent 120
1000 8003 sent 120
1000 8005 sent 120
1000 8011 sent 120
1000 8009 sent 120
1000 8001 sent 120
1000 8007 sent 120
1000 6168 rcv'd 3848
1000 7723 rcv'd 4888
1000 7723 sent 11436
1000 8005 rcv'd 17520
1000 8003 rcv'd 20440
1000 6168 sent 21396
1000 8013 rcv'd 21900
1000 8009 rcv'd 23360
1000 8001 rcv'd 64240
1000 8007 rcv'd 67160
1000 8011 rcv'd 112420
TOTALS
Data Rcv'd == 335672 Data Sent ==33620 Total TRANSFERRED == 369292
Special thanks to John Levon and Keith M Wesolowski of the Kernel team.

0 Comments:
Post a Comment
<< Home