IFSTAT(1)

πŸ“¦ version 1.1, in fedora 43, fedora 44

πŸ’– IFSTAT(1) πŸ’–

okay bestie, so this is ifstat β€” that's "Report InterFace STATistics", and yes the name is literally just the name of the tool spelled out. we're doing the Unix manual thing but make it cute. buckle up. πŸŽ€

It lives in the System Utilities corner of your man pages, so you know it's a little utility that's about to be your new obsession. ✨


✨ NAME ✨

ifstat β€” Report InterFace STATistics. that's it. that's the whole name. iconic. πŸ’…


🌸 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]]

no cap, that's a lot of brackets. don't panic. we go through every single one below. 🫢


πŸ¦‹ DESCRIPTION πŸ¦‹

So like, ifstat is a little tool that reports interface activity. that's the whole vibe. it does for your network interfaces what iostat/vmstat do for other system statistics. main character energy fr fr. ⭐


πŸ’… OPTIONS πŸ’…

ifstat accepts the following options (and yes, we're doing all of them, no skips, no shortcuts):

  • -l β€” turns ON monitoring of loopback interfaces (the ones where stats are actually available). by default, ifstat monitors all non-loopback interfaces that are up. so if you were wondering where lo went, it's because of this default. mystery solved bestie. πŸ”
  • -a β€” monitors ALL the interfaces it can find, as long as stats are available for them. yes, all of them. it's giving overachiever. πŸ‘‘
  • -z β€” hides interfaces whose counters are null, like interfaces that are up but literally not being used. shy interfaces, we don't see them. πŸ™ˆ
  • -i β€” specifies the list of interfaces to monitor, separated by commas. and listen, if an interface name itself has a comma in it, you can escape it with '\'. also cute: if you pass this option multiple times, the instances get added together. stacking, as you do. πŸ’–
  • -s β€” equivalent to -d snmp:[comm@][#]host[/nn]], i.e. poll a remote host through SNMP. details down below, keep reading. πŸ“‘
  • -h β€” displays a short help message. when in doubt, ask for help. no shame. 🫢
  • -n β€” turns OFF displaying the header periodically. so the header shows up... not periodically. got it. πŸ™ƒ
  • -t β€” adds a timestamp at the beginning of each line. time-stamped and organized, we love a girlboss. ⏰
  • -T β€” reports total bandwidth for all monitored interfaces. the sum. the whole squad combined. πŸ”₯
  • -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 indexes change a lot (new interfaces being added and whatnot), you might lose some stats, hence this flag. also important, no cap: if you ask ifstat to monitor a non-existent interface, it will poll all interfaces until it finds the one you asked for β€” regardless of this flag β€” so you can totally poll for an interface that goes up and down. queen of persistence. πŸ’€
  • -w β€” uses fixed width columns, instead of enlarging them as needed so interface names fit. rigid. structured. we respect it. πŸ“
  • -W β€” wraps lines that are larger than the terminal width. note this implies -w. wrapped lines get prefixed with a cycling letter so they're easier to read. thoughtful king behavior. πŸŽ€
  • -S β€” keeps stats updated on the same line if possible, so there's no scrolling and no wrapping. calm. zen. ✨
  • -b β€” reports bandwidth in kbits/sec instead of kbytes/sec. bits not bytes, choose your fighter. βš”οΈ
  • -q β€” quiet mode, warnings are not printed. shhh. 🀫
  • -v β€” displays the version and the compiled-in drivers. like a little roster of who's on the team. πŸ“‹
  • -d β€” specifies a driver to use for gathering stats, plus an eventual option for that driver, separated from the driver name by a colon. if you don't specify this, ifstat uses the first driver compiled in, with no options. defaults gonna default. 🌸

The following drivers are available β€” though depending on your operating system and compile-time options, not all of them might be present:

  • proc β€” gets statistics from Linux's /proc/net/dev file. an alternate file name to get stats from can be passed as the option. 🐧
  • ifmib β€” gets statistics from FreeBSD's ifmib sysctl. it doesn't accept any options. no notes. 🧊
  • kstat β€” gets statistics from Solaris kstat interface. it doesn't accept any options. 🌞
  • ifdata β€” gets statistics using SIOCGIFDATA ioctl under IRIX and OpenBSD (and heads up, those have different semantics). it doesn't accept any options. πŸŒ€
  • route β€” gets statistics using routing sysctl on BSD based systems. it doesn't accept any options. πŸ›£οΈ
  • kvm β€” gets statistics by reading the kernel live structures. it accepts an option specifying which files/devices to use, in this 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.

⚠️ okay serious moment bestie: for this driver to work, ifstat needs read access to the system memory device. this is usually done by running it as root, or by installing setgid mem or setgid kmem. and here's the thing β€” ifstat will NOT install setgid by default. it is up to you to decide if you trust it. read that again. πŸ‘€
  • dlpi β€” gets statistics using the DLPI streams interface available on HP-UX. an alternate device to query statistics from can be passed as the option β€” the default is /dev/dlpi. πŸ’œ
  • win32 β€” gets statistics using the GetIfTable interface available on Win32 systems. it doesn't accept any options. windows representation, we love to see it. πŸͺŸ
  • snmp β€” 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 you can change it by prepending "comm@" to the hostname.
    • if the host starts with 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 are polled in groups of 8. if that 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 that number if you want to poll a large number of interfaces efficiently and if your server supports it. flexible. adaptable. slay. πŸ”₯

  • delay β€” 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 is used for the first poll after start, and the second one is used for all following polls. this can be used to have a "fast" start when running for a long while with a big delay. honestly? genius. 🧠

  • count β€” the number of updates before stopping. if not specified, it is unlimited. infinite. boundless. no thoughts, just stats. ♾️

🌈 SEE ALSO 🌈

vmstat(1), iostat(1)

(go read those too, they're the siblings, the family, the whole squad 🫢)


πŸ’œ AUTHOR πŸ’œ

GaΓ«l Roualland, <gael.roualland@dial.oleane.com> β€” thank you for this gift, we are obsessed. πŸŽ€


and that's the whole page bestie! this was ifstat version 1.1, dated 2003-11-22, and honestly? a 2003 banger that still eats. go check your interfaces, they're probably doing numbers. bye! πŸ’–βœ¨πŸ¦‹πŸŒΈ

πŸ“¦ where this page comes from