Http://blog.chinaunix.net/u/21218/showart_1165341.html
1. Check the AIX system status
1. File System: df-k
2. device: lsdev-C
3. Disk (physical volume): lspv
4. paging space: lsps-
5. Configuration: lscfg-vp
6. Software: lslpp-l
7. User: who
8. Number of processors: lsdev-C | grep proc
9. Memory size: lsattr-El mem0
Ii. Shutdown
1. shutdown
Use the wall command to remind users to shut down after several times;
2. shutdown + 2
Shut down in 2 minutes
3. shutdown-Fr
-R = restart after Shutdown
Iii. Error records
1. Error: errpt
2. Detailed error message: errpt-
3. Clear error records: errclear 0
Iv. smit/smitty shortcut menu:
# Smitty tape
# Smitty user
# Smitty tcpip
# Smitty inet
# Smitty nfs
# Smitty jfs
# Smitty lvm
V. Volume group (smitty vg)
1. display the volume group status:
List volume group details: lsvg
List logical volumes in a volume group: lsvg-l
List physical volumes in a volume group: lsvg-p
2. Add a volume group: smitty mkvg
3. Modify the volume group attribute: smitty chvg
4. Activate the volume group: varyonvg vg_name
5. Remove the volume group: varyoffvg vg_name
6. Add a physical volume to the volume group: extendvg vg_name hdiskn
Note: The extendvg command is used to add a new physical volume to an existing volume group. The status of this physical volume device must be Available (Available ).
7. delete a physical volume from the volume group: performancevg [-d] vg_name hdiskn
Note: When you delete a physical volume, its volume group must be inactive. If the deleted physical volume is the only one in the volume group, the volume group is also deleted.
Vi. physical volume (smitty pv)
1. lspv
List physical volume names: lspv
List physical volume details: lspv hdiskN
List logical volumes in a physical volume: lspv-l hdiskN
List the physical Partition Distribution in a physical volume: lspv-p hdiskN
2. Add a physical volume: cfgmgr/mkdev
3. delete a physical volume: rmdev
VII. logical volume (smitty lv)
1. Display logical volume information
List logical volume names: lslv-l
List logical volume details: lslv
List physical volumes related to logical volumes: lslv-l
List the allocation of physical partitions in a physical volume: lslv-p
Display the correspondence between LP (logical partition) and PP (physical partition) in a logical volume: lslv-m
2. Add a logical volume
# Smitty mklv
# Mklv
3. delete a logical volume
# Smitty rmlv
# Rmlv
4. Set logical volume attributes
# Smitty lvsc
# Chlv
5. added logical volume copy: smitty mklvcopy
6. Delete logical volume copy: smitty rmlvcopy
8. device management
1. Added devices to the configuration system.
2. lsattr: used to read the configuration attributes of a specified device. Some attributes can be changed.
3. lscfg: used to display the Type, serial number, and supplier information of the specified device.
4. rmdev: Delete the device from the system or make the device in the defined state.
5. lsdev/prtconf: lists the devices defined in the current system.
9. User/User Group
1. for user groups, use smit group
For the management of a small number of users, use smit user
For a large number of users, use mkuser
2. Modify user attributes: smitty chuser
Modify user group attributes: smitty chgroup
3. delete a user: smitty rmuser
Delete user group: smitty rmgroup
10. Common user monitoring commands
Who
Last-Logon event and shutdown Information
Last root console
Last | grep shutdown
11. System Record Files
List System records: alog-L
Example: boot bosinst nim console
List Files: alog-o-t boot
12. Installation Package: installp/smitty installp
13. List the current versions of all installed ibm aix software.
# Lslpp-l
14. List the file sets in which a command is contained
# Lslpp-w/usr/bin/vi
15. Backup
1. Create a system backup: smit mksysb
2. logical volume group backup: savevg
3. Common UNIX commands for backup and recovery: dd, cpio, backup, restore, tar, etc.
16. Monitor CPU usage
# Vmstat 2
# Iostat-t 2 6
# Sar-p all 2 3
17. Monitor memory usage
# Vmstat 2 10
# Ps aux
# Svmon-G
# Svmon-Pau 10
18. Monitor I/O usage
# Iostat 5
# Sar-d 3 3
# Filemon-O lv, pv-o fmon. out
19. Monitor network usage
1. Network Interface statistics: netstat-I
2. Network memory usage: netstat-m
3. Statistics of every running Device Driver Based on the Universal Data Link Interface: netstat-v
4. display the statistics of the values specified by the Protocol parameters (udp, tcp, ip, and icmp): netstat-p, netstat-p ip
5. Obtain the network operation details within a time interval: netpmon-o netpmon. out-O all; sleep 400; trcstop
20. text-based monitoring
# Topas
View hardware configuration on AIX
View memory
Run # lsdev-Cc memory
View the configured physical memory device. The following is an example of its output:
Mem0 Available 00-00 Memory
L2cache0 Available 00-00 L2 Cache
Use the command # lsattr-El mem0
Output:
Size 512 Total amount of physical memory in Mbytes False
Goodsize 512 Amount of usable physical memory in Mbytes False
In this example, the physical memory of the machine is 512 MB. If there is mem1 in the output of lsdev, run the same command to view the corresponding size and push it accordingly.
Or
# Bootinfo-r
View physical memory
Prtconf can view all information about the system, such as cpu memory hard disk ..
Display the frequency of each CPU
# Pmcycles-m
View the machine model, SN
# Uname-Mu:
IBM, 7043-150 IBM, 01105DE2CE
Among them, IBM, 7043-150 is the model, and 105DE2CE in 01105DE2CE is the sn indicated on the machine: 10-5DE2CE, that is, the sequential number.
View system maintenance level/* Note: maintenance
# Oslevel-s
View Hard Disk
For the 7133 hard drive system, type lsdev-CHc pdiskIBM
For other hard disks, type: # lsdev-CHc disk
View adapter card
# Lsdev-CHc adapter
Enter the command # diag to enter the diagnostic mode to view the hardware information.
Modify system parameters
Modify system time zone # smitty chtz
Modify system time # smitty data
Modify asynchronous IO # smitty chgaio
Change the maximum number of processes # smitty chgsys
Change the number of system users # smitty chlicense
Configure host name and IP # smitty mktcpip
You can run the # lscfg-vl ent0 command to check which expansion slot the ent0 Nic is located in.
Configure the Paging Space (hd6) and System File System of the system.
1. Check the size of the PP on rootvg. Type # lsvg rootvg and confirm that the PP size is 32 MB.
Pp size: 32 megabyte (s)
2. Check the default hd6 size.
# Lsps-
Pagespace physicalvolume volumegroup size % used active auto type
Hd6 hdisk0 rootvg 512 MB 1 Yes LV
The default system has only one hd6 space and is relatively small.
The size of swap space is related to the memory size and application. If you do not know the memory usage of the application, you can set it according to the following principles. When the memory is less than 2 GB,
The size of swap space should be twice the size of the memory. When the memory is smaller than 8 GB and larger than 2 GB, the swap space size should be the same as the memory size. Memory larger than 8 GB
The swap space should be half the memory size.
Install the extension subsystem: # Smitty install_all (NOTE: When installing the software, use \ "/\" to activate the FIND dialog box)
Install MAN: insert the base documentation disc and type the # smitty install_latest command.
Use update CD to upgrade: Enter the CD and type # smitty update_all.
Use PTF to upgrade the disk: Enter the disk and type # smitty update_all.
Check the patch applied by the current system: # instfix-I | grep AIX_ML.
Create a disk Boot Image
# Bosboot-ad/dev/hdisk0
View startup sequence
# Bootlist-m normal-o
Set the startup sequence
# Bootlist-m normal hdisk0 hdisk1
View server microcodes
# Lsmcode
Upgrade server microcode
#/Usr/lpp/diagnostics/bin/update_flash-f img file name.
The server has two local hard disks set as rootvg and images.
# Extendvg rootvg hdisk1 (add hdisk1 to rootvg)
# Mirrorvg rootvg (create an image using rootvg)
Clone rootvg to backup disk hdisk1
# Alt_disk_install-O-B-C hdisk1
Rename the backup volume group on hdisk1 to backup_vg
# Alt_disk_install-V backup_vg hdisk1
Delete backup volume group backup_vg
# Alt_disk_install-X backup_vg
1. Create an image
1 lsdev-Ccdisk # Check the distribution of the system disk. This example uses the hdisk0 hdisk1 image as an example.
2 chdev-l hdisk1-a pv = yes # configure hdisk1 as PV
3 extendvg rootvg hdisk1 # configure hdisk1 to rootvg (you can add the-f parameter to forcibly add hdisk1 to rootvg)
4 mirrorvg rootvg # image system volume
5 bosboot-a-d/dev/hdisk1 # Add the boot information to the new disk
6 bootlist-m normal hdisk0 hdisk1 # change the start sequence
Ii. delete an image
1 unmirrorvg rootvg hdisk1 # cancel the image
2 chpv-c hdisk1 # Clear the boot Area
3 reducevg rootvg hdisk1 # Delete PV from VG
4 bootlist-m normal hdisk0 # change the startup sequence
Device management
The AIX system has four statuses:
Undefined (Undefined): indicates that the device cannot be recognized by the system. That is, the system cannot find the device.
Defined: indicates that the system can recognize devices. But the system cannot use it.
Available (Available): indicates that the device can be used in the system. You can also use it.
Stopped: indicates that the device cannot be used, but the operating system can identify it through the driver.
Lsdev displays the device list:
Lsdev has two formats
All devices displayed in lsdev-C are installed in the system.
Lsdev-P displays all the devices in the system's predefined Device database, that is, the devices supported by the system.
Common parameters-C Class: devices whose display function is classified as Class
Example: lsdev-CC Disk
-H: the output information contains the headers of each column.
Example: lsdev-CC disk-H
-S State indicates a device whose status is state. It cannot be used with the-p Parameter at the same time.
State Parameter
Status represented by the value
D, D, 0, defined Defined
A, A, 1, available Available
S, s, 2, stopped Stopped
Example: lsdev-Cc adapter-S a-H
-R ColumnName: displays all values of the specified column name as ColumnName. The ColumnName value is generally
Class, subclass, type.
Example: lsdev-C-r class
Lsattr:
You can use the lsattr command to display the properties of the device that has been installed in the system. When using this command, you must specify the specific device name.
-L indicates the logical name of the device to be displayed. Otherwise, use parameters such as-c,-s, and-t to uniquely identify an existing device.
Lsattr must use one of the following four parameters:
-D: display the default properties of a device. Read the default values of a specific device type from the predefined Device database.
-E: displays the current valid values of a specific device. You can only read the current valid values of a specific device from the User-Defined Device database.
And the-l Name parameter are used at the same time.
-F Format uses a user-defined Format. The characters in Format can be attribute, value, or deflt.
(Current Value/default value), description and user_settable
A combination of double quotation marks. For example,-F \ "attribute description user_settable \"
-R: limited range of display attributes
Other parameters
-L name indicates the device information with the logical name. name indicates the device name displayed by the lsdev command.
-A attribute: displays the specified attribute value. One or more attributes can be displayed. To display multiple attributes
These attributes are separated by spaces and enclosed in a pair of double quotation marks.
Display the default value of hdisk0 for disk devices
# Lsattr-D-l hdisk0-H
Display the current valid value of the hdisk0 attribute of the disk device
# Lsattr-e-l hdisk0-H
Display the possible values of the login attribute of the tty0 Terminal Device
# Lsattr-R-l tty0-a login
Lscfg displays system configuration information, diagnostic information, and important product data (VPD ).
Common parameters:
-L name: displays the device information of the named device name.
-P: displays platform-specific device information. This flag is only applicable to AIX 4.2.1 or later versions.
-V displays the VPD found in the Custom VPD object class. Similarly, when used with the-p Flag, it can display AIX 4.2.1 or the platform-specific VPD on the updated version.
The-s line shows the device description from name to location.
The system configuration with the device description should be displayed on each line.
# Lscfg-s
To display the VPD of a specific device specified by the logical name ent0
# Lscfg-v-l ent0
To display the name, location, and description of the device specified by hdisk without a vpd logical name
# Lscfg-l hdisk \\*
To display the VPD of the corresponding node in the Open Firmware Device Tree to the ent0 Device
# Lscfg-vp-l ent0
Volume group:
List volume group details: lsvg vg_name
List logical volumes in a volume group: lsvg-l vg_name
List physical volumes in a volume group: lsvg-p vg_name
List all logical volumes by volume group: lsvg-o | lsvg-I-l
Add volume group: smitty mkvg
Scale up/down a volume group smitty vgsc
Activate the volume group (make it available): varyonvg vg_name
Remove volume group: varyoffvg vg_name
Modify volume group attributes: smitty chvg
Add a physical volume to the volume group: The extendvg vg_name hdiskN hard disk status must be available.
Delete a physical volume from the volume group: reducevg [-d] vg_name hdiskN the volume group in which the volume is deleted must be inactive
Physical volume:
List physical volume names: lspv
List physical volume details: lspv hdiskN
List logical volumes in a physical volume: lspv-l hdiskN
List the physical Partition Distribution in a physical volume: lspv-p hdiskN
Display the correspondence between physical and logical partitions: lspv-M hdiskN
Add physical volume: cfgmgr/mkdev
Delete physical volume: rmdev
Logical volume:
List logical volume names: lsvg-l vg_name
List logical volume details: lslv lv_name
List physical volumes related to logical volumes: lslv-l lv_name
List the allocation of physical partitions in a physical volume: lslv-p pv_name
Display the correspondence between LP and PP in a logical volume: lslv-m lv_name
Add logical volume: smitty mklv or mklv
Delete logical volume: smitty rmlv active rmlv
Set logical volume attributes: smitty lvsc or chlv
Added logical volume copy: smitty mklvcopy
Delete logical volume copy: smitty rmlvcopy
Obtain subsystem status # lssrc-
Obtain the status of the active subsystem # lssrc-a | grep active
Start subsystem: # startsrc [option] {-s subsystem |-g group}
Example: # startsrc-s tftpd
Stop subsystem: # stopsrc [option] {-s subsystem |-g group}
Example: # stopsrc-s tftpd
Refresh subsystem: # refresh-s tftpd
1. Whether the file system is full
Df-k can check the file system usage in K units
2. Check System error logs
Errpt | more to check
Clear existing log: Errclear 0
3. Check whether the system is valid or illegal
Last Command to check the login location.
4. Check whether the system generates a huge Core file.
Find/-name core-print to check.
You can delete Core files directly.
5. system performance check:
A) CPU performance: Use Vmstat and topas to check
B) memory usage: topas and vmstat are also used for checking.
C) Check IO balancing usage: Use iostat to check
D) swap space usage: Use lsps-a to check
6. Mail check
7. Diag once a month
--------------------------------------------------------------- I recently used some basic AIX commands. Sorry, I have never touched it before, and there are many differences between AIX and Linux, it is estimated that some Aix-related things will be added in succession recently. Next, let's take a look at the simplest MEMORY command and how to manage logs. 1. # lsdev-CC memory view the configured physical memory device. The following is an example of its output: l2cache0 available L2 cache mem0 available memory # lsattr-El mem0 output is similar to the following: goodsize 7936 amount of usable physical memory in Mbytes false size 7936 total amount of physical memory in Mbytes false This example shows that the physical memory of the machine is 5888 MB. If there is mem1 in the output of lsdev, run the same command to view the corresponding size and push it accordingly. 2. # bootinfo-r 8126464 This example shows that the physical memory of the machine is 8126464kb. 3. # The prtconf output is similar to the following: -- memory size: 7936 MB -- this command displays the detailed configuration information of the current host. The output contains the memory size attribute, it indicates the current physical memory size 4, # svmon-G output is similar to the following: size inuse free pin virtual memory 2031616 1474504 557112 210251 440972 PG space 131072 1555 work pers clnt pin 210251 0 0 in use 440972 0 1033532 pagesize poolsize inuse pgsp pin virtual S 4 kb-1426984 1555 187531 393452 M 64 KB-2970 0 1420 2970 of which: size indicates the actual physical memory size, in 4 K. therefore, the current physical memory size is 4 K * 2031616 = 8126464kb