Tech Blog

These are blog entries written by the UNIX Health Check development team. Our team has extensive technical experience on both AIX and Red Hat systems, and we like to share our knowledge with our visitors.

Topics: AIX, System Admin

Proper vmstat output

Often when you run vmstat, the output may be looking very disorganized, because of column values not being shown properly under each row. A very simple solution to this issue is to run the same command with the "-w" flag, which will provide you with a wide vmstat output:

# vmstat -w

Topics: AIX, System Admin

Changing maxuproc requires a reboot?

When you change MAXUPROC (Maximum number of processes allowed per user), the smitty help panel will tell you that changes to this operating system parameter will take effect after the next system reboot.

This is wrong Help information. The change takes effect immediately, if MAXUPROC is increased. If it is decreased, then it will take effect after the next system reboot.

This help panel text from smitty will be changed in AIX 5.3. APAR IY52397.

Topics: AIX, System Admin

Automatic FTP

How to do an automatic FTP from within a script:

  • -n prevents automatic login and -v puts it in verbose mode
  • asciorbin_Type should be set to either ascii or binary
  • grep for $PHRASE (particular return code) from $LOGFILE to determine success or failure
ftp -nv $REMOTE_MACHINE < $LOGFILE 
user $USER_NAME $USER_PASSWORD 
$asciorbin_Type 
cd $REMOTE_PATH 
put $LOCAL_FILE $REMOTE_FILE 
quit 
! 
grep $PHRASE $LOGFILE 

Topics: AIX, Storage, System Admin

Finding and removing core dumps

Use the following command to interactively find and remove core dumps on your system:

# find / -name core -exec file {} \; -exec rm -i {} \;

Topics: AIX, System Admin

How much paging space is this process using?

To discover the amount of paging space a proces is using, type:

# svmon -wP [proces-id]
Svmon shows you the amount of memory in 4KB blocks.

Topics: AIX, System Admin

Kill all processes of a specific users

To kill all processes of a specific user, enter:

# ps -u [user-id] -o pid | grep -v PID | xargs kill -9
Another way is to use who to check out your current users and their terminals. Kill all processes related to a specific terminal:
# fuser -k /dev/pts[#]
Yet another method: Su to the user-id you wish to kill all processes of and enter:
# su - [user-id] -c kill -9 -1

Topics: AIX, System Admin

Searching large amounts of files

Searching with grep in directories with large amounts of files, can get the following error:

The parameter list is too long
The workaround is as follows:
# ls | xargs grep "[search string]"
E.g.
# ls | xargs grep -i "error"

Topics: AIX, System Admin

Logical versus Physical directory using PWD

The pwd command will show you default the logical directory (pwd -L = default), which means, if any symbolic links are included in the path, that is, what will be shown. To show you the actual physical directory, use the next undocumented feature:

# pwd -P

Topics: AIX, System Admin

TCPdump/IPtrace existing files?

When you receive an error like:

Do not specify an existing file
when using iptrace or tcpdump, then this is probably caused by a kernel extension already loaded.
To resolve this, run:
# iptrace -u
After this, the kernel externsion is removed and iptrace or tcpdump will work again.

Topics: AIX, Networking, System Admin

ICMP packets from an AIX system

Where did all these routes come from & why is my system sending ICMP packets every 10 minutes? This is caused by path MTU discovery. If your AIX system is sending ICMP packets, you can disable it:

AIX has a feature called path MTU discovery which is based on ICMP packets in order to learn MTU sizes on the LAN. Path MTU discovery is a way of finding out the maximum packet size that can be sent along a network using ICMP packets and is enabled on AIX by default. This is done to avoid IP fragmentation on heterogenous networks (ie, an ATM network connected to an ethernet network) and is described in RFC 1191.

# no -a | grep discover
will show you whether tcp_pmtu_discover and udp_pmtu_discover are enabled (1) or disabled (0). Disable them with:
# no -p -o tcp_pmtu_discover=0
# no -p -o udp_pmtu_discover=0
If these are disabled, you shouldn't see any ICMP messages any more.

When one system tries to optimize its transmissions by discovering the path MTU, a pmtu entry is created in a Path MTU (PMTU) table. You can display this table using the pmtu display command. To avoid the accumulation of pmtu entries, unused pmtu entries will expire and be deleted when the pmtu_expire time (no -o pmtu_expire) is exceeded; default after 10 minutes.

Number of results found: 470.
Displaying results: 311 - 320.