Friday, January 30, 2009

AIX - Tips & Tricks

31. How to manage network tuning parameters in AIX ?

The no command is used to configure network tuning parameters in IBM AIX. The no command sets or displays current or next boot values for network tuning parameters. This command can also make permanent changes or defer changes until the next reboot.

Syntax:
no [ -p -r ] { -o Tunable[=NewValue] }
no [ -p -r ] {-d Tunable }
no [ -p -r ] { -D }
no [ -p -r ] -a
no -h [ Tunable ]
no -L [ Tunable ]
no -x [ Tunable ]

where:
-a : displays current, reboot or permanent value for all tunable parameters
-d : resets Tunable its to default value
-D : resets all tunables to their default value
-h : displays help about Tunable parameter
-L : lists the characteristics of one or all Tunables
-o : displays the value or sets the Tunable to NewValue
-p : makes changes apply to both current and reboot values (I heard this option in many interviews)
-r : makes changes apply to reboot values (I heard this option in many interviews)
-x : lists characteristics of one or all tunables using spreadhset format

Example to set the value of tunable tcp_sendspace to 65536 permanently:
# no -p -o tcp_sendspace=65536

Example to set the value of tunable sb_max to 2097152 at next reboot:
# no -r -o sb_max=2097152

Example to display all values of tunables:
# no -a

Example to display all values of tunables at next reboot:
# no -r -a

Example to set the value of tunable tcp_sendspace to 65536:
# no -o tcp_sendspace=65536

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

32. How to verify your ntp setup is working properly ?

# ntpq -c peersremote refid st t when poll reach delay offset disp =========================================================================
*time.domain.co doghaus.cns.uto 3 u 12 64 177 1.46 -2.515 145.19

If you have a star (*) in the first column of the name of the time server, your time is being synchronised properly.

The third column, st, is the stratum. The lower the number, the closer you are to the time source.

Stratum 16 means you are not synchronised.

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

33. How to syncronise your server time to a time server ?

If you don't want to run NTP (network time protocol), you can update your system time with the command:

# ntpdate timeserver.domain.com

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

34.How to list open files ?

To list all open files:
# lsof

To list all open files on a device:
# lsof /dev/hd4

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

35. How to find the world-wide name (WWN) or network address of a fibre-channel (FC) card in IBM AIX ?

First find the name of your fibre-channel cards:
# lsdev -vp grep fcs

Then get the WWN (for fcs0 in this example):
# lscfg -vp -l fcs0 grep "Network Address"

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

36. How to change a server hostname with the uname command in IBM AIX ?

To display the current hostname
# uname -n
localhost

To change the hostname
# uname -S newhostname

Again display the hostname
# uname -n
newhostname

----------------------------------------------------------------------------------------------------------------
37. How can you find out when a system was installed?
Enter the following command:
lslpp -h bos.rte
The output of this command will show the history of when the operating system was installed. Read the entry for the AIX level (ie, 4.3.3.0).

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

38. How to make sure all of the user definitions are correct in the user database

#usrck -n ALL

Do the same for the groups:
#grpck -n ALL

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

39. Reduce the Size of a File System in Your Root Volume Group ?
http://publib16.boulder.ibm.com/pseries/en_US/infocenter/howto/HT_baseadmn_rootvg_reduce.htm#baseadmn_rootvg_reduce
----------------------------------------------------------------------------------------------------------------

40.How to reset an Unknown Root Password ?
http://publib16.boulder.ibm.com/pseries/en_US/infocenter/howto/HT_baseadmn_recoverrootpswd.htm#baseadmn_recoverrootpswd
----------------------------------------------------------------------------------------------------------------

No comments: