Useful Tips in Aix099

download Useful Tips in Aix099

of 36

  • date post

  • Category


  • view

  • download


Embed Size (px)



Transcript of Useful Tips in Aix099


ls -l /home | sort -rn This displaysfiles and directoris inside /home as per their size, larger fileon top.

ls -l /home/* sort -rn This displays files and alsothe subdirectoriesin the /home/ directories as per their size, larger one on top.

Note:If /home dir. contains more than one dir. then it first showsall the directiory name and thenthe files inside the directories as per the directory order. The order is symlink, Directory name, file name.

du /home | sort -rn This also displaysthe subdirectories inside /home as per their size butnot files.

du -m /home/test/smit.log This shows the size of the smit.log in MB.-g=GB, -k=KB, without flag=shows in Block size.

ls -lrt | grep 'Jan 10' | awk '{print$9}'>namefile This is used to get only the file names dated Jan 2010 in a namefile

rm `cat namefile` To delete filenames mentioned in the namefile created by the above command.

To execute a command in a loop, i.e. in a certain intervals, put the small script in the shell

while i=dodf -g /backupsleep 3done

in the above example this will show the size of /backup filesystem in each 3 seconds interval.

stty erase ^? To use backspace button to clear previous letters.

set -o vi To see previous executed commands using vi stylei.e. esc+ j=up, h=down, l=go right, g=go left, /string= search the command from history,

NIM related Commands in AIX

lsnim To list the nim resources

lsnim -l dcmds To list the detailed info about the object dcmds

lsnim -O dcmds To list the operation dcmds object can support

lsnim -c resources dcmds To list the resources allocated to the machine dcmds

nimclient The client version of nim command (User can obtain same results of nim in server )

nimconfig -a pif_name=en0 -a netname=net1 To initialise the NIM master with network name net1

nimconfig -r To rebuild /etc/niminfo file which contains the variables for NIM

nim -o define -t lpp_source -a source=/dev/cd0 -a server=master -a location=/export/lpp_source/lpp_source1 lpp_source1 To define lpp_source1 image in /export/lpp_source/lpp_source directory from source cd0

nim -o define -t mksysb -a server=master -a location=/resources/mksysb.image mksysb1 To define mksysb resource mksysb1, from source /resources/mksysb.image on master

nim -o remove inst_resource To remove the resource inst_resource

nim -o check lpp_source1 To check the status of lpp_source lpp_source1

nim -o allocate -a spot=spot1 -a lpp_source=lpp_source1 node1 To allocate the resources spot1 and lpp_source1 to the client node1

nim -o bos_inst node1 To initialise NIM for the BOS installation on node1 with the allocated resources

nim -o dkls_init dcmds To initialize the machine dcmds as diskless operation

nim -o dtls_init dcmds To initialize the machine dcmds for dataless operation

nim -o cust dcmds To initialize the machine dcmds for customize operation

nim -o diag dcmds To initialize the machine dcmds for diag operation

nim -o maint dcmds To initialize the machine dcmds for maintenance operation

nim -o define -t standalone -a platform=rspc -a if1="net1 dcmds xxxxx" -a cable_type1=bnc dcmds To define the machine dcmds as standalone with platform as rspc and network as net1 with cable type bnc and mac address xxxxx

nim -o unconfig master To unconfigure nim master

nim -o allocate -a spot=spot1 dcmds To allocate the resource spot1 from machine dcmds

nim -o deallocate -a spot=spot1 dcmds To de allocate the resource spot1 from machine dcmds

nim -o remove dcmds To remove machine dcmds after removing all resources associated to it

nim -o reboot dcmds To reboot ther client dcmds

nim -o define -t lpp_source -a location=/software/lpp1 -a server=master -a source=/dev/cd0 lpp1 To define lppsource lpp1 on master at /software/lpp1 directory from source device /dev/cd0

Useful HACMP Commands

clstart -m -s -b -i -l To start cluster daemons (m-clstrmgr, s-clsmuxpd, b-broadcast message, -i-clinfo, -l cllockd)

clstop -f -N To force shutdown cluster immediately without releasing resources

clstop -g -N To do graceful shutdown immediately with no takeover

clstop -gr -N To do graceful shutdown immediately with takeover

cldare -t To sync the cluster toplogy

cldare -t -f To do the mock sync of topology

cldare -r To sync the cluster resources

cldare -r -f To do the mock sync of resourcesclverify cluster verification utility

cllscf To list clustur topology information

cllsclstr To list the name and security level of the cluster

cllsnode To list the info about the cluster nodes

cllsnode -i node1 To list info about node1

cllsdisk -g shrg To list the PVID of the shared hard disk for resource group shrg

cllsnw To list all cluster networkscllsnw -n ether1 To list the details of network ether1

cllsif To list the details by network adapter

cllsif -n node1_service To list the details of network adapter node1_service

cllsvg To list the shared vgs which can be accessed by all nodes

cllsvg -g sh1 To list the shared vgs in resource group sh1

cllslv To list the shared lvs

cllslv -g sh1 To list the shared lvs in the resource group sh1

cllsdisk -g sh1 To list the PVID of disks in the resource group sh1

cllsfs To list the shared file systems

cllsfs -g sh1 To list the shared file systems in the resource group sh1

cllsnim Show info about all network modules

cllsnim -n ether Show info about ether network module

cllsparam -n node1 To list the runtime parameters for the node node1

cllsserv To list all the application servers

claddclstr -i 3 -n dcm To add a cluster definition with name dcm and id 3

claddnode To add an adapter

claddnim To add network interface module

claddgrp -g sh1 -r cascading -n n1 n2 To create resource group sh1 with nodes n1,n2 in cascade

claddserv -s ser1 -b /usr/start -e /usr/stop Creates an application server ser1 with startscript as /usr/start and stop script as /usr/stop

clchclstr -i 2 -n dcmds To change cluster definitions name to dcmds and id to 2

clchclstr -s enhanced To change the clustur security to enhanced

clchnode To change the adapter parameters

clchgrp To change the resource group name or node relationship

clchparam To change the run time parameters (like verbose logging)

clchserv To change the name of app. server or change the start/end scripts

clrmclstr To remove the cluster definition

clrmgrp -g sh1 To delete the resource group sh1 and related resources

clrmnim ether To remove the network interface module ether

clrmnode -n node1 To remove the node node1

clrmnode -a node1_svc To remove the adapter named node1_svc

clrmres -g sh1 To remove all resources from resource group sh1

clrmserv app1 To remove the application server app1

clrmserv ALL To remove all applicaion servers

clgetactivenodes -n node1 To list the nodes with active cluster manager processes from cluster manager on node node1

clgetaddr node1 returns a pingable address from node node1

clgetgrp -g sh1 To list the info about resource group sh1

clgetgrp -g sh1 -f nodes To list the participating nodes in the resource group sh1

clgetif To list interface name/interface device name/netmask associated with a specified ip label / ip address of a specific node

clgetip sh1 To get the ip label associated to the resource groupclgetnet To list the network for ip, netmask

clgetvg -l nodelv To list the VG of LV nodelv

cllistlogs To list the logs

clnodename -a node5 To add node5 to the cluster

clnodename -o node5 -n node3 To change the cluster node name node5 to node3

clshowres Lists resources defined for all resource group

clfindres To find the resource group within a cluster

xclconfig X utility for cluster configuration

xhacmpm X utility for hacmp management

xclstat X utility for cluster status



/tmp/hacmp.out Detailed event script output logged in 7 day rolling history

/var/adm/cluster.log High level view of cluster events (No clean up on this file)

/usr/sbin/cluster/history/cluster.mmdd Day by day view of cluster events. (one file / day of month)

/tmp/cm.log Clstrmgr messages

/tmp/cspoc.log Output from C-SPOC commands (similar to smit.log)

/tmp/emuhacmp.out Output from event emulation

rdist -b -f /etc/disfile1 To distribute the files in disfile1 to all nodes in disfile1 in binary mode

Sample entry for disfile1 HOSTS = ( root@node1 root@node3 ) FILES = ( /etc/passwd /etc/security/passwd) ${FILES} -> ${HOSTS}/usr/es/sbin/cluster/utility/* (All commands)


Difference between Ethernet Interface(en0) and Ethernet adapter (ent0)

AIX differentiates between hardware adapters, their interfaces and protocols standards associated.

To recognize interface card AIX uses three notations:

ent, en and et.

All are different and are described below and the sake of completeness I am using 0 at the end:


The notation ent0 is used to specify the hardware adapter. It has nothing to do with the TCP/IP address. The parameters associated with ent0 can be seen as below