Showing posts with label Operating System. Show all posts
Showing posts with label Operating System. Show all posts

Friday 7 July 2017

How to configure NTP Server on AIX Operating system

NTP ( Network time Protocol) is one of the oldest internet protocol still in use and it allows the synchronization of computer clocks distributing UTC (Coordinated Universal Time) over the network.

Their are several ways to configure the NTP server in different linux servers but if you are doing configuration on AIX operating system it's seems tricky, So in this post you can aware about the step by step configuration of NTP in AIX.

Step by Step Configuration of NTP Server:

➤ In the initial step we must verify that we have check the available NTP server on AIX server. For this please run the below command.

ibm_aix:/>lssrc -ls xntpd
-----------------------------------------------
 Program name:    /usr/sbin/xntpd
 Version:         3
 Leap indicator:  00 (No leap second today.)
 Sys peer:        ntp.aix.in.com
 Sys stratum:     4
 Sys precision:   -18
 Debug/Tracing:   DISABLED
 Root distance:   0.014709
 Root dispersion: 0.066422
 Reference ID:    192.168.1.22
 Reference time:  dc721077.d3a8e000  Tue, Mar 14 2017  7:47:19.826
 Broadcast delay: 0.003906 (sec)
 Auth delay:      0.000122 (sec)
 System flags:    pll monitor filegen
 System uptime:   19248381 (sec)
 Clock stability: 0.000107 (sec)
 Clock frequency: 0.000000 (sec)
 Peer: ntp.aix.in.com
      flags: (configured)(sys peer)
      stratum:  3, version: 3
      our mode: client, his mode: server
 Peer: ntpuk.aix.in.com
      flags: (configured)(sys peer)
      stratum:  3, version: 3
      our mode: client, his mode: server
Subsystem         Group            PID          Status
xntpd            tcpip            8520514      active
------------------------------------------------------

You can found the above output once you run the above command to check the available NTP server. On my AIX machine if you see the sys peer should show a valid server (ntp.aix.in.com). If the server is not showing any ntp server then we need to correct it by adding a server line into /etc/ntp.conf and will take restart of "xntpd" services.

Note : In this post I will use my dummy NTP name instead of real NTP server because of security reason.

➤ As your NTP server is not configured and it is show "insame" then you need to add manual entry on the NTP configuration file.

ibm_aix:/>vi /etc/ntp.conf

server ntp.aix.in.com
server ntpuk.aix.in.com

Once you added these ntp server entry manually on the configuration file then please take a restart of NTP services.

ibm_aix:/>stopsrc -s xntpd
ibm_aix:/>startsrc -s xntpd

Using above command we can stop and start the "xntpd" service on AIX operating system.

➤ In this step you need to again verify the status of newly added NTP server.

ibm_aix:/>lssrc -ls xntpd

It is taking some time that time because it synchronize process is running. Once the synchronization has been complete and you run the above command you can found the NTP server entry as describe in Step 1.

Step by Step configuration of NTP Client:

➤ On the client machine you need to again verify that you have a server suitable for synchronization or not. For this please run the below command.

ibm_aix:/>ntpdate -d ntp.aix.in.com
-----------------------------------------------------------
14 Mar 08:16:21 ntpdate[64356890]: 3.4y
transmit(192.168.1.22)
receive(192.168.1.22)
transmit(192.168.1.22)
receive(192.168.1.22)
transmit(192.168.1.22)
transmit(192.168.1.22)
transmit(192.168.1.22)
server 192.168.1.22, port 123
stratum 16, precision -6, leap 11, trust 000
refid [63.15.23.11], delay 0.03688, dispersion 24.00334
transmitted 4, in filter 4
reference time:      00000000.00000000  Thu, Feb  7 2036  7:28:16.000
originate timestamp: dc721745.3ff1b000  Tue, Mar 14 2017  8:16:21.249
transmit timestamp:  dc721746.3d08a000  Tue, Mar 14 2017  8:16:22.238
filter delay:  0.03688  0.05624  0.00000  0.00000
               0.00000  0.00000  0.00000  0.00000
filter offset: -0.00081 -0.00750 0.000000 0.000000
               0.000000 0.000000 0.000000 0.000000
delay 0.03688, dispersion 24.00334
offset -0.000812

14 Mar 08:16:23 ntpdate[64356890]: no server suitable for synchronization found
--------------------------------------------------------------------------

If you get the message ," no server suitable for synchronization found", verify xntpd is running on the server also verify that no firewalls are blocking port 123.

➤ If the no server suitable for synchronization then you must specify the xntpd server in /etc/ntp.conf.

ibm_aix:/>vi /etc/ntp.conf

server ntp.aix.in.com

Once you added the NTP server entry on client configuration file then restart the "xntpd" service again.

ibm_aix:/>startsrc -s xntpd

➤ If you want to start the xntpd service on boot time then you need to uncomment the below lines on the configuration file.

ibm_aix:/>vi /etc/rc.tcpip

Unconmment the following line

start /usr/sbin/xntpd "$src-running"

➤ Now verify the NTP server on client machine has been synchronized or not. Please use the same command which we used for checking the status.

ibm_aix:/>lssrsc -ls xntpd

This time on the NTP client machine sys peer should display the IP Address or name of your "xntpd" server. As you know it is taking some time to synchronization so you must wait for time.

Tuesday 4 July 2017

Step by Step Configuration of NTP Server on HP-UX Server

In this post, I would like to explain how we configure the NTP (network time protocol) server on HP-UX operating system server. In my recent post you can found the NTP configuration on Solaris and AIX platform. 

As you know NTP ( Network time Protocol) is one of the oldest internet protocol still in use and it allows the synchronization of computer clocks distributing UTC (Coordinated Universal Time) over the network. It is basaiclly used for time synchronization on Unix servers.

Step by Step Configuration of NTP Server on HP-UX:

➤ In the first step we will check the configuration files of "xntpd" daemon. By default the configuration file for this daemon is "/etc/rc.config.d/netdaemons".

hpx:/> vi /etc/rc.config.d/netdaemons

######################################
# xntp configuration.  See xntpd(1m) #
######################################
#
#  Time synchronization daemon
#
# NTPDATE_SERVER: name of trusted timeserver to synchronize with at boot
# (default is rootserver for diskess clients)
# XNTPD:        Set to 1 to start xntpd (0 to not run xntpd)
# XNTPD_ARGS:  command line arguments for xntpd
#
# Also, see the /etc/ntp.conf and /etc/ntp.keys file for additional
# configuration.
#
export NTPDATE_SERVER=
export XNTPD=0
export XNTPD_ARGS=

This is default configuration entry of this file so for xntpd daemon we need to change the variable which is defined.

export NTPDATE_SERVER='ntp.in.pool.org'
export XNTPD=1
export XNTPD_ARGS=

Note: You must change the NTPDATE server name.

➤ For ntp config please set the correct timezone is setup in /etc/TIMEZONE file.

hpx:/> cat /etc/TIMEZONE
TZ=IST-5:30
export TZ

You can edit the file in vi editor and change the time zone as per your location.

➤ Now, we need to make some changes in NTP configuration files. 

hpx:/> cat /etc/ntp.conf
#Configuration NTP des serveurs
server ntp.in.org.com
server ntpin.in.org.com

You need to replace ntp server name accordingly. In my post I will use dummy server name.

➤ After setting the NTP server name we need to restart the NTP service on HP-UX operating system and verify the ntp configuration.

hpx:/> /sbin/init.d/xntpd restart

hpx:/> ntpq -p

If it is showing you correct ntp server information now. You can match these information with the NTP server name which we use in above step.

HP-UX Logical Volume Manager (LVM) Commands with an Example

In this post, You can get an idea about HP-UX logical volume manager commands with an example. As you know LVM is basically used for disk management in operating system that allow to manager the physical disks and logical volume.

Please find the below HP-UX LVM commands with an example.

➤ Create a new volume group, logical volume and file system:

You can used the below command in HP-UX operating system to create a new volume group, logical volume and file system.

hpx:/>pvcreate /dev/rdsk/c2t1d0

For creating a new volume group first we need to create physical volume as describe in above command.

hpx:/>mkdir /dev/vg01
hpx:/>mknod /dev/vg01/group c 64 0x010000

In above step we will create a directory where we need to create a volume group.

hpx:/>vgcreate /dev/vg01 /dev/dsk/c2t1d0

After successfully creation of volume group we will create a new logical voulme as describe in below command.

hpx:/>lvcreate -L 2048 /dev/vg01

hpx:/>newfs -F vxfs -o largefiles /dev/vg01/vgvol1

Using above command we create a new file system now in next step we will create a directory where we need to mount the newly created file system.

hpx:/>mkdir /backup
hpx:/>mount /dev/vg01/vgvol1 /backup

Once you mount the logical voulme with file system you can run the file system checking command to verify that mounting is succesfully or not.

Create a stripped filesystem:

In this, we will create a stripped file system with the help of volume group and logical voulme.

hpx:/>lvcreate -i 2 -I 32 -L 48 -n vgvol1 /dev/vg01

-i number of stripes
-I stripe size of 32KB
-L size of the volume

HP-UX display boot information:

You can use the below command to display boot information.

hpx:/>lvlnboot -v /dev/vg00

Boot Definitions for Volume Group /dev/vg00:
Physical Volumes belonging in Root Volume Group:
        /dev/dsk/c2t0d0 (0/1/1/0.0.0) -- Boot Disk
        /dev/dsk/c2t1d0 (0/1/1/0.1.0) -- Boot Disk
Boot: lvol1     on:     /dev/dsk/c2t0d0
                        /dev/dsk/c2t1d0
Root: lvol3     on:     /dev/dsk/c2t0d0
                        /dev/dsk/c2t1d0
Swap: lvol2     on:     /dev/dsk/c2t0d0
                        /dev/dsk/c2t1d0
Dump: lvol2     on:     /dev/dsk/c2t0d0, 0

When you run the above command you can find the above output , if you see the boot information you can find you have two disk which is available for boot.

HP-UX display all disks system information:

hpx:/> ioscan -funC disk
Class     I  H/W Path        Driver   S/W State   H/W Type     Description
==============================================================
disk      0  0/0/2/0.0.0.0   sdisk    CLAIMED     DEVICE       TEAC    DV-28E-N
                            /dev/dsk/c0t0d0   /dev/rdsk/c0t0d0
disk      1  0/1/1/0.0.0     sdisk    CLAIMED     DEVICE       HP 146 GMAX3147NC
                            /dev/dsk/c2t0d0   /dev/rdsk/c2t0d0
disk      2  0/1/1/0.1.0     sdisk    CLAIMED     DEVICE       HP 146 GMAX3147NC
                            /dev/dsk/c2t1d0   /dev/rdsk/c2t1d0

In the above output you can found the all the disk which is available in the system.

HP-UX display dump devices:

hpx:/> lvlnboot -v

Normally it is showing the boot information in which you can check the dump devices name.

How to find the boot disk from HP-UX operating system

In this article , I would explain to you how we find which disk are used to boot the running HP-UX operating system. This is a bit tricky because its depending on the version of HP-UX, and whether it is using LVM or the less common choice.

For LVM disk layouts:

For 11.11 and earlier, use the below command to check which disk is in used.

hpx:/> echo “boot_string/S” | adb -k /stand/vmunix /dev/kmem
    boot_string:
    boot_string:    disk(0/0/2/0.6.0.0.0.0.0;0)/stand/vmunix

For 11.23, there are different ways for PARISC versus IA64:

PARISC:

hpx:/> echo “boot_string/S” | adb -o /stand/vmunix /dev/kmem
    boot_string:
    boot_string:    disk(1/0/0/3/0.6.0.0.0.0.0;0)/stand/vmunix

IA64 (Itanium/Integrity):

hpx:/> echo “bootdev/x” | adb -n /stand/vmunix /dev/kmem
    bootdev:
        0x100001c

Now to find the actual path, you’ll have to match the 0x100001c value to a minor number in the /dev/disk directory. Compare only the last 6 digits of the number (00001c) to find the device file. Then by using lssf, you can decode the hardware path:

    hpx:/> DSK=$(ll /dev/disk | awk ‘/00001c/{print $NF}’)
    hpx:/> echo $DSK
    disk11_p2

    hpx:/> HWPATH=$(lssf /dev/disk/$DSK | awk ‘{print $(NF-1)}’)
    hpx:/> echo “$DSK path = $HWPATH”
    disk11_p2 path = 64000/0xfa00/0xa

You can also use ioscan -m dsf to map agile device file names to legacy (CTD) style.

For VxVM disk layouts:

hpx:/> echo “raw_root/X” | adb -o /stand/vmunix /dev/kmem
     raw_root:
     raw_root:       0x3000002

This value is the minor number for the disk that was used to boot the current system. The minor number is found in the /dev/vx/dmp directory.

     hpx:/> DSK=$(ll /dev/vx/dmp | awk ‘/000002/{print $NF}’)
     hpx:/> echo $DSK
    c2t1d0s2

     hpx:/> HWPATH=$(lssf /dev/dsk/$DSK | awk ‘{print $(NF-1)}’)
     hpx:/> echo “$DSK path = $HWPATH”
     c2t1d0s2 path = 0/1/1/0.1.0

For completeness, I should mention that 11.31 will report the boot disk path in syslog.log (LVM or VxVM) like this:

vmunix: Boot device’s HP-UX HW path is: 0/1/1/0.0×1.0x0

However, syslog.log is a catch-all for a lot of items and often needs to be truncated when it grows too large. As a result, it can’t be relied on to always contain the current boot disk.