Saturday, December 3, 2022

AIX HACMP script to monitor cluster resource group health

Shell script to monitor AIX cluster health

while true
do
clrginfo
lssrc -ls clstrmgrES |grep -i state
Sleep 5
done

It show RG status and cluster is in stable or not.

Thanks !!!
:)

How to access LPAR from HMC console

How To access AIX LPAR VIO inside power server frame using HMC command line console.

1.Login to HMC using IP address or FQDN
2. Enter following command

#vtmenu
1.powerframe1
2.powerframe2
3.powerframe3



This command will display all POWER frame connected to this HMC, enter number of a frame which you wanted to access.

3. if AIX admin wanted to see list of AIX LPAR and VIO inside powerframe6, he must enter number 6

output:

hscroot@hmc> vtmenu
 Retrieving name of managed system(s) . . . 

 ----------------------------------------------------------
  Managed Systems:
 ----------------------------------------------------------
1)powerframe1
2)powerframe2
3)powerframe3

 Enter Number of Managed System.   (q to quit): 1

 ----------------------------------------------------------
  Partitions On Managed System:  powerframe1
 ----------------------------------------------------------
   1)    lpar1                              Running
   2)    lpar2                              Running
   3)    lpar3                              Running
   4)    lpar4                              Running
   5)    lpar5                              Running

Enter user name : root
Enter password :XXXXXXXX

lpar1#

===============================================================

now AIX admin can access AIX LPAR using entering number. In this case AIX admin wanted to access
lpar1 so here he entered 1.

once entered AIX admin can login using root password.


AIX admin can exit from lpar1# console using following sequence of steps.
    
1.
lpar1# exit

once exited from # prompt,



IBM AIX LPAR 

login: ~.

Terminate session [y/n]: y



once AIX admin pressed yes it will exit AIX lpar1 session.

**AIX admin must press ~ first and then . to exit AIX lpar1 session.
~.  (tilt +dot)  //key combination

Thanks !!!!

:)






Add Alias IP address to AIX server ethernet interface using chdev command

 Hello All,

Today topic is Alias IP configuration on ethernet interface.

Scenario 1:

Alias IP configuration on en0 using chdev with permanent/temporary.


Command for assigning alias IP on en0 interface permanently is like following.

#chdev -l en0 -a alias4=192.168.0.100,255.255.255.0

This will add IP address 192.168.0.100 as Alias IP to en0 interface. AIX admin can verify this using command

#ifconfig -a 

Chdev command permanently set IP to interface en0. this alias IP address remain on AIX interface after reboot also.

    Let's consider scenario where AIX admin wanted to set IP address for temporary purpose, he can use following command 

#ifconfig en0 192.168.1.3 netmask 255.255.255.0 alias


Scenario 2:

If AIX admin wanted to remove that alias IP, how he can remove that??

Answer:

Remove a permanently added alias from an interface

chdev -l en0 -a delalias4=192.168.1.3,255.255.255.0


Another useful command for adding default route on AIX server

#route add default 192.168.1.1


Here I am sharing small script to check whether AIX server ethernet interface are pingable or not

============================================================

for i in `ifconfig -a |grep -i inet |awk '{print $2}'`

do

echo $i

ping -c 10  $i

done


Above script will ping to IP address assigned to interface, if they up and active will get ping response.



Thanks!!!!
:)






Friday, December 2, 2022

Execute AIX mksysb in background with nohup utility

 Hello All,

Today i am writing this blog to show how AIX Admin can Execute AIX mksysb backup using "nohup" utility and monitor logs using tail command.


                        AIX Mksysb                                 


This method is usefull to get logs of AIX mksysb backup command

#nohup mksysb -ieX /backup/Aixlpar.mksysb &

Above command will generate 1 process id and run this command in background, also create nohup.out file,where all logs for above command will logged. If above mksysb backup command fails,AIX admin can review nohup.out file and take correct action to solve issue.


Command to monitor logs in "nohup.out"   // nohup.out will genrate in same path from where AIX admin executed mksysb command.

#tail -f nohup.out

Some other useful command for taking AIX server mksysb backup are :

Create a mksysb backup of the rootvg volume group

 #mksysb -i /mnt/Aixlpar.mksysb.`hostname`_`date +%m%d%y`

Above command will create backup with servername and time,date and year format.


Thanks !!!

:)




Friday, November 18, 2022

Script for enabling failed vscsi and fscsi path on AIX client .

 Hello All,


Today will share small script which tested and used for enabling failed path on AIX client LPAR.

sometime AIX admin needs to take reboot of VIO server for maintenance activity, when AIX admin reboot 1 VIO server out of 2 then 1 VSCSI or FSCSI path become failed. once VIO is up and active sometime AIX admin observe that after VIO up some path still in failed state. AIX admin can try following script to enable those path


Scenario: Script to enable only failed path


for s in `lspath |grep -i failed|awk '{print $2}'`

do

chpath -l $s -p `lspath -l $s |grep -i failed|awk '{print $3}'` -s Enabled

sleep 2

done


To confirm whether any path on VIO server is failed or not


#lspath |grep -i failed


Thanks  !!!


:)




Saturday, November 12, 2022

Run perfpmr on AIX to provide performance data from AIX server.

 Sometime AIX admin needs to provide AIX LPAR performance data to support for analysis,

this data generally required when there is performance issue on AIX LPAR.

========================================================


perfpmr data accurate and effective when AIX admin run during problem window or when problem exists.

IBM support provide script of perfpmr AIX admin must run script which is valid according to version of AIX operating system


steps to run perfpmr on AIX

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

step 1:

OBTAINING THE PACKAGE

          
           From the internet:

           ==================
           'ftp://ftp.software.ibm.com/aix/tools/perftools/perfpmr'




     configure "perfpmr" 1st time 


          once following file downloaded and placed on temporary location on AIX LPAR ,follow following procedure,
          'perf71.tar.Z'.

         login as root 


          create perf71 directory inside /tmp  and move tar file to that directory 

             # mkdir /tmp/perf71
             # cd /tmp/perf71



          c. extract the shell scripts out of the compressed
               tar file:

             # zcat /tmp/perf71.tar.Z | tar -xvf -


Step 2:

Create following directory

# mkdir /tmp/perfdata
# cd /tmp/perfdata

and run following script to start perfpmr and make sure that following script executed from "/tmp/perfdata" path only. if he execute in any other path all data will be collected there.

#nohup /tmp/perf71/perfpmr.sh 600 &


it will run command in background for 600 seconds, for 10 minutes

AIX Admin can monitor this by 

#tail -f nohup.out 


once from nohup.out AIX admin confirm that perfpmr completed ,admin can convert that directory to pax.gz by following command

#cd /tmp

#ls -ld perfdata

#pax -xpax -vw perfdata | gzip -c > pmr#.pax.gz


once file is genrated send that file to IBM support for analysis.



Thanks

.



split command Unix AIX

split command Unix AIX

AIX split command is useful when larg size "snap" file genrated and AIX admin unable to upload it on IBM ecurep portal because of file upload size restriction on company environment.

AIX admin can split file by using following command.

#split -b  size_of _file large_size_file_name

---size of file  ,  Here AIX admin mention 10th of the size of file, displayed by ls -l command
---large_size_file_name--- Mention file name which AIX admin wanted to split.


after above split command execution following 3 file will get generated,

xaa
xab
xac

AIX admin upload these files to ecurep portal.

this way AIX admin split large size file in 3 part and reduce size. this will help to bypass restriction of larg file upload


Thanks !!!!!