Author: Sahil Suri

SAR command: ksar for GUI monitoring in Linux – Part 4

In the final article in this series, we’ll focus on generating a graphical view of sar data using ksar command because we’ve all heard the phrase a picture speaks a thousand words. Steps to install ksar in Linux Check and fix Java application Download ksar from SourceForge site Extract and install ksar application Working on prerequisites of KSAR application Ksar is a java based application which can be used to create a graphical representation of data collected by the sar command. ksar allows graphs to be collected in a variety of formats. It is easy to install and easy to use. The only major dependency is the presence of java on the system. Although JDK is usually installed on Linux systems by default but let’s verify just to be sure. Doing a quick search for jdk (java development kit) in the rpm -qa output gives a couple of results. [root@linuxnix ~]# rpm -qa | grep jdk java-1.6.0-openjdk-1.6.0.38-1.13.10.4.el6.x86_64 java-1.6.0-openjdk-javadoc-1.6.0.38-1.13.10.4.el6.x86_64 java-1.7.0-openjdk-devel-1.7.0.99-2.6.5.1.el6.x86_64 java-1.7.0-openjdk-1.7.0.99-2.6.5.1.el6.x86_64 java-1.6.0-openjdk-devel-1.6.0.38-1.13.10.4.el6.x86_64 We can verify that the java binary is available by using the which command to look for it. [root@linuxnix ~]# which java /usr/bin/java Now, let’s verify the rpm which actually provides this binary. [root@linuxnix ~]# ls -l /usr/bin/java lrwxrwxrwx. 1 root root 22 Sep 26 01:05 /usr/bin/java -> /etc/alternatives/java [root@linuxnix ~]# ls -l /etc/alternatives/java lrwxrwxrwx. 1 root root 46 Sep 26 01:05 /etc/alternatives/java -> /usr/lib/jvm/jre-1.7.0-openjdk.x86_64/bin/java [root@linuxnix ~]# ls -l...

Read More

Linux SAR command: Report historical data – Part 3

SAR file collection and historical reporting data: In a previous article, we described how sar reports data on various system performance metrics in real time. In this article, we talk about sar data is collected, stored and retrieved. When we install sysstat, it adds the following additional utilities which are responsible for collecting and storing sar data: sadc: This tool collects sar data to make it available for retrieval at a later date. sa1: It saves system activities in a binary data file. sa1 depends on sadc to provide the data. sa2: It creates a daily summary of the collected statistics. sadf: Allows generation of sar report in CSV, XML, and other formats. Both sa1 and sa2 utilities run as cron jobs. The default sysstat cron file is /etc/cron.d/sysstat and is as follows: sudo cat /etc/cron.d/sysstat # Run system activity accounting tool every 10 minutes */10 * * * * root /usr/lib64/sa/sa1 1 1 # Generate a daily summary of process accounting at 23:53 53 23 * * * root /usr/lib64/sa/sa2 -A The file is root readable and thus requires superuser privileges to access. ls -l /etc/cron.d/sysstat -rw------- 1 root root 235 Mar  8  2016 /etc/cron.d/sysstat Let’s understand the two cron jobs mentioned above: The first sysstat cron job: /usr/local/lib/sa/sa1 It runs every 10 min and collects sar data for historical reference. This writes the data to /var/log/sa/saXX file....

Read More

SAR command: Monitor CPU, Memory, disk and IO in Linux – Part 2

Measuring CPU performance with SAR command: We will continue our journey with our SAR command. We already covered on SAR command in our first post on how to install it. In this post we will see how to use SAR command to monitor CPU, RAM(Memory), disk and IO stats. Example3: To report on CPU performance in sar command, we use the -u flag. Here is an example: [sahil@linuxnix.com:~] $ sar -u 1 2 Linux 2.6.32-642.13.1.el6.x86_64 (linuxnix.com)    10/12/2017      _x86_64_        (2 CPU) 09:13:11 AM     CPU     %user     %nice   %system   %iowait    %steal     %idle 09:13:12 AM     all      0.00      0.00      1.01      0.00      0.00     98.99 09:13:13 AM     all      0.50      0.00      0.50      0.00      0.00     98.99 Average:        all      0.25      0.00      0.75      0.00      0.00     98.99 Here we can see that sar is reporting CPU utilization twice at an interval of one second and we have an average line in the end. The time is as per the systems’ time zone and displays it in real time, i.e., SAR begins reporting at 09:13:11 AM and ends at 09:13:13 AM which was the actual time on the server when the command finished. Exploring the meaning of each SAR field reported %user: Percentage of CPU utilization that occurred while executing at the user level which includes application processes, user running jobs, etc. %nice: Percentage of CPU utilization that occurred while executing at the user level with nice priority. I won’t go into...

Read More

Over 16,000 readers, Get fresh content from “The Linux juggernaut”

Email Subscribe

ABOUT ME..!

My photo
My name is Surendra Kumar Anne. I hail from Vijayawada which is cultural capital of south Indian state of Andhra Pradesh. I am a Linux evangelist who believes in Hard work, A down to earth person, Likes to share knowledge with others, Loves dogs, Likes photography. At present I work at Bank of America as Sr. Analyst Systems and Administration. You can contact me at surendra (@) linuxnix dot com.