Showing posts from 2018


After publishing my last post, I found out that many forks of kSar have been created. I didn't spend too much time comparing them, but ksar2  looks promising. Have fun!

Using kSar with Red Hat Enterprise (or CentOS) 7

Hi, I really like using kSar for troubleshooting on Linux, but it doesn't work out-of-the-box with version 7 of Red Hat Enterprise Linux or its derivatives (CentOS, Scientific Linux, etc.).  It just doesn't work with the standard " sar -a " command, so one of my colleague had a bit of free time and found the combination of arguments that makes it work. It looks like there is one of the options that are included in -a was not included in previous versions, and kSar cannot process the additional output. Here's the command line that works: sar -bBdqrRSuvwWyp -I SUM -I XALL -m ALL -n ALL -u ALL -P ALL The 'p' is, however, optional. I add it to have pretty names for disks instead of dev2-0, dev253, etc. On a side note, if you want to have better results, change the frequency at which the sar cronjob runs (in /etc/cron.d/sysstat , change the '*/10' by just '*'). Also, if you want to see 'waiting for I/O' data with RHEL 7, go in

Another interesting package - ps_mem

I find it hard to see what's using the RAM in a server and ps_mem can help.  It lets you know the memory usage of applications. I haven't found how to install it on Ubuntu, but on Red Hat and derivatives, it's available in the EPEL repo.  You can use it by simply executing the ps_mem command, which gives this kind of output: [root@vps1 ~]# ps_mem  Private  +   Shared  =  RAM used       Program   8.0 KiB +  24.0 KiB =  32.0 KiB       agetty (2)   4.0 KiB +  30.0 KiB =  34.0 KiB       xinetd   4.0 KiB +  49.5 KiB =  53.5 KiB       lvmetad   0.0 KiB +  73.5 KiB =  73.5 KiB       saslauthd (2)   8.0 KiB +  89.0 KiB =  97.0 KiB       pmdadm  16.0 KiB + 142.5 KiB = 158.5 KiB       systemd-udevd 128.0 KiB +  90.0 KiB = 218.0 KiB       pmdaxfs 152.0 KiB + 120.5 KiB = 272.5 KiB       crond 176.0 KiB + 104.5 KiB = 280.5 KiB       pmdaroot 108.0 KiB + 178.0 KiB = 286.0 KiB       avahi-daemon (2) 340.0 KiB + 128.0 KiB = 468.0 KiB       pmie 328.0 KiB + 330.0 KiB = 6

ncdu (NCurses Disk Usage)

I discovered an utility a few weeks ago and I thought it would be worth sharing. This utility is especially useful when you are looking for files that take a lot of disk space on your system.  As an example, I received a Nagios notification saying that /var had less than 15% free.  I logged on the system to see what is taking too much space. In the past, I would have use the du command (du -hs /var/*, then du -hs /var/log/* and so on), but I used ncdu.  I cd'd into /var, then ran 'ncdu'. Here are screen shots of an example (different of what happened yesterday): This is what we see when we start ncdu in /var: We can use the arrows up and down to select a folder and use the left and right arrows to go up/down the tree. In this case, I simply used the right-hand side arrow a few times until I got to the folder that contains the most data: That's already great, but that's before digging into the help (using ?).  The options are (version 1.13): Sortin