15 ms·
What: A terminal tool to check what is taking up your bandwidth
- hnarn 7y agoWhat are the main differences to something like nethogs or iftop?
- kgersen 7y agoit's trendy to reinvent the wheel with Rust ?
- ragebol 7y agoIt certainly is, but there is a merit to `what` too, in a different way of presenting the data.
- kburman 7y agoWhat's wrong if someone want to make yet another x.
- recrof 7y agonothing. but it's useful to know if you need it if you already use similar tool.
- jxf 7y agoThey are similar but they answer different questions. By default, iftop will tell you "this network interface on your machine is talking a lot to ycombinator.com". But you don't necessarily know which processes are doing the most talking collectively. This will tell you "Firefox process 4567 is talking a lot ycombinator.com" and you'll know whether 4567 is also one of the chattiest talkers right now.
- bicolao 7y ago> This will tell you "Firefox process 4567 is talking a lot ycombinator.com" and you'll know whether 4567 is also one of the chattiest talkers right now. But that's what nethogs does.
- tiborsaas 7y agoWorks on windows, osx too :)
- mellosouls 7y agoYou try one of those first, then what's on second
- reaperducer 7y agoBut `whois` on first.
- deft 7y agoThank you this is amazing. I have a bunch of virtual interfaces on my server and I have no idea what's using them or if they're even still in use what created them. This solved my problem instantly.
- deleted 7y ago[deleted]
- jl6 7y agoLooks awesome but the name makes it seem designed to be difficult to find in a search engine!
- afinlayson 7y agoWhy do I need cargo to install on mac? (It would be nice to have a link to install) Updated To install run: curl https://sh.rustup.rs https://sh.rustup.rs -sSf | sh
- chias 7y agoBecause the author hasn't packaged it for you. Cargo is what you'll need to build this from source.
- jxf 7y agoCargo is Rust's build tool. You need cargo because you're building it from source.
- afinlayson 7y agoCargo isn't easily google-able ... I was hoping someone would link how to install it, instead of being sassy. I figured it out. It can be found here: https://doc.rust-lang.org/cargo/getting-started/installation.html https://doc.rust-lang.org/cargo/getting-started/installation... You can install it easily by running this: curl https://sh.rustup.rs https://sh.rustup.rs -sSf | sh
- aspaceman 7y agoVery first result for "cargo tool programming" https://binx.io/blog/2018/11/27/learning-cargo/ https://binx.io/blog/2018/11/27/learning-cargo/ You're getting snark because your own snarky comment is the equivalent of saying "Why do I need Make to run it on the MacOS?" If you had asked instead, "What is cargo, and how do I install it?" you would get more helpful responses. Snark is met with snark.
- mrtksn 7y agoAnd how people are supposed to know that it is a programming tool? I assumed that it is yet another package manager and googling about cargo brings results about logistics. It took me a few tries before figuring it out. What worked was "Install cargo MacOS" and it was hard to tell if the results are not a scam to make me install some spyware.
- jslakro 7y agoI need this for windows.
- deleted 7y ago[deleted]
- stinos 7y agoTcpView and built-in Resource Monitor come pretty close actually. Not the exact same feature set perhaps, but if the question is 'what is taking up bandwidth and to which address' then they do the job.
- rzzzt 7y agoGlassWire has some statistics related to processes and remote connections: https://www.glasswire.com/features/#bandwidth https://www.glasswire.com/features/#bandwidth
- deleted 7y ago[deleted]
- Hortinstein 7y agowould this work with WSL...dont think it would with wsl2 since it runs in a virtual kernel. It could work with WSL though, very curious if anyone can get it to work
- mcyukon 7y agoI used to use Glasswire, however did not like the yearly subscription and limited interface. Now I use NetLimiter 4: https://www.netlimiter.com/ https://www.netlimiter.com/ Among other features like process blocking, it has a process list not very different than this utility as well has bandwidth graphing over a period in time which is very useful in tracking down bandwidth hogs on a monthly capped DSL line. https://www.netlimiter.com/docs/netlimiter-overview/features/internet-traffic-monitoring https://www.netlimiter.com/docs/netlimiter-overview/features...
- drummer 7y agoNetlimiter is amazing. Using it for many years. Highly recommended.
- deleted 7y ago[deleted]
- plmu 7y agoInstallation with yay/crate can be slow. This small tool took 4 minutes of compile time, the Rust crates seem to be very fine granular (like node.js vor example) and require much compile time. 204 crates needed to be compiled. I found that, using yay or another aur helper on arch linux, having a few rust utilities installed that have regular updates, significantly slows down the average system upgrade time. I tend to avoid Rust programs for that reason.
- adimitrov 7y agoThat's the nature of these spare time one (wo)man side projects: packaging a piece of software for a wide variety of distributions and platforms is tedious and boring, so unless there's a large community (or money) involved, you have to compile it from source. Of course, you can always package your favourite utility for your favourite distribution. I'm sure the author would be thrilled to endorse your package in the Readme. Note also that Rust can compile to portable static binaries. This tool is available as such from the releases page on GH (it's in the readme)
- psibi 7y agoHow is that musl based binary built ? I saw the repositories travis configuration and wasn't able to find anything relevant.
- steveklabnik 7y agoThe simplest way is to pass the —target flag with the musl target; that should work unless you’re also including C code, and then it may Just Work or may need you to do something special.
- res0nat0r 7y agoI've been using `nethogs` for this for a long time, and it is already in most Linux repos and can be installed quickly. https://github.com/raboof/nethogs https://github.com/raboof/nethogs
- avoro 7y agoWhat can be a reason if on MacOS it does not capture traffic? I see empty panels. Tried to run with and without `sudo`.
- nsomaru 7y agoAnother poster did mention that a similarly named utility already exists on MacOS. Perhaps you’re invoking that instead?
- avoro 7y agoYes name is not unique and conflicting with existing tool. I'm launching exact this utility by defining path as ~/.cargo/bin/what or sudo ~/.cargo/bin/what
- weavie 7y agoYeah, I'm also just getting blank panels.. Mojave 10.14.6
- berryg 7y agoSame here. Tried different interfaces. Nothing.
- guytv 7y agoCatalina: getting "failed to listen" when running non-root, Shows empty panels when ran with sudo.
- readyplayeremma 7y agoYou can run as non-root by using setcap to give extra capabilites to the binary: sudo setcap cap_net_raw,cap_net_admin=eip <path_to_what_binary>
- hmage 7y agosetcap is Linux-specific thing. Doesn't exist on freebsd, darwin(macosx) or any other unix.
- gluegadget 7y agoA bit unrelated but I wrote https://github.com/amir/hepccn https://github.com/amir/hepccn to list TCP connections by domains rather than just IPs. It filters connections to port 443 and 8443, downloads the peer certificate and then extracts the subject name (pretty sure I learned this trick from an article on Julia Evans' website but can't find it now). I wanted to add more functionalities to it but I stumbled upon an issue and that's for when SNI is enabled. I guess there's no way for me to recover the hostname the client has sent at the start of the handshaking process without introducing MITM, right?
- tialaramex 7y agoYou won't be able to recover it after the fact, but the SNI is cleartext on the wire as part of ClientHello even in TLS 1.3. Work to encrypt this is an ongoing effort (called eSNI).
- nneonneo 7y agoYou can recover SNI if you sniff from the very beginning, but not thereafter. It’s only sent once as part of the initial TLS handshake.
- lazyjones 7y agoBad naming.. WHAT(1) BSD General Commands Manual WHAT(1) NAME what -- show what versions of object modules were used to construct a file (MacOS ...)
- mobilemidget 7y agocargo install what (fails) Package `trust-dns-proto v0.18.0` does not have these features: `tokio-compat` (MacOS 10.15.2)
- djsumdog 7y agoThis is one of the biggest problems I've had with any neat Rust thing posted up here. The language changes a lot. I have rust/cargo 1.37.0 installed (it's the latest marked stable in Gentoo) and adler32 v1.0.4 fails to compile with "`core::slice::<impl [T]>::len` is not yet stable as a const fn". I'm installing 1.40.0 from the unstable tree to see if that will build it. I've had situations where I'm either not on the latest version of rust, or I'm on too current a version of rust, which deprecated/removed some feature needed for a dependency. I'm not sure if devs can define their min/max versions, but that kinda check should probably be done before cargo starts building packages.
- StavrosK 7y agoAgreed, and I had the same problem. It seems like an easy fix to add a requires_rust_version thing in Cargo.toml, and devs could at least set it to "the version I'm currently using" so we know it's guaranteed to build on that.
- steveklabnik 7y agoIt’s not that easy; the real world has a lot of complexity. That said, we finally did accept a design for this in October; it’s not clear when it’s going to land though.
- 7y ago
- pmontra 7y agoI find the --raw output more useful than the interactive one. it scrolls away but I have time to read what's going on. The other one just disappears and is replaced by something else, which could be ok except sometimes there are seconds of useless black screen when nothing is going on. I suggest to never have blank screens. A suggestion for the raw output: add a timestamp at the beginning of the line. Probably HHMMSS is enough but YYYYmmdd would be handy for logging in background.
- noisy_boy 7y agoSeconded. It might be a good idea to have a separate "top-so-far" section that can build-up over time to show the top consumers (and also allow sorting this by hostname to avoid too much jumping).
- highhedgehog 7y agoPlot twist. It's the tool
- makach 7y agoIs this the future? I am setting this up on my macOS, and before I could 'cargo add' anything I had to 'brew install rust'. Now it is downloading and compiling lots and lots of dependencies.
- unnouinceput 7y agoOn Windows I find TCPView from good old Sysinternals to be perfect for this job.
- acrossthepond10 7y agoError: Failed to listen on network interface: No such file or directory (os error 2) on macOS. Anyone else getting this error?
- guytv 7y agoYep. checked on two different machines connecting to two different networks.
- hising 7y agoI get Error: Failed to listen on network interface: Operation not permitted (os error 1) on Arch Linux.
- decio 7y agoOn macOS 10.14.6 the command starts but the frames stays empty (silent error) because of SIP "Sandbox: lsof System Policy: deny(1)" Otherwise, really nice idea and work!
- ronyfadel 7y agoI have SIP disabled, and I'm getting `Error: Failed to listen on network interface: No such file or directory (os error 2)`
- Dowwie 7y agotop of HN front page and without mentioning that it is written in Rust
- aliveupstairs 7y agoWhat's that have to do with anything (it being top front page)? are there guidelines for naming posts so that the language a software is written in is preferably in the title?
- dwohnitmok 7y agoParent is probably being a bit sarcastic and referring to the perception that HN zeroes in and upvotes submissions based on how trendy the implementation language is.
- JdeBP 7y agoYour bug report has since been addressed. (-:
- SuperSandro2000 7y agoCan I now trash iftop and nethogs?
- nutbuttercrack 7y agoMaybe you should call it iWhat? Anyway, great program!
- imsnif 7y agoHey, I am the author of "what" and am very happy to hear people like this tool I made. :) "what" was my first real attempt at rust, and I love the project very much. That said, it is a hobby project - and so I will likely be a few days responding to all issues and contributions that came from this thread. "what" has already received some great contributions that are major parts of the code base. I would be very happy for more (in the form of features, bug fixes, issues and packaging). A note to those having issues installing: as mentioned in this thread, packaging for all the various linux distributions and mac is a great effort. I apologize that at the moment the installation is a little bumpy (especially for those not very familiar with rust). A good first step for if "cargo install what" isn't working is to try to `rustup update` so you get the latest version of rust and cargo. Other than that, I hope to support your setup in the future, and/or hear from you in the issues of the repo. Debug help for OSes I do not have access to would be greatly appreciated. :) Thank you all!
- owaislone 7y agoThanks for the tool. Easier install methods would be great. For now I've added the following to my bootstrap makefile: wget -qO- https://github.com/imsnif/what/releases/download/${WHAT_VERSION}/what-v${WHAT_VERSION}-x86_64-unknown-linux-musl.tar.gz | tar xvz -C ~/bin/
- adelarsq 7y agoAny plans about create a library around this tool?
- btown 7y agoLooking at how it does reverse DNS lookups to try and map backwards... is there such thing as a crowdsourced database that resolves the most common domain name(s) that resulted in a given IP address? Seems like this would be tremendously useful for any sort of network tooling, but I can’t find any references from a quick search.
- nimrody 7y agoYou do realize that multiple domains may be hiding behind the same IP address? This is very common with CDNs (although the bigger players can afford a static CDN IP, I guess)
- creeble 7y agoRobtex.com and some similar animals have some historic mappings, though of course not comprehensive.
- ngcc_hk 7y agoTopnet might be a better name.
- anderspitman 7y agoVery nice. I dream of the day our networking instrumentation is good enough that when I click on a link and my browser hangs doing nothing, I can switch to my monitor app and have it tell me exactly where the route is failing.
- DINKDINK 7y agoWhat's the difference between what and nettop? Other similar tools: nettop iptraf iftop nethogs
- TwoNineFive 7y agoI immediately thought if iftop and iptraf https://www.binarytides.com/linux-commands-monitor-network/ https://www.binarytides.com/linux-commands-monitor-network/ There's already a ton of tools that do this. It's a nice show-off project but I doubt OP is in for the long haul.
- strictfp 7y agoI'll take this moment to plug the tool 'origin', which plows through aliases and symlinks to find the executable behind a command: https://github.com/atorstling/origin https://github.com/atorstling/origin
- dantillberg 7y agoWhat connection does 'origin' have to 'what'?
- strictfp 7y agoI thought it was scratching a similar itch - simplifying a common everyday task
- 0xdead 7y agoAny clues how to fix this? error: `core::slice::<impl [T]>::len` is not yet stable as a const fn --> /Users/0xdead/.cargo/registry/src/github.com-1ecc6299db9ec823/bytes-0.5.3/src/bytes.rs:121:18 | 121 | len: bytes.len(), | ^^^^^^^^^^^
- ExtraServings 7y agoRunning Catalina, with sudo I'm able to get the screen up and running, but at first data I get a panic: thread 'display_handler' panicked at 'overflow when subtracting durations', src/libcore/option.rs:1185:5 note: run with `RUST_BACKTRACE=1` environment variable to display a backtrace.
- mlindner 7y agoI'm not surprised about OS X, recent OS versions have been making it more and more different from how the OS previously worked. For example GDB doesn't work anymore, and neither does valgrind.
- microcolonel 7y ago> neither does valgrind Woah, that's a huge step backward. How do they expect anyone to write half-decent C for their operating system without valgrind?
- cheez 7y agoGetting an error: .cargo/registry/src/github.com-1ecc6299db9ec823/bytes-0.5.3/src/bytes.rs:121:18 | 121 | len: bytes.len(), | ^^^^^^^^^^^ error: aborting due to previous error error: Could not compile `bytes`. warning: build failed, waiting for other jobs to finish...
- pm90 7y agosame. I tried googling around a bit, but nothing useful showed up :(. I don't understand how rust/cargo work so just giving up at this point.
- edflsafoiewq 7y agohttps://github.com/tokio-rs/bytes/issues/326 https://github.com/tokio-rs/bytes/issues/326
- wscott 7y agoIt requires a very recent version of rust. Do a 'rustup update' to get the latest stable release. You can't use the distribution's packages for rust and cargo if you want to play new rust programs.
- cheez 7y agoMakes sense.
- newman8r 7y agoWill give this a spin, but anyone who enjoys this might like to take a look at the etherape package, I really like its visualizations.
- MacKay 7y ago'bandwhich' I like the new name a lot!
- imsnif 7y agoName has changed to "bandwhich" as suggested here: https://old.reddit.com/r/rust/comments/ehl68y/what_a_terminal_tool_to_check_what_is_taking_up/fckesmm/ https://old.reddit.com/r/rust/comments/ehl68y/what_a_termina...
- wodenokoto 7y agoThat is such a great name! I love it!
- ryanmjacobs 7y agoThank god for the name change! I saw this project this morning and it looked super interesting. I tried googling around for it to install it, but nothing worked haha "bandwith monitor what", "github rust what", etc. And this is coming from a hypocrite who's most popular project is named 'c'. Bandwhich is a clever and easy to find name!
- proverbialbunny 7y agoIs sudo required? I get Error: Failed to listen on network interface: Operation not permitted (os error 1)
- noisy_boy 7y agoSeems that way - error went away with sudo
- nieve 7y agoFor some reason (possibly security limitations) it doesn't seem to be able to monitor connections over a WireGuard connection's tunX interface.
- imsnif 7y agoHi! Would you be willing to open an issue in the github repo? I am not aware of this bug and would be very happy to address it. I would especially be interested if this happens to be the same bug as: https://github.com/imsnif/bandwhich/issues/51 https://github.com/imsnif/bandwhich/issues/51 Thanks!