IFSTAT(1)

πŸ“¦
version 1.1.1 Β· 3 versions
, in debian trixie, ubuntu noble, ubuntu questing, ubuntu resolute, ubuntu stonking

✨ IFSTAT β€” Report InterFace STATistics ✨

okay bestie, gather round πŸ’– this is ifstat, from the System Utilities corner of your manual pages, and it's genuinely one of the most useful little gremlins in your toolbox. it's a little tool that reports interface activity β€” like, the network-interface kind of activity. think of it as the iostat/vmstat treatment but for your network interfaces instead of your disks and CPU. same energy, different victim. slay πŸ’…


🌸 NAME 🌸

ifstat β€” Report InterFace STATistics. that's it, that's the name, it does what it says on the tin πŸŽ€


πŸ¦‹ SYNOPSIS πŸ¦‹

ifstat [-a] [-l] [-z] [-n] [-v] [-h] [-t] [-i if0,if1,...] [-d
drv[:opt]] [-s [comm@][#]host[/nn]] [-T] [-A] [-w] [-W] [-S] [-b] [-q]
[delay[/delay] [count]]

yeah it's a lot of little flags, don't panic, we're gonna go through every single one together, no cap 🫢


πŸ’œ DESCRIPTION πŸ’œ

ifstat is a little tool to report interface activity, just like iostat/vmstat do for other system statistics. periodt. that's the whole concept and it ate πŸ’…


✨ OPTIONS ✨

ifstat accepts the following options:

  • -l β€” turns ON monitoring of loopback interfaces, but only the ones where stats are actually available πŸ‘€. by default, ifstat monitors all non-loopback interfaces that are up. so if you're wondering where lo went, it's this flag's fault, not yours πŸ’€
  • -a β€” monitors ALL the interfaces found for which statistics are available. all of them. every last one. go off πŸ‘‘
  • -z β€” hides interfaces whose counters are null, eg interfaces that are up but not used. ghosting the boring ones, iconic πŸ™ˆ
  • -i β€” specifies the list of interfaces to monitor, separated by commas. and listen β€” if an interface name has a comma in it (chaotic, but okay), it can be escaped with '\'. multiple instances of the option are added together, so you can stack 'em up πŸ“
  • -s β€” equivalent to -d snmp:[comm@][#]host[/nn]] to poll a remote host through SNMP. details are down below in the drivers section, keep scrolling bestie ✨
  • -h β€” displays a short help message. your girl when you forget a flag 🫢
  • -n β€” turns off displaying the header periodically. no more repeated header, just vibes 🌈
  • -t β€” adds a timestamp at the beginning of each line. so you know when the numbers happened, not just what they were ⭐
  • -T β€” reports total bandwidth for all monitored interfaces. one number to rule them all πŸ‘‘
  • -A β€” disables use of interface indexes. here's the tea: by default, when the polling mechanism is index based (snmp, ifmib), ifstat remembers the indexes of monitored interfaces so it only polls those. BUT if interface indexes change often (new interfaces added, etc), you might lose some stats, hence this flag. note that if you ask ifstat to monitor a non existent interface, it will poll all interfaces until it finds the requested one (regardless of this flag) so you can poll for an interface that goes up and down. it's giving patient 😭
  • -w β€” uses fixed width columns, instead of enlarging them if needed for interface names to fit. tidy, contained, lowkey satisfying πŸ’…
  • -W β€” wraps lines that are larger than the terminal width (implies -w). wrapped lines are prefixed with a cycling letter to ease reading. cute little breadcrumbs so you don't get lost 🧚
  • -S β€” keeps stats updated on the same line if possible (no scrolling nor wrapping). main character energy, never leaves the screen πŸ’–
  • -b β€” reports bandwidth in kbits/sec instead of kbytes/sec. important distinction, don't get caught out ngl
  • -q β€” quiet mode, warnings are not printed. shhh 🀫
  • -v β€” displays version and the compiled-in drivers. a little selfie of the build πŸ“Έ
  • -d β€” specifies a driver to use to gather stats, and an eventual option for this driver, separated from the driver name by a colon. if this is not specified, ifstat uses the first driver compiled in, with no options.

the following drivers are available (depending on the operating system and compile-time options, not all of them might be present):

  • proc β€” this driver gets statistics from Linux's /proc/net/dev file. an alternate file name to get stats from can be passed as the option.
  • ifmib β€” this driver gets statistics from FreeBSD's ifmib sysctl. it doesn't accept any options.
  • kstat β€” this driver gets statistics from Solaris kstat interface. it doesn't accept any options.
  • ifdata β€” this driver gets statistics using SIOCGIFDATA ioctl under IRIX and OpenBSD (different semantics). it doesn't accept any options.
  • route β€” this driver gets statistics using routing sysctl on BSD based systems. it doesn't accept any options.
  • kvm β€” this driver gets statistics by reading the kernel live structures. it accepts an option specifying which files/devices to use in the following format: [execfile][,[corefile][,swapfile]] (see kvm_open(3) for details on those fields). if a null string is passed for a parameter, the system default will be used for it.
⚠️ note that for this driver to work, ifstat needs to have read access to the system memory device. this is usually done by running it as root, or by installing setgid mem or kmem. ifstat will NOT install setgid by default; It is up to you to decide if you trust it. bestie, read that twice. it's literally your call πŸ’€
  • dlpi β€” this driver gets statistics using the DLPI streams interface available on HP-UX. an alternate device to query statistics from can be passed as the option (default is /dev/dlpi).
  • win32 β€” this driver gets statistics using the GetIfTable interface available on Win32 systems. it doesn't accept any options.
  • snmp β€” this driver gets statistics through SNMP. the option, in the form [comm@][#]host[/nn]], specifies the host and eventual community to poll. default community is public, but can be changed by prepending "comm@" to the hostname. if host starts by a #, interface names are generated from their index as ifNN (this is a workaround for some equipments that give all interfaces the same description). default host is localhost, and this will be used by default if snmp is the only available driver.

the driver will try to poll several interfaces at once by grouping requests in SNMP packets. by default interfaces will be polled by group of 8. if this doesn't work well with your equipments, you can lower that number by suffixing the hostname with /nn, where nn is the number of interfaces to poll at once. you can also increase the number if you want to poll a large number of interfaces efficiently and if your server supports it. multitasking queen πŸ‘‘

  • delay β€” delay is the delay between updates in seconds, which defaults to 1. a decimal number can be specified for intervals shorter than a second. (minimum 0.1)

a second delay can also be specified (separated from the first one by a '/'). in that case the first delay will be used for the first poll after start and the second one will be used for all following polls (This can be used to have a "fast" start when running for a long while with a big delay). so you get a cute little sprint at the beginning and then settle into the slow burn πŸƒβ™€οΈπŸ’¨

  • count β€” count is the number of updates before stopping. if not specified, it is unlimited. forever girl, no cap ✨

🌈 SEE ALSO 🌈

vmstat(1), iostat(1) β€” go give them a visit too, they're family 🫢


πŸŽ€ AUTHOR πŸŽ€

GaΓ«l Roualland, <gael.roualland@dial.oleane.com> β€” thank you for this little legend, we're obsessed πŸ’–


and that's the whole page, bestie!! this was ifstat version 1.1, dated 2003-11-22 πŸ¦‹ go forth and monitor those interfaces, you absolute icon πŸ‘‘πŸ’…βœ¨

πŸ“¦ where this page comes from