Saturday 24 June 2017

Sun Solaris zonecfg commands with an example

"zonecfg" command 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.

This command are valid for Sun Solaris 10.x,11.x,12.x version.

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

!-[solaris]# zonecfg -z <zone>

Example: !-[solaris]# 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.

Command for deleting a Solaris zone:

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

!-[solaris]# zonecfg -z <zone> delete -F

Example: !-[solaris]# 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.

Command for display zone current configuration:

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

!-[solaris]# zonecfg -z <zone> info

Example: !-[solaris]#zonecfg -z sunz01 info

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

Command for zone creation file:

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

!-[solaris]#zonecfg -z <zone> export

Example: !-[solaris]#zonecfg -z sun01 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.

Sunday 18 June 2017

Sun Solaris Processes Monitoring - prstat command

"PRSTAT" command basically used for monitoring the current memory and CPU utilization of Sun solaris local zones and global zone.

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 information:

!-[solaris]# 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.

!-[solaris]# 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.

How to run Oracle Explorer on Sun 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.

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

!-[solaris]# ./install_stb.sh -ext

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

!-[solaris]# cd /var/tmp/stb/extract/Explorer
!-[solaris]# uncompress Explorer.tar.Z
!-[solaris]# tar xvf Explorer.tar

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

!-[solaris]# pkgadd -d . SUNWexplo SUNWexpl

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

!-[solaris]# 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.

 !-[solaris]# explorer -g 

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

 !-[solaris]# 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.

Please comment on the post, if you have any query related to this topic.

Monday 29 May 2017

Important Linux TCP/IP Port Number

Please find the below complete list of TCP/IP port number in Linux system.

➤ 20- FTP ( File Transfer Protocol) -It is used for transfer the data using ftp connection

➤ 21- FTP Control - It is used this port for ftp connection.

➤ 22- SSH (Secure Shell)- It is used for connecting the secure shell which using SSL encryption.

➤ 23- TELNET - It is used for insecure remote connection.

➤ 25- SMTP (Simple Mail Transfer Protocol)- It is used as a mail transfer agent for email server.

➤ 53- DNS (Domain name system)- It is used for translate the domain name to IP address.

➤ 67- BOOTP (Bootstrap Protocol)- Used for automatically assign the IP address to network device.

➤ 68- DHCP (Dynamic host configuration protocol)- It is a network protocol to enable a server to automatically assign an IP address to system.

➤ 69- TFTP (Trivial file transfer protocol)- Used this protocol in PXE Boot services.

➤ 80- HTTP ( Hypertext Transfer protocol)- Used for WWW web connection.

➤ 88- Kerberos Protocol

➤ 110- POP3 (Post Office Protocol)- Used as a mail delivery agent.

➤ 113- XINETD (Extended Internet Daemon)

➤ 115- SFTP ( Secure File Transfer Protocol)

➤ 123- NTP (Network time protocol)- Used for time syncing uses UDP protocol

➤ 137- NetBIOS (Network basic Input/Output system)

➤ 139- NETBIOS-SESSION Service

➤ 143- IMAP (Internet Message Access Protocol)

➤ 161- SNMP (Simple Network Management Protocol)- Used for network monitoring.

➤ 389- LDAP (Lightweight Directory Access Protocol)

➤ 443- HTTPS ( Hypertext Transfer protocol secure)- Used with SSL encryption.

➤ 445- SMB (Server Message Block or SAMBA)

➤ 514- Syslogd (udp port)

➤ 840- NIS (Network Information Service)

➤ 873- rsync Used for file synchronization.

➤ 990- FTPS (File transfer protocol secure)

➤ 993- IMAPS ( For Secure Connection)

➤ 995- POP3s ( Mail delivery agent with secure connection)

➤ 2049- NFS ( Network file sharing)

How to shrink or reduce MySQL ibdata size in Red Hat Linux server

MySQL database is widely use database server, but sometimes you are facing an ibdata size issue on the database server.

Normally this ibdata size error occur while you are trying to start the MySQL database services. So to resolve such type of error this post is very useful. Here, I would explain to you how to shrink MySQL ibdata size in Red Hat Linux operating system.

➦ Before doing anything in database I would suggest to you take a backup of existing database so in case of any issue, we will restore the previous backup.

Please find the below command using which you need to take a backup of MySQL database. You must remember you need to take full backup which consist triggers, routines and all tables.

[root@localhost]# mysqldump --lock-all-tables --triggers --routines -u user_name -p -h server_name database_name > /home/backup.sql

Using above command you can take a complete MySQL backup on your linux machine.

➦ Now you need to drop all database on the server except default MySQL schema.

➦ Once you drop all existing database, stop the MySQL service and make it disable permanent. Please find the below command to stop the MySQL services on server.


[root@localhost]# /etc/init.d/mysql stop
[root@localhost]# chkconfig mysql off

For RHEL7 you need to use "systemctl" command to stop the MySQL running service. The above example command are valid in lower version on RHEL7.

➦ You need to change the configuration setting in MySQL configuration file, which is generally located in /etc directory.

[root@localhost]# vi /etc/my.cnf

[mysqld]
Innodb_file_per_table
Innodb_flush_method=0_DIRECT
Innodb_log_file_size=1G
Note: Whatever you’re set for innodb_buffer_pool_size, make sure innodb_log_file_size is 25% of innodb_buffer_pool_size.

➦ Please delete the ibdata1, ib_logfile0 and ib_logfile1 from the MySQL library location. At this point, there should only be the MySQL schema in /var/lib/mysql

Now take a restart of MySQL service again and recreated the ibdata1 and ib_logfile0 again and restore the MySQL backup again.

Sunday 28 May 2017

How to find MP console IP address from the running HP-UX Operating system

This post is useful to identify the MP console IP address from the running HP-UX OS, if you forgotten the existing IP address.

For Itanium systems running 11.31 version only we can use smh and the cprop command. These both method works to recover the forgotten password.

cprop is what the smh webpage uses to retrieve the IP address. Run the smh webpage (hostname:hp_ux)

Home -> System -> Management Processor

It is show you the IP address of console port. Also please find the below "cprop" command usage, how to we run this command.

hp_ux:/>/opt/propplus/bin/cprop -summary -c “Management Processor”

[Component]: Management Processor
[Table]: Management Processor
——————————————————-
****************************************************
                   [Hash ID]: Management Processor:11a64d1ax41eed6da
                    [Status]: OK
                 [IPAddress]: 192.168.1.23
                       [URL]: https://192.168.1.23
                     [State]: Enabled
****************************************************

For PARISC boxes and Itanium models running 11.23 or earlier, you must use the serial port on the back of the box. The commands will be:

ctrl-a (to get the attention of the console interface)
<login> typically Admin and Admin
CM (to get to the command menu)
LC 
MA (to exit the CM menu)
X  (to exit the GSP or MP menu)

You can connect the MP console using serial cable, in every HP-UX server are consist this port. Connect the serial cable from one end of server MP port and other side connect to laptop. When you login on the MP console you will get the above option on the server.

How to add a new disk on Logical Volume Manager (LVM) in AIX Operating System

AIX logical volume manager (LVM) is a widely used tool for logical volume management which includes allocating disks and resizing logical volumes.

Using logical volume manager, a hard disk or set of hard disk is allocated to one or more physical volumes. Logical volume manage (LVM) allows users to create partitions from more than one disk and allows them to extend the filesystem size online within few seconds.

In below text, you can find how to add a new drive in AIX operating system using LVM.

Step by step method to add a new disk on LVM:

➤ Initially we need to add the new physical or virtual disk to the logical partition. After successfully adding virtual disk you need to re scan your server hardware so we can get the new disk information.

For scanning please run the below command on AIX server terminal.

ibm_aix:/> cfgmgr

The command output show you the available new disk which are connected to this AIX machine.

➤ Let’s assume that the new disk is hdisk01,please run the below command to check the disk.

ibm_aix:/> lsdev -Cc disk
hdisk00  Available  Virtual SCSI Disk Drive
hdisk01  Available  Virtual SCSI Disk Drive

In above output two disk is available hdisk00 & hdisk01.

➤ You need to create a new group and move the new disk hdisk01 in there. Let's assume the new group named is "rootvg". So please find the below command to create a new group and add the disk in it.

ibm_aix:/> mkvg -y rootvg hdisk01

in this step we add "hdisk01" into "rootvg".

➤ "lspv" command is used for getting an information about the new disk "hdisk01". Please find the "lspv" command output as given below.

ibm_aix:/> lspv hdisk01
PHYSICAL VOLUME:    hdisk01                   VOLUME GROUP:     rootvg
PV IDENTIFIER:      00f68f03d1e42951 VG IDENTIFIER     00f68f0300004c0000000153d1e429c1
PV STATE:           active
STALE PARTITIONS:   0                        ALLOCATABLE:      yes
PP SIZE:            128 megabyte(s)          LOGICAL VOLUMES:  17
TOTAL PPs:          799 (102272 megabytes)   VG DESCRIPTORS:   2
FREE PPs:           118 (15104 megabytes)    HOT SPARE:        no
USED PPs:           681 (87168 megabytes)    MAX REQUEST:      256 kilobytes
FREE DISTRIBUTION:  11..00..00..00..107
USED DISTRIBUTION:  149..160..159..160..53
MIRROR POOL:        None

If you look the above output you can see the all information regarding the new disk in details.

➤ In this step, you need to create a log logical volume for jfs2 file system and this needs to be part of volume group "rootvg".

ibm_aix:/> mklv -t jfs2log rootvg 1

➤ Please check the new logical volume (lv) and  used the "lsvg" command to check the new logical volume present on the AIX server.

ibm_aix:/> lsvg
rootvg

The command shown you he existing logical group on the server.

ibm_aix:/> lsvg -l rootvg
rootvg:
LV NAME             TYPE       LPs     PPs     PVs  LV STATE      MOUNT POINT
hd5                 boot       1       1       1    closed/syncd  N/A
hd6                 paging     404     404     1    open/syncd    N/A
loglv00             jfs2log    1       1       1    open/syncd    N/A
hd4                 jfs2       4       4       1    open/syncd    /

In above output, you can see "rootvg" is volume group present and in rootvg, you can find the logical volume "loglv00".Now we create a logical volume and fixed their size , lets assume we will used 20GB size and used the logical volume name lv_aix.

ibm_aix:/> lsvg rootvg
ibm_aix:/> mklv -t jfs2 -y lv_aix rootvg 30G
ibm_aix:/> mkfs -o log=/dev/loglv00 -V jfs2 /dev/lv_aix

➤ After successfully create filesystem, we will mount the filesystem to a particular folder.

ibm_aix:/> mkdir /aix
ibm_aix:/> mount -o log=/dev/loglv00 /dev/lv_aix /aix

So, nwly "/aix" filesystem has been created, for permanent it, please make an entry in "/etc/filesystems file. So when you will take a reboot of machine the filesystem not umount.

Please comment on the post, if you have any query regarding this topic.