Friday, March 24, 2017

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.

1. 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.

2. 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

3. 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.

4. 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.

5. HP-UX display dump devices:

hpx:/> lvlnboot -v

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

Wednesday, March 22, 2017

Solaris Processes Monitoring - prstat

In this post, I will explain you which commands is used for display the Solaris zone process information.

Using "prstat" command we can display the solaris zone process information. This command generate the reports information about the processes and zones.

The prstat statistics utility shows a summary of the processes that are using system resources currently. The prstat utility summarizes this information for an every 5 seconds by default and reports the statistics for that period.

Display the zones process informtion:

[sun]# prstat -Z

 PID USERNAME  SIZE   RSS STATE   PRI NICE      TIME  CPU PROCESS/NLWP
 18638 20159    2118M 1502M cpu43    10    0   0:00:44 2.4% oracle/7
 20927 24076    8784K 8136K cpu127    0    2   0:00:17 1.8% prstat/1
   897 24865     916M  512M sleep    59    0  27:52:32 0.7% java/95
 17511 26055     599M  285M sleep    59    0  35:08:33 0.6% java/115
 12540 26055     951M  341M sleep    59    0  31:00:01 0.5% java/101

 ZONEID    NPROC  SWAP   RSS MEMORY      TIME  CPU ZONE
     8     3427   73G   27G    21%  44:01:48 2.8% sunz01
     0      100  465M  132M   0.1% 507:26:46 2.6% global
     6     4056   86G   32G    25%  35:23:30 2.3% sunz02    
Total: 13382 processes, 36594 lwps, load averages: 9.11, 9.27, 9.47

Using above command "prstat -Z" we can monitor the server process utilization in every 5 second. This command is show you the global zone & their local zone process utilization only.

If you want to only specific zone process utilization then you can use the below command.

[sun]# prstat -z sun01

This command output show you only process utilization of specific zone only.

Note:

-Z Reports information about processes and zones.
-z Reports information about a particular zone.

You can use the below syntax to monitor the Global zone as well as only specific zone.

Sun Solaris zonecfg commands

In the last post, I had explained the usage of zoneadm command for Solaris servers, now in this post we will get the information about the "zonecfg" command. 

This is very useful command which is mostly used during configuration of new zone or installed zone as well as for removal of any zone configuration files.

1. Command for creating a Solaris zone:

Please find the below commands to creating a zone on Sun Solaris server. The command must be run on Global zone with root user.

[sun]#zonecfg -z <zone>

Example: [sun]#zonecfg -z sunz01

Once you run the above command, you can enter in the configuration file, where you can add or edit the configuration for the zone.

2. Command for deleting a Solaris zone:

Please find the below command to deleting a Solaris zone from Global zone.

[sun]#zonecfg -z <zone> delete -F

Example: [sun]#zonecfg -z sunz01 delete -F

using above command you can delete or remove the configuration file of solaris local zone.

Note: You need to shutdown and uninstall the local zone before deleting the configuration files of Sun Solaris local zone.

3. Command for display zone current configuration:

Please find the below command to display the current configuration of local Solaris zones.

[sun]#zonecfg -z <zone> info

Example: [sun]#zonecfg -z sunz01 info

This command output show you the zonename, zonepath, autoboot etc attributes information of the solaris zone.

4. Command for zone creation file:

Please find the below command to create a solaris zone creation file.

[sun]#zonecfg -z <zone> export

Example: [sun]#zonecfg -z sunz0 export

Once the creation file has been export you can use this file to another zone creation as well as for restoration of this local zone if any problem occur on this zone.

How to use zoneadm command in Solaris Servers

When you are working on the Solaris operating system then you must aware about this command "zoneadm" which is basic command in Solaris operating system. In this post I would like to explain you how to use the zoneadm command in Solaris servers.

"zoneadm" command are used for verification, installation, boot or viewing of the local zones which are created on the Solaris Server. Please find the below syntax with an example.

1. Verify a Solaris zone:

To verify the local solaris zone you need to run the below command with syntax.

[sun]#zoneadm -z <zone> verify

Example: [sun]#zoneadm -z sunz01 verify

In this example once you run the above command, if your zone is installed properly without any error then this is not showing you any output, that's means it is verified. After running the command if it is showing a message then you need to check the configuration of this zone.

2. Installing a Solaris zone:

To install the local Solaris zone you need to run the below command with syntax.

[sun]#zoneadm -z <zone> install

Example: [sun]#zoneadm -z sunz01 install

In this example when you run the above command then your local zone has been started for installation. It is installed the local zone using the Solaris repostiory or flar images which you are kept at server location.

3. Ready a Solaris zone:

To move the local zone in ready or maintainance state you need to run the below command.

[sun]#zoneadm -z <zone> ready

Example: [sun]#zoneadm -z sunz01 ready

In this example, when we run the above command then your local zone moved in to ready or maintianance state.

4. Boot a Solaris zone:

To boot the solaris zone on global system, you need to run the below command with syantx.

[sun]#zoneadm -z <zone> boot

Example: [sun]#zoneadm -z sunz01 boot

After running the above command your local solaris zone has been boot successfully if it is not showing any error during boot time. If you see any message during the boot time then please check where is the issue.

5. Reboot a Solaris zone:

To reboot or restart the solaris zone on Solaris server, you need to perform the below command on global zone.

[sun]#zoneadm -z <zone> reboot

Example: [sun]#zoneadm -z sunz01 reboot

Using this command the local zone "sunz01" has been restart again successfully. You need to run this command from global zone only.

6. Shutdown/Halt a Solaris zone:

If you want to shutdown or halt your local zone without login it, then you need to run the below command from global zone.

[sun]#zoneadm -z <zone> halt

Example: [sun]#zoneadm -z sunz01 halt

After running this command local solaris zone state change from running to installed state that's means your server is shutdown now.

7. Uninstall a Solaris zone:

If you want to uninstall any solaris zone then you need to run the below command for uninstall the zone.

[sun]#zoneadm -z <zone> uninstall -F

Example: [sun]#zoneadm -z sunz01 uninstall -F

"-F" syntax is used to uninstall the zone forcefully. 

8. Viewing a Solaris zone:

if you want to local zone current status and any other display information you need to run the below command. 

[sun]#zoneadm list -icv

 ID NAME       STATUS      PATH               BRAND   IP
   0 global         running        /                        solaris      shared
   1 sunz01        running       /zones/sunz01   solaris      excl
   2 sunz02        running       /zones/sunz02   solaris      excl

Using above command you can check the current status of all installed zones on Solaris server. It is show you the zone path and zone information. All the above command you need to run from Global zone with root privileges.

Monday, March 20, 2017

10 Practical Examples of RPM Commands in Linux

In this post, I will explain you the usage of RPM (Red Hat Package Manager) command with an example. RPM commands are widely used in Linux operating system to install, remove or update the packages on operating system.

RPM (Red Hat Package Manager) is a default open source and package management utlity which is widely used on Redhat, CentOS linux operating system. You can install , remove, upgrade the packages using this commnad. In this post We will explain each syntax with an example so you can understand how this command is very useful on linux operating system. So here, we will explain best 20 example which is related to Red Hat Package Manager.

1. How to Check an RPM Signature Package:

This command with syntax is used for to check the PGP signature of packages before installing them on your Linux systems and make sure its integrity and origin is fine.

[root@locahost]# rpm --checksig vsftpd-2.2.2-14.el6.x86_64.rpm
vsftpd-2.2.2-14.el6.x86_64.rpm: rsa sha1 (md5) pgp md5 OK

2. How to Install an RPM Package:

Using below syntax you can install the rpm packages on the linux system.

[root@localhost]# rpm -ivh vsftpd-2.2.2-14.el6.x86_64.rpm
Preparing...               ########################################### [100%]
1:vsftpd                    ########################################### [100%]

On the above syantx we are using "-i" option to install the rpm packages on Linux operating system.

3. How to check dependencies of RPM Package before Installing:

If you want to check which packages or dependency is required for RPM packages then you can run the below command to check the dependency.

[root@localhost]# rpm -qpR samba-winbind-3.6.23-12.el6.x86_64.rpm

Here, you can find the syantx meaning of the above command.
-q : Query a package.
-p : List capabilities this package provides.
-R: List capabilities on which this package depends.

4. How to Install a RPM Package Without Dependencies:

If you want to install the packages without any dependency please use the below syntax.

[root@localhost]# rpm -ivh --nodeps samba-winbind-3.6.23-12.el6.x86_64.rpm
Preparing...                       ########################################### [100%]
1:Samba-winbind             ########################################### [100%]

The above command forcefully install rpm package by ignoring dependencies errors, but if those dependency files are missing, then the program will not work at all, until you install them.

5. How to check an Installed RPM Package:

If you want to check which RPM package is installed on the operating system then please use -q option with package name.

[root@localhost]# rpm -q samba
package samba is not installed

If you see the samba packages is not installed on my system so it is show you this message.

[root@localhost]# rpm -q vsftpd
vsftpd-2.2.2-14.el6.x86_64

You can see the above ftp server packages is installed on the system.

6. How to Upgrade a RPM Package:

If you want to upgrade any RPM packages then please use "-U" syntax with rpm name.

[root@localhost]# rpm -Uvh vsftpd-3.0.2-11.el6.x86_64.rpm
Preparing...             ########################################### [100%]
1:vsftpd                 ########################################### [100%]

If you see the above example the packages is upgrade with the new version of vsftpd.

7. How to Remove a RPM Package:

If you want to uninstall or remove the package from the server then please use "-e" erase option is used to remove package.

[root@localhost]# rpm -evv vsftpd

Using above command we can remove the packages with all dependency.

8. How to Remove an RPM Package Without Dependencies:

If you want to remove installed packages without any dependecy then use the below syntax to remove the rpm.

[root@localhost]# rpm -ev --nodeps vsftpd

Using above syntax "--nodeps" we can remove the packages without dependency.

9. How to Import an RPM GPG key:

If you want to import the RPM GPG key then please verify RHEL/CentOS/Fedora packages, you must import the GPG key.

[root@localhost]# rpm --import /etc/pki/rpm-gpg/RPM-GPG-KEY-CentOS-6

So using above syantx we can import the GPG key on the server.

10. How to List all Imported RPM GPG keys:

To print all the imported GPG keys in your system, use the following command.

[root@localhost]# rpm -qa gpg-pubkey*
gpg-pubkey-0608b895-4bd22942
gpg-pubkey-7fac5991-4615767f

You can see the above entry these are the GPG key which is installed on the server.

Thursday, March 16, 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:

1. 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".

# 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.

2. 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.

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

hpx29:/> 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.

4. 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.

Tuesday, March 14, 2017

How to configure NTP Server on AIX Operating system

In the last post, I had explained the NTP (Network Time Protocol) on Solaris 10 & 11 server. Now in this post, I will explain the same NTP server and client configuration for AIX operating system.

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.

Step by Step Configuration of NTP:

1. 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.

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.

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

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.

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

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

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

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:

1. 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.

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.

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

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.

AIX:/>startsrc -s xntpd

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

AIX:/>vi /etc/rc.tcpip

Unconmment the following line

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

4. 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.

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.

How to disable the SELinux in Linux machine

In this post, I will explain you the how to disable SELINUX on Redhat or CentOS Operating system. Before going to main work first we need to understand what is SELINUX and how its work on Linux enviorement.

Security-enhanced Linux (SELINUX): SELinux is know as Security enhanced linux system which is the security feature of the Linux kernel system. It is define the security Policy which makes system proctative agaginst the misconfiguration of the daemons. SELinux running in 3 modes which is disabled, enabled and permissive. We will explain these mode in configuration steps.

How to disable SELinux on Linux system:

1. In the first step you can check the current status of SELinux. To do this please run the below command.

[redhat]# getenforce
Enabled

"getenforce" command is used for checking the current status of SELinux.

2. As you see on my machine when I run the above command my SElinux is enabled, So in this step we will change the SELinux mode.

[redhat]# vi /etc/sysconfig/selinux

# This file controls the state of SELinux on the system.
# SELINUX= can take one of these three values:
#     enforcing - SELinux security policy is enforced.
#     permissive - SELinux prints warnings instead of enforcing.
#     disabled - No SELinux policy is loaded.
SELINUX=disabled
# SELINUXTYPE= can take one of these two values:
#     targeted - Targeted processes are protected,
#     mls - Multi Level Security protection.
SELINUXTYPE=targeted

Normally selinux configuration file you can found on the above location. You can edit the SELINUX entry to disabled. All the command is run by super user "root" only.

3. Once you change the entry in SELinux configuration file then for permanent effect you need to take a reboot of the system.

[redhat]#init 6

Once you reboot the server all the configuration files changes has been done.

4. In the last step you will run the "getenforce" command again to verify the new status of SELinux.
[redhat]# getenforce
Disabled

If you comparison the both step 1 and this step output you can found that SELinux policy is not disabled on the Linux operating system.

Friday, March 10, 2017

How to mount CIFS file system on Linux Server

Hope you are doing well at your end. In this post, I will explain how we mount the CIFS file system on Linux operating system.

Normally on linux machine if we mount the any other linux machine folder is quite easiy in comparision to mount the window shared folder on linux machine. So let's going to final topic where i will explain step by step method to mount the CFS folder on Linux server.

Step by Step method for Mount CIFS on Linux Server:

1. In the initial step we will gather all rpm's or packages information which is required for CIFS file system.

redhat# rpm -qa | grep cifs 
cifs-utils-4.8.1-20.el6.x86_64

if you see the above output, this packages is required for CIFS file system on Linux system. So you can install this rpm using rpm command if you have rpm packages on the server otherwise you will install the packages using YUM utility.

redhat#rpm -ivh cifs-utils-4.8.1-20.el6.x86_64.rpm

if you are using YUM, then please install the packages using below command.

redhat#yum install cifs-utils*

it is installed all required dependency related to CIFS file system.

2. In this step, we will create the mount point on the server where we need to mount the CIFS file system.

redhat# mkdir -p /backup/cifs

We will create the above mount directory where i will mount the file system.

3. Now, we will create a CIFS user and assign a password so the user can access mount folder.

redhat# touch /etc/cifspasswd
redhat# chmod 600 /etc/cifspasswd

redhat#vi /etc/cifspasswd

user=castwebsvc
password=*******

4. In this step we need to make a permanent entry of mounted file system so once we reboot the machine mounted file system not umount.

redhat# vi /etc/fstab

ADD fstab entry :

//WindowsServer/share /mount/point cifs rw,mand,user=USER,password=PASS 0 0

Example :
//192.168.0.1/CAST_data4/AICCodeUpload  /backup/cifs cifs   rw,mand,credentials=/etc/cifspasswd         0 0

You can take an example for your system. Please change the mount point as per your requirement.

5. In the final step you need to mount the file system using below command.

redhat# mount /backup/cifs
redhat# mount -a

Using above command the CIFS file system has been mounted successfully.

How to configure NTP server and client on Solaris 10 and Solaris 11

In this post, I will describe the step by step method that how we will configure the NTP server and client on Solaris 10 and Solaris 11 Operating system. Network time protocol is most important part of any UNIX operating system. We will setup the NTP daemon on both the operating system but before moving to main point we will understand first NTP mechanism.

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.

NTP Service on Solaris 10 and Solaris 11:

Solaris 10 used the SMF utility (Service Management Facility) and the NTP service is now managed by SMF (Service Management Facility). NTP daemon configured using Service management facility (svc:/network/ntp:default) and a bunch of sample ntp.conf files to quickly configure a machine as a client or as a server. On Solaris 11 only ships with NTP v. 4, the NTP v. 4 service is identified by the name ntp4. You can check the ntp status using below command.

sun# svcs status ntp

STATE  STIME   FMRI
online 10:14:23 svc:/network/ntp:default

If you see the above command output it is shown that network time protocol services is enable and online on the server.

Steps for Configuring a NTP client:

Suppose your machine is just a client machine, then you can just take the /etc/inet/ntp.client file and copy it to /etc/inet/ntp.conf.

multicastclient 127.0.0.1

If you see the configuration it's a passive configuration for a Server host which listens for NTP server putting packets on the NTP multicast network, 127.0.0.1. If your machine is on LAN without NTP server then in that case we are not recveied any packet and for this we need to use Public NTP server for host.

In my case, I'm using the Indian pool in.pool.ntp.org and my configuration file contains:

server 2.in.pool.ntp.org
server 1.asia.pool.ntp.org
server 3.asia.pool.ntp.org

Normally NTP requires a poll period to elapse before starting synchronizing your clock. If you want NTP to start immediately, which you most probably will if you're configuring a desktop environment, you can take advantage of iburst keyword, introduced in NTP v. 4: it instructs NTP to start the synchronization almost right away.

server 2.in.pool.ntp.org ibrust
server 1.asia.pool.ntp.org ibrust
server 3.asia.pool.ntp.org ibrust

You must make sure you're configuring NTP implementation corresponding to the syntax you're using.

Setting up the drift file:

The last thing which is remaining for NTP server setup in the client machine is to set up  drift file location. On my machine it is 

driftfile /var/ntp/ntp.drift

After setup the drift file configuration we will start the NTP servivce again 

sun# svcadm restart svc:/network/ntp:default
sun# svcs status svc:/network/ntp:default
STATE  STIME   FMRI
online 12:20:12 svc:/network/ntp:default 

Once the service is running, you can check which server you're using with ntpq, Please run the below command to check the ntpq.

sun# ntpq -p

Setting up an NTP server:

Now in above step you see the NTP service has been started successfully, so now, you'll probably want to setup all of your machines.

If you're in a LAN, you can setup an internal NTP server which will provide data to other clients on your LAN. As before, you can take inspiration from the server configuration file shipped with Solaris 10 or Solaris 11, /etc/inet/ntp.server.

After setting up the drift file and the clients you're going to use, you can examine the other options and fine-tune them at your taste. Let's give a quick look at it.

server 127.127.XType.0

Now you have configured the NTP server properly. Please comment on the post if you have any suggestion.

Thursday, March 9, 2017

Solaris Package administration in Solaris 10

In this post, we will get the knowledage about the package administartion on Solaris operating system. As you aware that on solaris server the packages administration work is quite different from other Unix operating system. Solaris system has different architecture for this one.

So, we will discuss first which command is generally used on Solaris 10 server which are listed below.

pkginfo- It displays all software package information.
pkgadd- It installs all software packages to the system.
pkgrm- It removes a package from the system.
pkgchk- It checks package installation state.
pkgtrans- It translates packages from one server format to another.

Commands & Syntax for checking a package information:

For checking a packages information on Solaris 10 operating system we will used the "pkginfo" command. You can find the all command and syntax related to "pkginfo" is listed below.

  • Please use the below command to display information about installed software packages.

          sun# pkginfo | more

  • Please use the below command to view additional information.

          sun# pkginfo -l | more

  • Please use the below command to view information of a specific package.

          sun# pkginfo -l SUNWman

  • Please use the below command to find how many packages are currently installed.

          sun# pkginfo | wc -l

  • To list all installed software packages, please use the below command.

          sun# more /var/sadm/install/contents

These above commands with their syntax are daily used on Solaris 10 platform.

Commands & Syntax for checking a package installation:

For checking an information about packages are installed or not on the server , we need to use "pkgchk"  command. Please find the below example as describe below.

  • Please use the below command to check the contents & attributes of a currently installed package.

          sun# pkgchk SUNWpkgs

  • Please use the below command to list the all files contained in a software package.

          sun# pkgchk -v SUNWpkgs

  • Please use the below commands to find if the contents & attributes of a file have changed since it was installed with its software package.

          sun# pkgchk -p /etc/shadow  

  • Please use the below commands to list information about selected files that make up a package.

          sun# pkgchk -l -p /usr/bin/showrev

If the packages is installed already then in that case "pkgchk" command don't show any output that clear meaning is that packages is already installed on the server.

Commands & Syntax for adding a package software:

For adding a packages on the server, we will used the "pkgadd" command. Please find the below commands and their syntax which is daily used on Solaris operating system.

  • Please use the below command to add a software packages from DVD. For this you need to move on dvd directory where all the packages are listed.
          sun# pkgadd -d . SUNWpkgs

Using above command you can add the packages from DVD.

Commands & Syntax for removing a package software:

For removing the packages from the server, we will used "pkgrm" command. Please find the below commands and their syntax as listed below.

  • Please use the below command to remove the software packages.

          sun# pkgrm SUNWpkgs

  • Please use the below command to remove a package from the spool directory.

          sun# pkgrm -s /export/pkg SUNWldam

Commands & Syntax for translating a packages format:

For translating a packages format from one format to another , we will used the "pkgtrans" command for the same.

  • Please use the below command to translate a package from file system format in /var/tmp to data stream format.

          sun# pkgtrans /var/tmp /tmp/SUNWpkgs.pkg SUNWpkgs

  • Please use the below command to create a data streamed package.

          sun# pkgtrans -s Product /var/tmp/stream.pkg SUNWpkgg SUNWpkgs

 Using above commands and synatx we can easily translate their file format to stream format. If you have any doubt regarding this post please comment on the post.

How to enable SAR (System Activity Reporter) on Solaris Server

In this post, You can find the information one of the most important monitoring tool application on Solaris operating system. SAR (System Activity Reporter) is used to troubleshoot the performance issue on Sun Solaris Servers.

Using SAR (System Activity Reporter) we can troubleshoot or monitored the disk, memory or cpu performance issues on the Solaris operating system servers.

It is widely used performance tools for monitoring purpose but this utility also have some disadvantages. SAR utility consume lot of disk space when it is generated the report as well as /var file system space get increase rapidly.

Now in the below post we will step by step method to enable the SAR on Solaris Operating system.

Step by step procedure to enable SAR (System Activity Reporter):

1. In the first step we will check the current service status of SAR. To check this thing we will used below command which is mention below.

sun#svcs status sar
disabled        Mar_9  svc:/system/sar:default
or
sun#svcs -a | grep -i sar
disabled        Mar_9  svc:/system/sar:default

If you see the current status of SAR service it is disable. You can use both the above syntax to find out the current service status.

2.  As you seen in above step, the SAR service is disable on the Sun Solaris system so in this step we will enable it.

sun#svcadm enable svc:/system/sar:default

Check the status of service again as per below command.

sun# svcs status svc:/system/sar:default
enabled        Mar_9  svc:/system/sar:default

3.  Now in this step, we will make a setup for automatic data collection. Normally once we enable the services of SAR, the default script for SAR utility are located the below directory location.

/usr/lib/sa/sa1: This is a shell script to collect and store data in the binary file /var/adm/sa/sadd, where dd is the current day.

/usr/lib/sa/sa2: This is a  shell script for generating daily report in the file /var/adm/sa/sardd, where dd is current day.

As these above script are used normally to collect the automatically data from Solaris Server. If you required the daily report or weekly report then you need to add both the script in crontab file which is describe in next step.

4.  If you required the SAR report regularly then you need to make an entry of above script on the crontab file.

#crontab -e

Using these command you can edit the existing file and make an entry of above script according to your requirement when you want to generate the report.

Please comment on the post, if you have any issue related to this SAR post.

Wednesday, March 8, 2017

How to run Oracle Explorer on Sun Solaris 11

In this post I will explain how to run Oracle Explorer file on Solaris 11 operating system. Explorer files are used as a snapshot when we need to check all hardware issues or internal issue. The explorer files keeps all these information.

Oracle SUN Solaris explorer is a collection of scripts and binary executable files which collect all information and creates a detailed snapshot of Oracle Sun Solaris system configurations.

Oracle Sun Solaris Explorer is always installed on Global zone using root user which are running only Sun Sparc system and Solaris X86 systems as well as we are gathers information related to drivers, patches, recent system event history, and log file entries from the Oracle Explorer Data Collector output.

Before moving to run the explorer files we need to understand which packages is required to installed and configure the explorer files.

1. First we need to download the Service tools bundle from any ftp servers and extract them and run the script with extension syntax.

# ./install_stb.sh -ext

2. In this step we will uncompressed and untar the Explorer tar file using below command.

# cd /var/tmp/stb/extract/Explorer
# uncompress Explorer.tar.Z
# tar xvf Explorer.tar

3. In this step we will install Explorer packages and create directories "SUNWexplo" and "SUNWexplu" to install the required packages.

# pkgadd -d . SUNWexplo SUNWexpl

4. Now we will run the explorer command to obtained the logs files from the Sun Solaris system.

  #explorer
  
Normally on Solaris server the default location to run the above command is /usr/sbin/explorer which create & send the explorer log file.

If you want the create default configuration file only first time please use the below syntax.

  # explorer -g 

If you want to check explorer version please run the below command.

  # explorer -V
        
Normally in most of the Solaris server the default path of the explorer output is /var/explorer/output but it depends where you installed the Explorer.

Monday, March 6, 2017

How to configure YUM Server in Red hat linux 6

In this post, We will get know how to install or configure the Yum server on Red Hat Linux 6 operating system.

As you know their are several ways using which we can install the packages or rpm on the server. Please find the below step by step method to install the packages using YUM.

1. In the initial step please install the cd in cdrom and open a terminal for mount the cd in /mnt directory.

#mount –o loop /dev/cdrom /mnt

Here, we mount the CD of ISO in /mnt direcoty. You must enough space on /mnt folder before mounting this ISO.

2. Now in second step we will create a directory where we make a YUM repository.

#mkdir /rhel6

In this directory we will install all the YUM configuration files.

3. Now we will copy all the files from mount folder to newly created folder.

#cp –rvf /mn/* /rhel6

4. In this step, we will install the required packages which is required for create a repo on the server.

#cd /rhel6/Packages 
#rpm –ivh python*
#rpm –ivh createrepo*

These above packages is required for repostiory creation in YUM server.

5. Now move back again repodata directory and create a new repo for repository installation.

#createrepo  –v /rhel6/Packages

This is install all the packages on /rhel6 directory which is used for YUM configuration.

6. In this step we will create a new repo files in this directory.

#cd /etc/yum.repos.d/
#rm –rf *
#vi ss.repo

[Packages]
baseurl=file:///rhel6/Packages 
gpgcheck=0
enable=1

In this step if any exsiting repo if you found please remove it and create a new repo.

7. In the final step we will clean the repo and check the list of all rpm's using below commands.

#yum clean all
#yum list

Hope, using this post, you can easily install and configured the packages on the Red Hat Operating system. Please comment on the post if you encouter any issue.

Friday, March 3, 2017

NFS mount on Solaris 11 Non-Global zones

In this post, we would learn how we mount one folder from one Non-Global zone to another zone on Solaris 11 operating system.

As you know, in linux server it is less difficult in comparision to Solaris server. Here, I will take a two local zone "sun01" & "sun02". Let's take an example, we will mount one folder named "/export/backup" from "sun01" local zone to another zone "sun02" on "/project/export/data" location.

Step by Step method of NFS mount on Solaris 11:

1. In the first step we will create the directory on "sun02" zone where we want to mount the folder. 

sun02#mkdir /project/export/data

2. In second step, we will make a configuration for this process. So for this work you need to login on global zone with root access and make an entry on the dfstb configuration file.

sun#vi /etc/dfs/dfstab

share -F nfs -o rw=sun02 /zones/sun01/root/export

If you see the above entry, we have provided the read/write access to directory on sun02 server where we mount the folder from sun01 local zone.

3. In next step you need to login on sun02 server and mount the shared folder using below command.

sun02#mount sun:/zones/sun01/root/export/backup /project/export/data

4. Once you run the above command the folder is mount from one local zone to another zone temprarily. You can go to the directory and verify that the data which is listed on /export/backup folder is show on sun02 directory.

5. In the last step you need to restart the NFS service on the global zone so the configuration files and other changes makes affect. But these configuration are available until we are not taking reboot of the zone.

Please comment on the post, if you have any issue regarding the NFS mount sharing process. I will try to resolve such issue as soon as possible.

Thursday, March 2, 2017

System dump for HP-UX v11.x

In this post, I will cover one of the most entertaining and important topic  how we take system dump for HP-UX v11.x version operating system.

let's starting with V11.00, the following things have changed with respect to system dumps.

1. A dump does not necessarily contain all the memory pages.

2. Save core was replaced by 2 different commands:
  • Save crash for boot time dump image management.
  • Crashutil for port boot dump analysis.
3. Dump area can now be configured both in the kernel, or in the /etc/fstab file. Also, those dump areas don't need to be in the vg00 volume group.

Now we understand what is the role of Dump size.

Dump size:

Default dump size is quite small (not the full memory), but it should be ok for most usage. It can be modified if required using the crashconf utility.

Note: In crashconf , all sizes are in physical pages (4Kb on PA-RISC).

Now we will go for configuration part which is describe below.

Configuration:

Dump area/logical volumes must be created contiguous and with bad blocks relocation disabled. Use the following lvcreate options if creating manually (or use SAM ).

hpx:/># lvcreate -r n -C y ...

Configuring in the kernel:-

lvlnboot can be used to configure dump areas in the vg00 volume group, as long as you have a dump lvol line in the /stand/system file.

Run time configuration:-

Add lines in /etc/fstab with the following format:

device  /  dump  defaults 0 0

Using swap space as dump area:

Swap spaces can still be used as dump areas. In that case, both usage should be explicitly declared:

  • use lvlnboot twice ( - +-s +- and - +-v +- options) 
  • or put 2 lines in /etc/fstab (one for swap and one for dump type
When the system disk is mirrored, the swap LV is actually mirrored, whereas the same device used for dumping will only write to one disk.


Dump areas usage order:-

Dump areas are used in reverse order of their declaration, so it's important to declare last the dump areas not used for swap if you have some (this speeds up reboot, since swap can be activated before saving the dump image). 

Also, if your run time configuration does not include any dump area in the vg00 volume group, the kernel will first automatically use the primary swap space as dump device. This might slow down the reboot since the dump must be completely saved before reactivating this primary swap. To avoid that
  • declare non-swap dump partitions in /etc/fstab 
  • add a dump none line in /stand/system to explicitly use run-time configuration only 
Please comment on the post if you have any query regarding the system dump on HP-UX operating system.