sar 1 0

unkategorisch

The unix sar command is a nice way to have a quick view of how a system has been doing. The default shows cpu and IO, but its output can be customized to your hearts desire. Should said organ harbor indeed things of that nature.

Looking live at values is possible too. You just have to give the program the sampling time in seconds and -and this is the kicker- optionally the number of repetitions. For instance: observing how the next minute works out for your machine in 6 six equal time chunks would require you to enter:

sar 10 6 

So far, so good. But what if you want to look constantly? More than 20 years ago I learned that using

sar 1 0

would just give me that. The zero as the last parameter was interpreted as having no end to the repetition. Zero resulting in an never ending eternity. Yes, if marketing people don’t breathe down your neck, you can put things like this into what you create.

But no good deed goes unpunished. It turns out an even smarter option is it, to make that second parameter entirely optional:

sar 1

already gets you that desired simple output. That works, is awesome, and the right thing to implement it like.

Working on a more recent machine (we are talking decades here, not even kidding) I did not get the expected output when I applied finger muscle memory and then old known pattern. Then it got funny: I read the manual, googled around, emailed the author. I just felt solving this. Apparently I felt like writing about it too. All the while the machine – that I am now successfully looking at – revealed to me what it was doing, when it got bogged down.

I am unaware about what has led to my actual epiphany to consider the omission of the second parameter. Paying closer attention to such circumstances seems like a very fruitful enterprise.

I looked back, and I encountered the issue 2013 already. Back then, I must shamefully admit, I solved it by just entering a large second number.

Two years ago it actually took me 7 seconds to find the right solution already. For me a quick solution will seemingly not be remembered when there are so much previous habits and repetitions.