Showing posts with label AIX. Show all posts
Showing posts with label AIX. Show all posts

What is IBM AIX (Advance Interactive eXecutive) Operating System ?

A computer consists of many hardware devices that the users of a computer system want to use. For example, they want to print documents or they want to play a game from a CD-ROM. To control these hardware devices and to share them between multiple users an operating system must be loaded during the system startup.

AIX Operating System Basics:

In the case of the AIX operating system, there is one special program which interfaces directly to the hardware devices - the AIX Kernel. The Kernel controls the access to the devices. On the other hand the users start different programs, for example, a program that prints a document or removes a file. These programs that run in AIX processes are also controlled by the AIX Kernel. To say it in easy words: The AIX Kernel is the heart of your operating system.

Also Read:  AIX Basic concepts and commands

Working on AIX:
AIX is a multi-user system. Before a user can work with AIX, an authentication process takes place. The user must log in with his username and password. After a successful authentication AIX starts a certain program for the user, a shell. The shell is a command interpreter that waits for input and executes the commands and programs the user types in. As you will learn in this course, the shell is not only a command
interpreter - it offers great flexibility.

Multiple users can work at the same time on an AIX system or in a network. One of the basic tasks in your daily work is to communicate with other users on a system or in the network. In this course you will learn different commands that allow communication with other users.

AIX offers a wide range of tools and commands. To get help about these commands, AIX offers different possibilities, for example, the man command or the AIX Online.

One of the major tasks of a computer system is to read and write data. In order to do this AIX uses a hierarchical file tree that consists of directories, subdirectories and files. The top level directory is called the root (/) directory that has many subdirectories. Each of these subdirectories can contain files or other subdirectories. Compare a directory with a document folder in which you put certain documents.

The file tree is mounted during the system startup. AIX supports different file system types, which are all mounted to one big file tree. This is shown on the visual. Parts of this file tree reside on a disk, other parts may reside on a CD-ROM or are mounted from another computer in a network.

This course explains how to work with directories and files on a user level. You will learn how to navigate in the file tree and how to manage directories. You will learn how to copy, move, delete and print files, how to edit files using the common UNIX editor vi. Another topic will be how to specify correct file permissions.

The SHELL: User Interface to AIX

When you log in successfully to an AIX system a special program is started for you - the shell. The shell waits for input and executes the commands and programs you type in. In other words the shell is a command interpreter.

The shell offers many features (like wildcards to match filenames, variables, command line editing) that help the user in his daily work. We will discuss all these features in this course. The shell is customizable, that means the user interface may be tailored according to the requirements of each user. Customizing the user environment is another topic in this course.

The shell offers different ways to control processes. In this course we explain how a user can control his processes. Besides all these properties the shell is a programming language. You can write shell scripts to create and tailor commands. Writing simple shell scripts is one additional topic in this course.

Also Read:  AIX Basic concepts and commands

AIX Utilities:
The components that you use on AIX are files and directories. To work with these components AIX offers a wide range of utilities:
  • The find command to search for specific files.
  • The grep command to search for patterns in files. 
  • Commands to compare files and directories. 
  • Commands to compress and uncompress files to save disk space.
Note that this list is not complete. Besides these utilities the course introduces additional tools that are useful for your work.

AIX Graphical User Interfaces:

Modern operating systems are based on graphical desktops. These desktops consist of multiple Windows where you can start different applications, icons that are minimized windows to manage the screen space, and further controls.

To execute certain actions on the desktop, you have to use the mouse attached to the system. AIX offers two different graphical user interfaces:
  • AIXwindows
  • Common Desktop Environment (CDE)
Using and customizing these desktops are major topics in this course. If you install the AIX Toolbox for Linux applications, two more graphical user interfaces are supported. These are the KDE and Gnome desktops.

Also Read: Frequently Asked Interview Questions and Answers 

Summary
  • The AIX KERNEL inerfaces to hardware devices and controlls processes running in the AIX system.
  • The user's inerface to AIX is the SHELL. The shell is a command interpreter that offers a great flexibility.
  • To store data AIX uses a hierarchial FILE TREE that consists of FILES and DIRECTORIES.
  • AIX offers wide range of utilities.

Commands to check AIX system configuration and users information

How to check the AIX server Configuration details

  • Find the OS, (ML/)TL (-r), and service pack version / date (-s) 
                  oslevel -r ⇐or⇒ oslevel -s
  • List all attributes of system
                  getconf -a
  • Find the type of kernel loaded (use -a to get all options)
                  getconf KERNEL BITMODE
          bootinfo and getconf can return much of the same information, getconf returns more                 and has the grepable -a option.

Also Read: Storage Area Network (SAN) Basic Free Tutorials
  • Find the level of firmware on a system 
                    invscout ⇐or⇒ lscfg -pv
  • List all attributes for the kernel “device”
                    lsattr -El sys0
  • Print a “dump” of system information
                     prtconf
  • Get all page sizes supported on this system
                    pagesize -a

How to query users and groups in AIX

  • List all settings for root user in grepable format 
                    lsuser -f root
  • List just the user names
                   lsuser -a id ALL | sed ’s/ id.*$//’
  • Find the fsize value for user wfavorit
                     lsuser -a fsize wfavorit
  • Change the fsize value for user wfavorit
                     chuser fsize=-1 wfavorit

(/usr)/bin/sh and (/usr)/bin/ksh are the same file. Use bsh for the Bourne shell.

Also Read: AIX Scenario based questions

How to query installed software packages in AIX

  • List all files in bos.games fileset.
                    lslpp -f bos.games
  • Find out what fileset “fortune” belongs to.
                    lslpp -w /usr/games/fortune
  • List packages that are above the current OS level
                   oslevel -g
  • Find packages below a specified (ML/)TL
                    oslevel -rl 5300-05
  • List all filesets
                     lslpp -L
  • List all filesets in a grepable or awkable format
                    lslpp -Lc
  • Find the package that contains the filemon utility
                   which -fileset filemon
  • Install the database (from CD/DVD) for which fileset
                   installp -ac -d /dev/cd0 bos.content list
  • Create a mksysb backup of the rootvg volume group
                   mksysb -i /mnt/server1.mksysb.‘date +%m%d%y‘
  • Cleanup after a failed install
                   installp -C

Commands to monitor AIX server CPU memory utilization and performance

AIX Commands to monitor System Resource Controller (SRC)

Most SRC based services are started from /etc/rc.tcpip 
  • Start the xntpd service
                  startsrc -s xntpd
  • Stop the NFS related services
                  stopsrc -g nfs
  • Refresh the named service
                  refresh -s named
  • List all registered services on the system
                  lssrc -a
  • Show status of ctrmc subsystem
                   lssrc -l -s ctrmc

AIX Commands to monitor system performance

CPU performance
mpstat
topas -P
lparstat
ps
iostat -tT 1
tprof†
curt† ------   (†Denotes trace based tools.)

Memory performance
vmstat
svmon
ps -o fields
topas
ipcs -m 

Network I/O performance
[ent|tok|fddi|atm]stat
netstat
netpmon†
topas -E 

Also Read: Storage Area Network (SAN) Basic Free Tutorials

Disk I/O performance
iostat
fcstat
lvmstat
filemon†
fileplace
topas -D 

Application performance
truss
probevue
tprof†
svmon -P pid
ps -o fields -p pid
topas

The ~ character toggles to nmon-mode in topas 

Other performances
Check for disk stat history collection
 lsattr -HEl sys0 -a iostat

Enable historical disk statistic collection
 chdev -l sys0 -a iostat=true

Also Read: AIX Scenario based questions

AIX Commands to monitor Memory and Paging space

  • List size, summary, and paging activity by paging space
                  lsps -a
  • List summary of all paging space
                  lsps -s
  • List the total amount of physical RAM in system
                 lsattr -El sys0 -a realmem
  • Create a new paging device on rootvg of 64 PPs
                 mkps -a -s 64 -n rootvg
  • Extend the existing paging space by 8 PPs
                chps -s 8 hd6

Logical Volume Manager (LVM) basic commands

  • Put a PVID on a disk
                     chdev -l hdisk1 -a pv=yes
  • PVIDs are automatically placed on a disk when added to a VG Remove a PVID from a disk
                     chdev -l hdisk1 -a pv=clear
  • List all PVs in a system (along) with VG membership
                      lspv
  • Create a VG called datavg using hdisk1 using 64 Meg PPs
                      mkvg -y datavg -s 64 hdisk1
  • Create a LV on (previous) datavg that is 1 Gig in size
                      mklv -t jfs2 -y datalv datavg 16
  • List all LVs on the datavg VG
                      lsvg -l datavg
  • List all PVs in the datavg VG
                       lsvg -p datavg
  • Take the datavg VG offline
                       varyoffvg datavg
  • Remove the datavg VG from the ODM
                      exportvg datavg

Also Read: Storage Area Network (SAN) Basic Free Tutorials
  • Import the VG on hdisk5 as datavg
                     importvg -y datavg hdisk5
  • Vary-on the new datavg VG (can use importvg -n)
                    varyonvg datavg
  • List all VGs (known to the ODM)
                      lsvg
  • List all VGs that are on line
                      lsvg -o
  • Check to see if underlying disk in datavg has grown in size
                    chvg -g datavg
  • Move a LV from one PV to another
                    migratepv -l datalv01 hdisk4 hdisk5
  • Delete a VG by removing all PVs with the reducevg command.
                   reducevg hdisk3 (-d removes any LVs that may be on that PV)

Types of AIX error logs and commands to query the error logs

The error logging process begins when an operating system module detects an error.The error-detecting segment of code then sends error information to either the errsave kernel service and errlast kernel service for pending system crash or the errlog subroutine to log an application error, where the information is, in turn, written to the /dev/error special file. This process then adds a time stamp to the collected data. The errdemon daemon constantly checks the /dev/error file for new entries, and when new data is written, the daemon conducts a series of operations.

Before an entry is written to the error log, the errdemon daemon compares the label sent by the kernel or application code to the contents of the error record template repository. If the label matches an item in the repository, the daemon collects additional data from other parts of the system.

To create an entry in the error log, the errdemon daemon retrieves the appropriate template from the repository, the resource name of the unit that detected the error, and detailed data. Also, if the error signifies a hardware-related problem and hardware Vital Product Data (VPD) exists, the daemon retrieves the VPD from the Object Data Manager (ODM). When you access the error log, either through SMIT or with the errpt command, the error log is formatted according to the error template in the error template repository and presented in either a summary or detailed report.

Also Read: Storage Area Network (SAN) Basic Free Tutorials

The system administrator can look at the error log to determine what caused a failure, or to periodically check the health of the system when it is running. There are different types of error logs in AIX operating system 
  • alog - have error logs about boot, console messages, NIM and others
  • errlog - have error logs about hardware, kernel, and some apps
  • syslog - have error logs about Internet dameons, and apps

Examples on how to query these error log details


  • Display the contents of the boot log

                 alog -o -t boot
  • Display the contents of the console log
                   alog -o -t console
  • List all log types that alog knows
                   alog -L
  • Display the contents of the system error log
                  errpt (Add -a or -A for varying levels of verbosity)
  • Clear all errors up until x days ago. 
                 errclear x
  • List info on error ID FE2DEE00 (IDENTIFIER column in errpt output) 
                    errpt -aDj FE2DEE00
  • Put a “tail” on the error log
                   errpt -c
  • List all errors that happened today
                   errpt -s ‘date +%m%d0000%y‘
  • To list all errors on hdisk0
                    errpt -N hdisk0
  • To list details about the error log
                     /usr/lib/errdemon -l
  • To change the size of the error log to 2 MB
                   /usr/lib/errdemon -s 2097152 
  • To display information about errors in the error log file in detailed format
                      errpt -a
  •   In AIX 5L Version 5.1, the errpt command now supports an intermediate output format by using the -A flag,
                      errpt -A -j identifier
               Where identifier is the eight digit hexadecimal unique error identifier.

Also Read: AIX Scenario based questions
  •    To display a detailed report of all errors logged for a particular error identifier,
                         errpt -a -j identifier
                Where identifier is the eight digit hexadecimal unique error identifier.
  •   To clear all entries from the error log, enter the following command:
                           errclear 0
  •  To stop error logging, enter the following command:
                         usr/lib/errstop
  •   To start error logging, enter the following command:
                          /usr/lib/errdemon
  • To list the current setting of error log file and buffer size and duplicate information 
                          /usr/lib/errdemon -l

If you want to change the buffer size and error log file size, you can use the errdemon command. 

Network Configuration commands in AIX

In IBM AIX operating System, entX is the physical device. It is associated with physical layer settings such as link speed, and duplex. enX and etX determine the frame type run on entX . IP addresses are configured on enX (Standard Ethernet) or etX (802.3). In a typical AIX network configuration only enX is used.

The examples here assume that the default TCP/IP configuration (rc.net) method is used. If the alternate method of using rc.bsdnet is used then some of these examples may not apply.

Also Read:  AIX Basic concepts and commands
  • Determine if rc.bsdnet is used over rc.net 
                     lsattr -El inet0 -a bootup option
  • TCP/IP related daemon startup script
                      /etc/rc.tcpip
  • To view the route table
                        netstat -r
  • To view the route table from the ODM DB
                      lsattr -EHl inet0 -a route
  • Temporarily add a default route
                       route add default 192.168.1.1
  • Temporarily add an address to an interface
                      ifconfig en0 192.168.1.2 netmask 255.255.255.0
  • Temporarily add an alias to an interface
                    ifconfig en0 192.168.1.3 netmask 255.255.255.0 alias
  • To permanently add an IP address to the en1 interface
                  chdev -l en1 -a netaddr=192.168.1.1 -a netmask=0xffffff00
  • Permanently add an alias to an interface
                   chdev -l en0 -a alias4=192.168.1.3,255.255.255.0
  • Remove a permanently added alias from an interface
                   chdev -l en0 -a delalias4=192.168.1.3,255.255.255.0

Also Read: AIX Scenario based questions
  • List ODM (next boot) IP configuration for interface
                    lsattr -El en0
  • Permanently set the hostname
                    chdev -l inet0 -a hostname=tsmserver
  • List networking devices
                       lsdev -Cc tcpip
  • List Network Interfaces
                          lsdev -Cc if
  • List attributes of inet0
                          lsattr -Ehl inet0
  • List (physical layer) attributes of ent0
                           lsattr -El ent0
  • List (networking layer) attributes of en0
                          lsattr -El en0
  • Set (desired) speed is found through the entX device
                       lsattr -El ent0 -a media speed
  • Find actual (negotiated) speed, duplex, and link
                entstat -d ent0 ----- The interface must be up (ifconfig en0 up) for stats to be valid
  • Set the ent0 link to Gig full duplex
           chdev -l ent0 -a media speed=1000 Full Duplex -P
                 Auto Negotiation is another option
  • Turn off Interface Specific Network Options
                   no -p -o use isno=0
  • Get (long) statistics for the ent0 device (remove -d for shorter results) 
                entstat -d ent0 ⇐or⇒ netstat -v ent0 
         The results of entstat vary by device type. Virtual, physical, and IVE (LHEA) devices all produce different results.
  • List all open, and in use TCP and UDP ports
                    netstat -anf inet
  • List all LISTENing TCP ports
                     netstat -na | grep LISTEN
  • Remove all TCP/IP configuration from a host
                       rmtcpip
  • Flush the netcd DNS cache
                       netcdctrl -t dns -e hosts -f
  • Hostname lookup order is determined using 
                    /etc/irs.conf, /etc/netsvc.conf and then $NSORDER. 
             irs.conf and $NSORDER are typically not used.
  • IP packets can be captured using 
                     iptrace / ipreport or tcpdump