เครื่องมือสำหรับการ monitor traffic ใน Linux
จริงๆเครื่องมือในการ monitor traffic ใน Linux มีมากมาย แต่ละตัวมีจุดเด่นที่แตกต่างกันไป ในที่นี้เราจะแนะนำเครื่องมือสำหรับการ monitor network traffic 3 ตัวด้วยกันครับนั่นคือ iftop, Nethogs, และ vnstat
1. iftop
เป็นเครื่องมือที่จะคอย monitor interface ที่เรากำหนด แล้วแสดงผลออกมาในรูปแบบสรุปโดยรวมของแต่ละปลายทางที่เราใช้ด้วย
1 |
iftop -i eth0 |
ขณะที่กำลังแสดงผล เราสามารถกดปุ่มใดๆให้สามารถแสดงผลเพิ่มเติมอย่างที่เราต้องการได้อีกด้วย
- h toggles the help screen.
- n toggles name resolution.
- s toggles source host display, and d toggles the destination hosts.
- s toggles port numbers.
- N toggles port resolution; to see all port numbers toggle resolution off.
- t toggles the text interface. The default display requires ncurses. I think the text display is more readable and better-organized (Figure 1).
- p pauses the display.
- q quits the program.
2. Nethogs
ส่วน Nethogs จะเป็นเครื่องมือการ monitor การใช้งาน traffic โดยดูเป็น Application แทน
1 |
nethogs |
3. vnstat
เป็นเครื่องมือสำหรับการทำ data collection ซึ่งไม่เหมือนตัวอื่น เพราะมันจะทำงานเป็นแบบ daemon (service) คอย monitor traffic ทั้งหมดของทุก interface จากนั้นเมื่อข้อมูลมากพอ เราจะสามารถ generate report ของการใช้งานใน interface นั้นๆแทน
1 |
vnstat -i eth0 |
Source:: Linux.com