What is NTP? Accurate system time is essential for the software and applications installed on the server to be able to operate correctly. NTP synchronizes very critically for financial and telemetric applications. The issue with system clock is with the passage of time; the system clock may become inaccurate owing to a variety of reasons like power failures, cheap hardware clocks, etc. To buy a uber accurate and costly crystal clock for each system is not a viable solution. This is where the Network Time Protocol (NTP) comes into the picture. What are NTP server and client? The NTP server: As said earlier to have an accurate and costly clock for each and every system is not a good solution. Thats where we have NTP servers on the Internet which have precise system times with the help of costly time crystal clocks. These servers intern synchronize with other NTP servers to have accurate system clocks. The NTP client: These are just NTP agents which keep local system time synchronize with internet-based or local NTP servers for keeping local time not to drift away. What actually NTP service do constantly monitor Internet-based NTP servers operates on UDP port number 123 and is used to synchronize system time with a reference source. The reference source, in this case, could be another server or a GPS clock. The package is generally installed on the...Read More
Author: Sahil Suri
AWK is a powerful regular expression filtering and pattern matching scripting language. Please consider heading to awk tutorials section to read through our other awesome AWK tutorials which deep dive into different aspects of the language. In this tutorial, we look at how we can use AWK to print the header lines from a file or a command output along with the pattern being searched. While filtering output from certain commands or lengthy reports, it may be important to display the first line of the file or the header line to make sense of the rest of the output which is being displayed. Consider the below output. [sahil@linuxnix ~]$ df -hTP Filesystem Type Size Used Avail Use% Mounted on /dev/mapper/vg_pbox6-lv_root ext4 18G 4.9G 12G 30% / tmpfs tmpfs 491M 80K 491M 1% /dev/shm /dev/sda1 ext4 477M 35M 418M 8% /boot /dev/sr0 iso9660 3.7G 3.7G 0 100% /media/CentOS_6.8_Final /dev/sdb ext4 488M 396K 462M 1% /u01 /dev/sdc ext4 488M 396K 462M 1% /u02 We would like to print only the ext4 type file systems but along with the header line as well to make sense of the values indicated by the respective fields. We could use grep to meet this requirement as done in the below command [sahil@linuxnix ~]$ df -hTP | grep -E "Filesystem|ext4" Filesystem Type Size Used Avail Use% Mounted on /dev/mapper/vg_pbox6-lv_root ext4 18G 4.9G 12G 30% / /dev/sda1 ...Read More
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-22.214.171.124-126.96.36.199.el6.x86_64 java-1.6.0-openjdk-javadoc-188.8.131.52-184.108.40.206.el6.x86_64 java-1.7.0-openjdk-devel-220.127.116.11-18.104.22.168.el6.x86_64 java-1.7.0-openjdk-22.214.171.124-126.96.36.199.el6.x86_64 java-1.6.0-openjdk-devel-188.8.131.52-184.108.40.206.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
Take this course
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.