Terminal pogryzł człowieka: jnettop
Większość z nas lubi utrzymywać porządek na swoim podwórku. I wytłumaczeniem na odstępstwo od tej reguły nie jest nawet pomieszkiwanie w wielkiej płycie. A jak utrzymywać porządek to wiadomo – z odpowiednimi narzędziami w ręku. Stąd też zaciekawienie powinien wzbudzić elegancki i utrzymany w manierze top programik jnettop. Pozwala on bardzo szybko zorientować się, co, gdzie i jak przelatuje przez nasze interfejsy sieciowe.
Mało tego, program zezwala również na stosowanie reguł filtrowania rodem z tcpdump. Niestety, reguły te musimy wcześniej zdefiniować w pliku konfiguracyjnym ~/.jnettop, albo wypisać ją podczas uruchamiania programu z parametrem -x
# jnettop -h
Usage: jnettop [-hv] [-i interface] [-d filename]
-h, --help display this help message
-v, --version display version information
-c, --content-filter disable content filtering
-d, --debug filename write debug information into file (or syslog)
--display type type of display (curses, text, uia)
-f, --config-file name reads configuration from file. defaults to ~/.jnettop
--format format list of fields to list in text output
-i, --interface name capture packets on specified interface
--local-aggr arg set local aggregation to none/host/port/host+port
-n, --no-resolver disable resolving of addresses
-p, --promiscuous enable promisc mode on the devices
--remote-aggr arg set remote aggregation to none/host/port/host+port
-s, --select-rule rule selects one of the rules defined in config file
by it's name
-t, --timeout sec timeout in seconds after which jnettop ends (text display)
-x, --filter rule allows for specification of custom filtering rule
this follows tcpdump(1) syntax. don't forget to
enclose the filter in quotes when running from shell
Report bugs to <j@kubs.cz>
Format variable can be CSV (comma separated values), TSV (tab separated values)
or completelly custom format string, where the following identifiers are subst-
ituted when surrounded by '$':
src, srcname, srcport, srcbytes, srcpackets, srcbps, srcpps,
dst, dstname, dstport, dstbytes, dstpackets, dstbps, dstpps,
proto, totalbytes, totalpackets, totalbps, totalpps, filterdata
example:
jnettop --display text -t 5 --format CSV
jnettop --display text -t 5 --format '$srcname$,$srcport$,$dstname$,$dstport$,$totalbps$'
Na powyższym widać kolejną arcyciekawą cechę tego programu. Możliwość definiowania formatu wyjściowego, a co za tym idzie gromadzenia danych w sposób korzystny na potrzeby późniejszego ich parsowania.
Kolejną świetną cechą jnettop jest to, że zainstalujemy go wprost z repozytorium niemal wszystkich dystrybucji.

zenmap