Monday, December 31, 2012

How to find the memory by the slots in AIX?

How to find the memory by the slots in AIX?

Using the below commands we can find out the memory slots in AIX.

                     #lscfg -vp |grep -p DIMM

Output:

#lscfg -vp |grep -p DIMM

Memory DIMM:
  Record Name.................VINI
  Flag Field..................XXMS
  Hardware Location Code......U787B.001.DNWG069-P1-C9-C1
  Customer Card ID Number.....312D
  Serial Number...............YH10MS83M07F
  Part Number.................15R7170
  FRU Number.................. 15R7170
  Size........................2048
  Version.....................RS6K
Physical Location: U787B.001.DNWG069-P1-C9-C1

Memory DIMM:
  Record Name.................VINI
  Flag Field..................XXMS
  Hardware Location Code......U787B.001.DNWG069-P1-C9-C3
  Customer Card ID Number.....312D
  Serial Number...............YH10MS7CH07D
  Part Number.................15R7170
  FRU Number.................. 15R7170
  Size........................2048
  Version.....................RS6K
Physical Location: U787B.001.DNWG069-P1-C9-C3

Memory DIMM:
  Record Name.................VINI
  Flag Field..................XXMS
  Hardware Location Code......U787B.001.DNWG069-P1-C9-C6
  Customer Card ID Number.....312D
  Serial Number...............YH10MS7CH1A6
  Part Number.................15R7170
  FRU Number.................. 15R7170
  Size........................2048
  Version.....................RS6K
Physical Location: U787B.001.DNWG069-P1-C9-C6

Memory DIMM:
  Record Name.................VINI
  Flag Field..................XXMS
  Hardware Location Code......U787B.001.DNWG069-P1-C9-C8
  Customer Card ID Number.....312D
  Serial Number...............YH10MS83M097
  Part Number.................15R7170
  FRU Number.................. 15R7170
  Size........................2048
  Version.....................RS6K
Physical Location: U787B.001.DNWG069-P1-C9-C8




Friday, December 28, 2012

How to add IP alias in AIX?


How to add IP alias in AIX?

Using "smitty" we can configure the IP alias in AIX. It is better to use “smitty tcpip” to check and verify configuration and interfaces.

Steps using SMITTY:


smitty tcpip --> Further configuration -->Network interface -->Network interface selection -->Configure alias --> Add an IPV4 Network Alias (Here select the available interface  and press enter and the Next screen, we need to insert an IP address and the relative subnet mask and press enter.

At the end of configuration commands we get the status (“OK” if everything is ok)

Validation: 

Execute the #ifconfig -a command and confirm the newly added IP alias has been present.


Steps using CLI:


To temporarily add the IP alias by ifconfig:

           ( Syntax )         #ifconfig <interface> alias <IP_address> netmask <netmask> up

(For example) : #ifconfig en0 alias 192.168.4.75 netmask 255.255.255.0 up


To remove the temporarily added IP alias by ifconfig:

             (Syntax)          #ifconfig <interface> delete <IP_address>

(For Example) #ifconfig en0 delete 192.168.4.75 


Note: ( ifconfig command change or assign ip just temporary, if you reboot system, the IP alias configuration will be lost )


Please follow the below steps to permanently add the IP alias. 


To permanently add the IP alias:

          (Syntax)  #chdev -l <interface> -a alias4=<IP_address>,<Netmask>

(For example) #chdev -l en0 -a alias4=192.168.4.75,255.255.255.0


To remove the permanently added IP alias:



            (Syntax)  #chdev -l <interface> -a delalias4=<IP_address>,<Netmask>

(For example) #chdev -l en0 -a delalias4=192.168.2.75,255.255.255.0


Validation: 


Execute the #ifconfig command and confirm the newly added IP alias has been present.


Note: /etc/hosts file has to be edited with the correct entries for the IP aliases.







If you happy with above topic, Kindly rate your reactions/comments below

Monday, December 24, 2012

How to scan the new LUN in AIX and RHEL?


How to scan the new lun in AIX and RHEL?

For AIX:


Make sure you are taking the below output before scan for new lun/disk.
#lspv
#lspv|wc -l

Now execute the below commands to scan the new lun/disk.
#cfgmgr

check the new lun/disk added to the box with the help of new outputs of the following compared with the old output.

#lspv
#lspv|wc -l


For RHEL Linux:


Make sure you are taking the following output before scan for new lun. (Knowing the newly added Lun size before we scan would be better)

fdisk -l
cat /proc/scsi/scsi
cat /proc/scsi/scsi|grep -i host|wc -l
multipath -l
tail -50 /var/log/messages

Now execute the below commands to scan the new lun.

syntax:      echo "- - -" > /sys/class/scsi_host/host(n)/scan  

                  #echo "- - - " > /sys/class/scsi_host/host0/scan

(Make sure the space is there between the hyphen in the echo command [echo "- - -" ]  and you should do this for all HBAs.

check the new lun added to the box with the help of new outputs of the following compared with the old output.

fdisk -l
cat /proc/scsi/scsi
cat /proc/scsi/scsi|grep -i host|wc -l
multipath -l
tail -50 /var/log/messages

-----------------------------------------------------------------------------------------------------

Note: (optional)
Please use the following steps if we don't know the hba card details.

ls /sys/class/fc_host
cd /opt/hp/hp_fibreutils
./adapter_info

The output is just like the below.  (Note the link status is "UP", it will help you to execute the echo command and fill up the host(n) field.)

sys/class/scsi_host/0: STATE=LINK UP WWNN=20000000c98566b4 WWPN=10000000c98566b4
/sys/class/scsi_host/1: STATE=LINK DOWN WWNN=20000000c98566b5 WWPN=10000000c98566b5
/sys/class/scsi_host/2: STATE=LINK UP WWNN=20000000c98566bc WWPN=10000000c98566bc
/sys/class/scsi_host/3: STATE=LINK DOWN WWNN=20000000c98566bd WWPN=10000000c98566bd

From the above output host0 and host2 are in UP status. So we scan the system for hdisk0 and hdisk2 like below.

echo "- - - " > /sys/class/scsi_host/host0/scan
echo "- - - " > /sys/class/scsi_host/host2/scan


How to SSH from one server to another without password ?

How to SSH from one server to another without password ?


On source server side: 


First generate public key using rsa

#ssh-keygen -t rsa      

( here it will ask some questions, please give all default options, especially we have to press enter (leave as empty) in the passphrase option)

Copying the .pub files content from source server to target server.
scp ~/.ssh/id_rsa.pub username@destination:~/.ssh/authorized_keys 

                                                         (OR)

Better we can follow the below steps
cp ~/.ssh/id_rsa.pub ~/.ssh/authorize_keys

next copy this authorize_keys file to client /root/.ssh/
scp ~/.ssh/authorize_keys username@destination:~/.ssh/.

Now client doesn't ask any password.

How to find out the TOTAL/USED/AVAILABLE memory in AIX?

How to find out the total/used/available memory in AIX?

Sometime we are in the situation to find out the used memroy and available memory of aix server. Using the below script we can find out the total/free/used memory in aix.


#!/usr/bin/ksh
#memory calculator
um=`svmon -G | head -2|tail -1| awk {'print $3'}`
um=`expr $um / 256`
tm=`lsattr -El sys0 -a realmem | awk {'print $2'}`
tm=`expr $tm / 1000`
fm=`expr $tm - $um`
echo "\n\n-----------------------";
echo "System : (`hostname`)";
echo "-----------------------\n\n";
echo "Memory Information\n\n";
echo "total memory = $tm MB"
echo "free memory = $fm MB"
echo "used memory = $um MB"
echo "\n\n-----------------------\n";


Save the above script in a file and execute it.

#vi mem_calci     ---> paste the above script and save it
#chmod +x mem_calci   ---> provide the execute permission
#./mem_calci     ---> run the script

Sample output:

System : (Hostname)
-----------------------
Memory Information

total memory = 8126 MB
free memory = 6328 MB
used memory = 1798 MB
-----------------------



If you happy with above topic, Kindly rate your reactions/comments below

Wednesday, December 19, 2012

How to deal with SYSTEM DUMP dump in AIX ?


How to deal with system dump in AIX?

To list out the system dump attirbute: #sysdumpdev -l

To list out the last dump record details: #sysdumpdev -L

To know the potential size of the dump AIX would generate: #sysdumpdev -e

To change the primary dump device as sysdumpnull: #sysdumpdev -p /dev/sysdumpnull

To change the secondary dump device as sysdumpnull: #sysdumpdev -s /dev/sysdumpnull

To change the primary device permanently: #sysdumpdev -P -p <device_name>

To change the secondary device permanently: #sysdumpdev -P -s <device_name>

To create the secondary dump device: #mklv -t sysdump -y <dumplv_name> <vg_name> <no of PPs> <hard disk_name>  -----> #mklv -t sysdump -y lg_dumplv rootvg 6 hdisk0


To active the secondary dump device: #sysdumpdev -Ps /dev/lg_dumplv   (To activate the system dump is done by assigning it as the secondary device)

To initiate a dump, (which reboots the system as part of its process): # sysdumpstart -p

To change the copy directory use: #sysdumpdev -D <path_name>

To change "always dump condition use": #sysdumpdev -k for false, sysdumpdev -K for true

To change the type of dump use: #sysdumpdev -t <fw-assisted | traditional>

To need to uncompress the file use the dmpuncompress utility: #dmpuncompress  < filename >   (dmpuncompress vmcore.0.BZ)

To copy the most recent system dump from a system dump device to a directory, use the savecore command. For example, to copy the dump to the directory /var/adm/ras, use the below commands:   #savecore -d /var/adm/ras    (validate using:   ls -l dump_file_copy.BZ)

How to leave a system dump while rebooting the server from hmc?
chsystate -m managedSystemName -r lpar -n lparName -o dumprestart





Monday, December 10, 2012

How to REGISTER the Linux server to Redhat?

How to REGISTER the Linux server to Redhat?

If we want to install any linux package using "yum" we need to register our server with Redhat. 
Using the below command, we can add our Linux server to the Redhat site.

Requirements:

We should have the valid customer account with the Redhat. 

Steps:

#rhnreg_ks --username=<user_name> --password=<your_password>
#rhnreg_ks --username=<user_name> --password=<your_password> --force

Example:
#rhnreg_ks --username=test --password=123456 --force
#rhnreg_ks --username=test --password=123456 --force

In the above example, the username is "test" and the password is "123456"

Validation:

Open the Redhat customer portal, on the subscription menu you can find the options of registered systems, click that and you can see the newly added Linux server on the list.

You can find the detailed information of the registered servers info in the "/etc/sysconfig/rhn/systemid" file on the server.

Rollback:
You can find the "delete system" option on the the Redhat customer portal, Just select and delete it.



Tuesday, December 4, 2012

How to view the directories and sub-directories in aix?

How to view the directories and sub-directories in aix?

Some times we are in the situation to find out the directories and sub-directories of the particular filesystem. The below command get this done easily.

#ls -aeltFR

For example if we want to view all the dir and sub-dir of the /tmp directory. Use the below.

#cd /tmp
#ls -aeltFR

Note: In linux we can use "ls -altFR" command to view the dir and sub-dir information. 

How to find out the number of powersupply information in aix?

How to find out the number of powersupply information in aix?

Using the below commands we can find out the powersupply information in our aix server.

#lscfg -vp | grep "AC PS" | wc -l

Example:
              siva@test:/home/siva> lscfg -vp | grep "AC PS" | wc -l
                 2
              siva@test:/home/siva>

Monday, December 3, 2012

How to configure the DNS in Unix and Linux servers?

How to configure the DNS in Unix and Linux servers?


A) Steps:

First Create the file called /etc/resolv.conf - which includes the primary and secondary DNS server IP address for UNIX system, its your own DNS server.

# touch /etc/resolv.conf
# vi /etc/resolv.conf (Add the following lines to it)
domain test-lob.com 
nameserver ipaddress
nameserver ipaddress
Where, nameserver IP: It is IP of first DNS server and secondary DNS server of test-lob.com.


Search test-lob.com: Default domain name to search.

For example, if you type command nslookup www, it will search it as www.test-lob.com

For AIX Enable the name resolving using DNS as follows:
Edit the file /etc/netsvc.conf so that the “host =” will be pointing to local and dns as in the following
hosts=local,bind

For Solaris and Linux, Enable the name resolving using DNS as follows:
Edit the file /etc/nsswitch.conf so that the “host:” will be pointing to local and dns as in the following
hosts: files dns

B). VALIDATION REQUIREMENTS
Check with nslookup it should be able to resolve the host to IP and IP to host as in the following example
# nslookup
Default Server: change.test-lob.com
Address: 10.14.15.16
> lotus

Server: change.test-lob.com
Address: 10.14.15.16

Name: lotus.test-lob.com
Address: 10.120.12.6

Resolve from IP to host:
nslookup 10.120.12.6

Server: change.test-lob.com
Address: 10.14.15.16


Name: lotus.test-lob.com
Address: 10.120.12.6


C). ROLL BACK
AIX:
Remove the entries you have added in the /etc/netsvc.conf , so that the server will point to local host configuration file ( /etc/hosts ) only.

LINUX & SOLARIS:
Remove the entries you have added in the /etc/nsswitch.conf so that the server will point to local host configuration file ( /etc/hosts ) only.



If you happy with above topic, Kindly rate your reactions/comments below

Friday, November 30, 2012

How to configure the NTP in AIX and LINUX servers?

How to configure the NTP in AIX and LINUX ?

A) STEPS


 For RHEL pls follow the below steps:


1. stop the NTP service
#service ntpd stop

2. Make a copy of the file /etc/ntp.conf
#cp /etc/ntp.conf /etc/ntp.conf_bak

3. Edit the file /etc/ntp.conf with the following entries:
    server <IP_address of the NTP server>
server <IP_address of the NTP server>
        driftfile /var/lib/ntp/drift 

4. Create the /var/lib/ntp directory if it’s not exist and ensure /var/lib/ntp has correct ownership and      permissions
           #mkdir /var/lib/ntp
          ( dwxr-xr-x 2 ntp ntp 4096 Mar  2 11:09  )

5. Create the file /var/lib/ntp/drift with the following entry:
         0.0

6. After creating the drift file, ensure that it has the right ownership and permissions:
        -rw-r--r-- 1 ntp ntp 6 Mar  2 11:09 drift

7.  After restarting the ntpd service, ensure that spurious messages in the /var/log/messages file are no longer reported:
           can't open /etc/ntp.drift.TEMP: Permission denied

8. Bounce NTP service.
    # service ntpd restart 

9. Status checking
   # ntpq
   ntpq> peers

10. Make sure the ntp starts automatically start at the boot time 
   # chkconfig ntpd on 



For AIX please follow the below steps:


1. Stop the ntp services
#stopsrc –s xntpd

2. Sync the time with ntp, login as root, type
      #ntpdate  <ip_address of the NTP server>

3. Make a copy of the file /etc/ntp.conf
#cp /etc/ntp.conf /etc/ntp.conf_bak

4. Edit file /etc/ntp.conf and append
    server <ip_address of the NTP server>
    driftfile /var/lib/ntp/drift  
    tracefile /etc/ntp.trace

5. Create the /var/lib/ntp directory and ensure /var/lib/ntp has correct ownership and permissions
           #mkdir /var/lib/ntp
( dwxr-xr-x 2 ntp ntp 4096 Mar  2 11:09  )

6. Create the file /var/lib/ntp/drift with the following entry:
         0.0

7. After creating the drift file, ensure that it has the right ownership and permissions:
-rw-r--r-- 1 ntp ntp 6 Mar  2 11:09 drift  

8. Start the NTP sercice
#startsrc –s xntpd

9. Take backup and uncomment xntpd from /etc/rc.tcpip. so it will start on a reboot.
#cp –p /etc/rc.tcpip /etc/rc.tcpip_bak 
        #vi /etc/rc.tcpip
        Uncomment the following line
Start /usr/sbin/xntpd “$src-running”  

10. Verify that the server is synched.
       #lssrc -ls xntpd

B) VALIDATION:


ntpdate –q <ntpserver> should not show the time difference more than 1 sec.

C) ROLLBACK


Replace all the configuration files that you have modified with the backup copies taken at the time of implementation .




How to set the standard shell prompt in aix servers?

How to set the standard shell prompt in aix servers?


1. Pre-work:

          Make sure to take the copy of the /etc/profile file using the below command.
             cp -p /etc/profile /etc/profile_old

2. Steps:

Append the following lines to the file /etc/profile to change the format of the shell prompt.
         PS1=`whoami`@`hostname –s`: '$PWD>'
         export PS1


For example you login as a root to the server test_server and you are in /etc the prompt look like the following:   Syntax: username@servername:presentworkingdirectory>    
              root@test_server:/etc>


3. Validation:
                Open a new login session and you should see the change in shell prompt.

4. Roll back:
               Remove the entry that you have added to the file “/etc/profile”