How to Install and Configure Linux NTP Server and Client NTP is a protocol that allows computers to synchronize time over networks for an accurate time

Install ntp

The ntp package contains utilities and daemons that will synchronize your computer’s time to Coordinated Universal Time (UTC) via the NTP protocol and NTP servers. The ntp packageincludes ntpdate (a program for retrieving the date and time from remote machines via a network) and ntpd (a daemon which continuously adjusts system time). Install the ntp package:

# yum install ntp

How do I configure an NTP Client?

Simply open /etc/ntp.conf file, enter:

# vi /etc/ntp.conf

Make sure the following line exists:

server ntp.server.com

Configure an NTP Server

If you have lots of server and desktop system, configure your own NTP server. Your NTP server contacts a central NTP server,provided by your ISP or a public time
server located at ntp.org, to obtain accurate time data. The server then allows other machines on your network to request the time data. Our sample setup:

192.168.1.5 ==> CentOS / Fedora / RHEL NTPD Server.
202.54.1.5 ==> ISP remote NTP server.
192.168.1.0/24 ==> NTP clients including desktop systems.

First, install and enable ntpd on 192.168.1.5:

# yum install ntp
# chkconfig ntpd on

Now open /etc/ntp.conf:

# vi /etc/ntp.conf

Make sure the following line exits:

restrict default ignore

Above will deny all access to any machine, server or client. However, you need to specifically authorized policy settings. Set it as follows:

restrict 202.54.1.5 mask 255.255.255.245 nomodify notrap noquery
server 202.54.1.5

Replace 202.54.1.5 and mask with actual remote ISP or ntp.org NTP server IP. Save and close the file.

Configure NTP clients to access your NTP Server

Now, you need to allow legitimate NTP clients to access the Server. For example, allow 192.168.1.0/24 network to synchronize to this server located at 192.168.1.5. Open /etc/ntp.conf and add policy as follows:

# Hosts on local network are less restricted.
restrict 192.168.1.0 mask 255.255.255.0 nomodify notrap

Update your firewall settings, open /etc/sysconfig/iptables.

# vi /etc/sysconfig/iptables

Add the following line, before the final LOG and DROP lines for the RH-Firewall-1-INPUT chain:

-A RH-Firewall-1-INPUT -s 192.168.1.0/24 -m state --state NEW -p udp --dport 123 -j ACCEPT

Save and close the file. Finally, start ntpd:

# service ntpd start
# service iptables restart
# netstat -tulpn

Usefull Command for check NTP

1) Check if the date (year, month, day, hour, minute, second) is allign

# date

2) List active peers server

# ntpq -nc peers

3) edit ntp.conf

# vi /etc/ntp.conf

4) restart NTPd Deamon

# /etc/init.d/ntpd restart

5) Force update

# ntpdate -u ntp.server.com (ir IP)

Installing VMware Tools in a Linux virtual machine How to install VMware Tools on linux Centos Virtual Machines

Purpose

This article provides steps to install VMware Tools in a Linux guest operating system using Compiler.

Note: For an overview of installing VMware Tools, see Overview of VMware Tools (340).

Resolution

Note: If your Linux distribution is not RPM-based, has a custom kernel, or is unsupported, use the steps below to compile VMware Tools, otherwise, see Installing VMware Tools in a Linux virtual machine using RPM (1018392).

To install VMware Tools in a Linux guest operating system using Compiler:

 

Note: If your Linux distribution is not RPM-based, has a custom kernel, or is unsupported, use the steps below to compile VMware Tools, otherwise, see Installing VMware Tools in a Linux virtual machine using RPM (1018392).

To install VMware Tools in a Linux guest operating system using Compiler:

  1. Ensure that your Linux virtual machine is powered on.
  2. If you are running a GUI interface, open a command shell.
    Note: Log in as a root user, or use the sudo command to complete each of these steps.
  3. Click VM in the virtual machine menu, then click Guest > Install/Upgrade VMware Tools.
  4. Click OK.
    Note: In some cases, verify that the CDROM device is Connected from within the Edit Settings option of the virtual machine.
  5. To create a mount point, run:
    mkdir /mnt/cdrom
  6. To mount the CDROM, run:
    mount /dev/cdrom /mnt/cdrom
  7. To copy the Compiler gzip tar file to a temporary local directory, run:
    cp /mnt/cdrom/VMwareTools-version.tar.gz /tmp/
    Where version is the VMware Tools package version.
  8. To determine the version of VMware tools, run:
    ls /mnt/cdrom
    You see output similar to:
    # VMwareTools-5.0.0-12124.tar.gz
  9. To change to the tmp directory and extract the contents of the tar file into a new directory called vmware-tools-distrib, run:
    cd /tmp
    tar -zxvf VMwareTools-version.tar.gz
  10. To change directory to vmware-tools-distrib and run the vmware-install.pl PERL script to install VMware Tools, run:
    cd vmware-tools-distrib
    ./vmware-install.pl
    Notes:

    • Complete the screen prompts to install the VMware Tools. Options in square brackets are default choices and can be selected by pressing Enter.
    • To compile VMware Tools successfully, you need gcc Compiler and Linux Kernel sources provided by your Linux distribution. Consult your Linux distribution documentation for details on methods to install these packages.
    • It is normal for the console screen to go blank for a short time during the installation when the display size changes.
    • Some warnings or errors are normal, like when a files does not exist.
    • Depending on the Linux distribution, your network service might restart after installation. VMware recommends that you invoke this command from the console and not remotely.
  11. If you are running a GUI interface, restart your X Window session for any mouse or graphics changes to take effect.
  12. To start VMware Tools running in the background during an X Window session, run:
    /usr/bin/vmware-toolbox &
  13. Depending on your environment, you may need to unmount the CD-ROM. To unmount the CD-ROM, run:
    umount /mnt/cdrom
  14. Depending on your environment, you may need to manually end the VMware Tools installation. To end the VMware Tools install, click VM in the virtual machine menu, then click Guest > End VMware Tools Install.
  15. To remove VMware Tools installation packages, run:
    cd
    rm /tmp/VMwareTools-version.tar.gz
    rm -rf /tmp/vmware-tools-distrib

Original Article by VMware KB >Here<

Linux and Unix Test Disk I/O Performance With dd Command How to test disk write speed and latency on linuxsystems

How can I use dd command on a Linux to test I/O performance of my hard disk drive?
How do I check the performance of a hard drive including the read and write speed on a Linux operating systems?

You can use the following commands on a Linux or Unix-like systems for simple I/O performance test:

dd command : It is used to monitor the writing performance of a disk device on a Linux and Unix-like system.
hdparm command : It is used to get/set hard disk parameters including test the reading and caching performance of a disk device on a Linux based system.
In this tutorial you will learn how to use the dd command to test disk I/O performance.

Use dd command to monitor the reading and writing performance of a disk device:

  1. Open a shell prompt (Or login to a remote server via ssh)
  2. Use the dd command to measure server throughput (write speed)
    dd if=/dev/zero of=/tmp/test1.img bs=1G count=1 oflag=dsync
  3. Use the dd command to measure server latency
    dd if=/dev/zero of=/tmp/test2.img bs=512 count=1000 oflag=dsync

The dd command is useful to find out simple sequential I/O performance.

Here’s some examples:

Disk I/O Performance With dd Command
Disk I/O Performance With dd Command
Disk I/O Performance With dd Command
Disk I/O Performance With dd Command

 

As you can see, writing 1 file (1 GigaByte dimension) can permit to test the maximum speed of writing bandwidth, instead, writing a small file many times, is better to simulate the actual daily behavior of a server (many small files, many times a day)

IMPORTANT! To keep your filesystem clean by useless files, remember to delete test1.img and test2.img at the end of test:

  1. cd /tmp/
  2. rm test1.img
  3. rm test2.img

How To kill any remote desktop connections sessions with Qwinsta & Rwinsta How To kill remote connection using Qwinsta & Rwinsta on a terminal server on Windows Operating Systems

You can run the following commands to easily kill any remote sessions to a command prompt from a Windows Operating System (tested from Windows XP to Windows 10 and from Windows Server 2003 to Windows Server 2016), using Qwinsta & Rwinsta binary executable files under C:\WINDOWS\system32.

qwinsta.exe – Displays information about sessions on a terminal server and is same as the query session command.

rwinsta.exe – Resets sessions on a terminal server and is same as the reset session command.

Here the Instructions:

  1. Open windows command prompt
  2. to view current connections: qwinsta /server:myterminalserver

    This results in an output of

    SESSIONNAME     USERNAME     ID       STATE  TYPE DEVICE
    console                       administrator     0         Active    wdcon
    rdp-tcp                                            65536    Listen    rdpwd
    rdp-tcp#51                 administrator     2        Active    rdpwd

  3. kill a session by: rwinsta [sessionID] /server:myterminalserver

    i.e. rwinsta 2 /server:myterminalserver
    replace “myteminalserver” with your servername or ip address.

How to enable Performance data when is not available from VMware vCenter Fix Performance data when is not available for an entity by CLI

Details
When connected with VMware Infrastructure (VI) Client to the ESXi/ESX host, performance graphs are not available.
You see an error similar to:

  • Performance data is currently not available for this entity

Solution
This issue occurs when the time is not synchronized between the VI Client host and the ESXi/ESX host.

To resolve this issue, ensure there is no time differences between the VI Client host and the ESXi/ESX host.

Run these commands:

For ESXi:
/etc/init.d/ntpd restart

and

/etc/init.d/vpxa restart