networked day to day technical issues


Visualize sar reports with awk and gnuplot

On several systems where only sar (part of sysstat) is collecting and storing performance data i needed to troubleshoot performance issues which occurred several hours earlier . Sar is a great tool but  it is annoying that it doesn't have any option to output at the same time , on the same page, output from different reports (like cpu usage, memory usage and disk usage). If you try to request those three at the same time, it will output each report on it's on page and from there it's hard to visualize how each performance indicator evolved at a specific point in time. A solution would have been to load the data in a spreadsheet application and use vlookup function to group the data but this is time consuming and with my spreadsheet skills i don't think it can be automated.

I used awk and order to create a report from sar output, choosing the fields i considered useful in 95% of the times. Because my display resolution width is 900 i managed too squeeze in a lot of fields. In order to get a report for the date of 18th from 10 AM to 6 PM i use:


The Confusion Between Gigabyte And Gibibyte

Recently i have been confronted with several cases where on the SAN side a LUN was configured, of a certain size and on the Linux side it was detected with a larger size. The SAN vendor's support team didn't ever reply to why this is happening and after some digging i managed to find the explanation. I presumed it was some kind of issue with how each part (SAN Storage Array and Linux) measured the LUN and it turned out to be so. The Linux in question is RHEL 5.5 64bit , kernel 2.6.18

It turns out that on the SAN side the size was presented in Gibibytes and Linux presented the size as Gigabytes .

1 Gigabyte (GB) = 1 x 1000 x 1000 x 1000 = 1000000000 bytes

1 Gibibyte (GiB) = 2^30 = 1 x 1024 x 1024 x 1024 = 1073741824 bytes

So a 500 GiB LUN was reported on Linux as ~536.8 GB

Unfortunately this confusion will haunt for a long time.

More details on wikipedia and  man 7 units