Friday, 24 July 2015

AIX Misc Commands

To list all the records in the /var/adm/wtmp file:
aix@um# last
To show the shutdown sessions:
aix@um# last | grep shutdown
To show how long the system has been up:
aix@um# uptime
aix@um# w -u
To enter the entry tty002:23:respawn:/usr/sbin/getty /dev/tty in inittab:
aix@um# chitab tty002:23:respawn:/usr/sbin/getty /dev/tty
To list the operating system level:
aix@um# oslevel
To see the number of license:
aix@um# lslicense
To change the fixed user license to 30:
aix@um# chlicense -u30
To enable floating user license:
aix@um# chlicense -f on
To display complete summary of report:
aix@um# errpt
To list complete detailed report:
aix@um# errpt -a
To list all hardware related errors:
aix@um# errpt -d H
To list all software related errors:
aix@um# errpt -d S
To list detailed error report of error id 88965309:
aix@um# errpt -a -j 88965309
To list all events for which reporting is currently disabled, type: aix@um# errpt -t -F Report=0
To disable the reporting of the ERRLOG_OFF event (error ID 192AC071):
aix@um# errupdate <Enter>
=192AC071: <Enter>
Report=False <Enter>
<Ctrl-D>
<Ctrl-D>
Example:
aix@um# errpt -t -F Report=0  
Id       Label               Type CL Description
1850F542 MINIDUMP_INFO       INFO O  NVRAM WAS RE-INITIALIZED
45E4E066 DUPCHECK_OFF        TEMP O  Duplicate checking turned off
86DC0701 DUPCHECK_ON         TEMP O  Duplicate checking turned on
B0787F02 NVRAM_ERRDATA       UNKN U  CORRUPT DATA DETECTED
aix@um# errupdate
=BFE4C025:
Report=False
0 entries added.
0 entries deleted.
1 entries updated.
aix@um# errpt -t -F Report=0  
Id       Label               Type CL Description
1850F542 MINIDUMP_INFO       INFO O  NVRAM WAS RE-INITIALIZED
45E4E066 DUPCHECK_OFF        TEMP O  Duplicate checking turned off
86DC0701 DUPCHECK_ON         TEMP O  Duplicate checking turned on
B0787F02 NVRAM_ERRDATA       UNKN U  CORRUPT DATA DETECTED
BFE4C025 SCAN_ERROR_CHRP     PERM H  UNDETERMINED ERROR
To enable the reporting of the ERRLOG_OFF event (error ID 192AC071) in case it was turned off:
aix@um# errupdate <Enter>
=192AC071: <Enter>
Report=True <Enter>
<Ctrl-D>
<Ctrl-D>
To delete the ERRLOG_OFF event (error ID 192AC071) from the Error Record Template Repository:
aix@um# errupdate <Enter>
-192AC071:
<Ctrl-D>
<Ctrl-D>
To add an entry to the errorlog:
aix@um# /usr/bin/errlogger "The desired message"
To dispay the HMC information (hmc ip is on HostName field of "resource N" stanza):
aix@um# lsrsrc "IBM.ManagementServer" or
aix@um# lsrsrc IBM.MCP
Sometimes you may get error on the above command, like:
aix@um# /usr/sbin/rsct/bin/lsrsrc-api: 2612-010 Resource class IBM.ManagementServer is not defined.
In this case, you can search for the hostname or ip of hmc on the file:
/var/ct/cfg/ctrmc.acls
How to list partition information:
aix@um# lparstat -i aix@um# lsattr -El sys0
How to display the processors available in the partition:
aix@um# bindprocessor -q
How to turn off SMT:
aix@um# smtctl -m off
How to turn on SMT:
aix@um# smtctl -m on
How to display SMT configuration:
aix@um# smtctl
How to set the number of hardware threads per core:
aix@um# smtctl -t N
How to turn on SMT:
aix@um# smtctl -m on
Details volume group info for the hard disk:
aix@um# lqueryvg -Atp /dev/hdisk
Find a file after the inode number:
aix@um# find /usr -xdev -inum INODE -print
aix@um# ncheck -i INODE /dev/hd2 <- warning: the path starts with the FS (eg /usr/bin/ksh = /bin/ksh in our example)
How to list the kernel processes:
aix@um# ps -ekl
How to list the threats of a given process:

aix@um# ps -ef|grep sshd <- get the pid of sshd

aix@um# ps -lmp <PID>
How to get the serial number of a vio disk from the lpar client (DS disk in this example):
aix@um# odmget CuAt | grep -p hdisk25 | grep -p "unique_id" | grep value
        value = "234324324324375992817EE807210790003IBMfcp05VDASD03AIXvscsi"
or better,
for DS disks:
aix@um# odmget -q "name=hdisk0 and attribute=unique_id" CuAt | awk '/value/ {print substr($3,14,11)}'
75992817EE8

for SVC disks:
aix@um# odmget -q "name=hdisk0 and attribute=unique_id" CuAt | awk '/value/ {print substr($3,11,32)}'
6005076801810514A800000000000853
How to check the error log size:
aix@um# /usr/lib/errdemon -l
How to display the current control key settings:
aix@um# stty -a
How to put a system in maintenance mode without reboot:
aix@um# telinit m
HMC Led Codes:
0c54 = An AIX install is in progress
0552 = varyon of the root volume group failed
0c31 = waiting for user to define console type vty0
How to get the last modification date of a file:
aix@um# $ istat loop.pl
Inode 120 on device 10/8        File
Protection: rwxr-xr-x   
Owner: 205(florian)             Group: 1(staff)
Link count:   1         Length 74 bytes

Last updated:   Tue May 15 03:55:23 2012
Last modified:  Tue May 15 03:55:23 2012
Last accessed:  Tue May 15 04:06:31 2012

No comments:

Post a Comment