The app looks really nice visually, a few points though:
except Exception:
pass
is generally considered to be a code smell. The problem being that when you're catching all exception information and throwing it away you will never know what went wrong and where. If you're doing a try/except Exception nested inside another except Exception then I would humbly suggest that you really need to think about refactoring and restructuring.
Also, anywhere that you see a repeating pattern, you might be better off wrapping it in a function or method rather than typing it out each time. For example in your __update__ method starting at about line 400 you've got pretty much the same code in two places with just a variable different between the two.
Besides upvoting for agreement with all the above (I didn't review the code but certainly all this is worth fixing if present), I'll also say that you probably shouldn't recommend people using `sudo` to install your thing in your README / landing page.
I will definitely try this out! Just from browsing the webpage it looks nice.
The psutil library doesn't use process accounting, does it? Without it, Glances will miss processes whose lifetime is within a single check interval.
As always when this topic comes up, I have to give a recommendation for atop. This LWN article goes into why it is awesome- https://lwn.net/Articles/387202/ . The logging and interactive examination of historical process-level metrics is the killer feature for me. Here are some screenshots- http://atoptool.nl/screenshots.php
Doubtful. I have glances running on a server at home updating on the default 1s timer, it uses 5% CPU. I should probably change that to a longer update interval, but that server doesn't do much processing so it's not a big problem.
You can also launch glances.py directly so if it is going to show up on the process list it will be as 'glances.py' and not just 'python'.
htop (and by extension top) is for CPU / memory / load information only.
Normally to get network and disk stats I have to run a combination of dstat, iotop. A simple screenshot comparison: http://i.imgur.com/eQPuQ.png
OTOH htop takes up ~2MB per instance, while glances is taking up ~13MB. Glances also doesn't have the ability to sort by columns except by CPU/mem %. You can't kill browse or kill processes from the list either.
Not sure how this would work from a UI perspective but it'd be nice if you could add other servers to be monitored. So instead of me having 20+ terminal windows open, ssh'd into each box and running this app, I could run this app from a central server that's showing all of them together.
Looks very nice. I'm a very happy user of iStat Menus for similar monitoring on OS X.
One thing that iStat menus lacks, and I was hoping Glances had (but appears not to) is a "top" like viewer for what is using bandwidth. Both applications only give the overall bandwidth usage. I'll see my bandwidth shoot up hundreds of Kbps out of nowhere and quickly try to determine what's using it through combinations of looking at open programs (maybe they're updating in the background), lsof -i, nettop if I can remember the name, but haven't been particularly keen on any of them. Any recommendations?
This looks good. For cpu and memory checks I find htop to be more lightweight and functionality wise is pretty good too.
It doesn't show disk stats though, for which something like atop should be used.
Nice! I like how it shows all the vital information in very little space.
I've been using nmon for a while, which has some interesting features like graphing, but doesn't utilize all the screen space very well.
dstat(1) is another of this ilk, also Python. I prefer it because new results are printed under old, giving history in scrollback. If on a machine where these aren't available, `vmstat 1' is the standard historical fallback.
It might surprise you just how full featured and useful plain ole Linux top really is. I made a YouTube video based on a training session I did at my old job on how to configure top to show you a lot more interesting things than it does by default.
Just a thought - ethtool and miitool provide link status for a network interface. I didn't study the code to see how this gets the network speed, but if it isn't using something like ethtool/miitool, you might want to.
[+] [-] boothead|13 years ago|reply
except Exception: pass
is generally considered to be a code smell. The problem being that when you're catching all exception information and throwing it away you will never know what went wrong and where. If you're doing a try/except Exception nested inside another except Exception then I would humbly suggest that you really need to think about refactoring and restructuring.
Also, anywhere that you see a repeating pattern, you might be better off wrapping it in a function or method rather than typing it out each time. For example in your __update__ method starting at about line 400 you've got pretty much the same code in two places with just a variable different between the two.
[+] [-] JulianWasTaken|13 years ago|reply
[+] [-] sciurus|13 years ago|reply
The psutil library doesn't use process accounting, does it? Without it, Glances will miss processes whose lifetime is within a single check interval.
As always when this topic comes up, I have to give a recommendation for atop. This LWN article goes into why it is awesome- https://lwn.net/Articles/387202/ . The logging and interactive examination of historical process-level metrics is the killer feature for me. Here are some screenshots- http://atoptool.nl/screenshots.php
[+] [-] vutekst|13 years ago|reply
[+] [-] rbanffy|13 years ago|reply
Of course, nothing beats tools like Munin. I even put business metrics there.
[+] [-] CGamesPlay|13 years ago|reply
[+] [-] mhurron|13 years ago|reply
You can also launch glances.py directly so if it is going to show up on the process list it will be as 'glances.py' and not just 'python'.
[+] [-] mahmoudimus|13 years ago|reply
Would you run this or would you run htop? I'm not sure when I'd use one over the other.
Maybe someone less dense than I knows more and can tell me what the differences are?
[+] [-] AncientPC|13 years ago|reply
Normally to get network and disk stats I have to run a combination of dstat, iotop. A simple screenshot comparison: http://i.imgur.com/eQPuQ.png
OTOH htop takes up ~2MB per instance, while glances is taking up ~13MB. Glances also doesn't have the ability to sort by columns except by CPU/mem %. You can't kill browse or kill processes from the list either.
[+] [-] wcchandler|13 years ago|reply
Again, I have no idea how to present that nicely.
[+] [-] mhurron|13 years ago|reply
[+] [-] thejosh|13 years ago|reply
[+] [-] losvedir|13 years ago|reply
One thing that iStat menus lacks, and I was hoping Glances had (but appears not to) is a "top" like viewer for what is using bandwidth. Both applications only give the overall bandwidth usage. I'll see my bandwidth shoot up hundreds of Kbps out of nowhere and quickly try to determine what's using it through combinations of looking at open programs (maybe they're updating in the background), lsof -i, nettop if I can remember the name, but haven't been particularly keen on any of them. Any recommendations?
[+] [-] sciurus|13 years ago|reply
[+] [-] CountSessine|13 years ago|reply
[+] [-] atechie|13 years ago|reply
[+] [-] nodesocket|13 years ago|reply
[+] [-] scott_karana|13 years ago|reply
[+] [-] xentronium|13 years ago|reply
i.e.
[+] [-] mschonfeld|13 years ago|reply
[+] [-] sfaruque|13 years ago|reply
[+] [-] zerd|13 years ago|reply
[+] [-] trustfundbaby|13 years ago|reply
"ERROR: Certificate verification error for github.com: unable to get local issuer certificate"
[+] [-] hardik988|13 years ago|reply
[+] [-] dazzawazza|13 years ago|reply
[+] [-] ralph|13 years ago|reply
[+] [-] w1ntermute|13 years ago|reply
[+] [-] hendry|13 years ago|reply
[+] [-] ck2|13 years ago|reply
I was playing with htop but it's not really any better than top.
[+] [-] spudlyo|13 years ago|reply
Shameless plug: http://www.youtube.com/watch?v=yFKRsLj_Jhg
[+] [-] sciurus|13 years ago|reply
It's available through the EPEL yum repository http://dl.fedoraproject.org/pub/epel/6/x86_64/repoview/atop....
[+] [-] sounds|13 years ago|reply
[+] [-] alpeb|13 years ago|reply