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

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.

Topics: AIX, System Admin

Find large files

How do you find really large files in a file system:

# find . -size +1024 -xdev -exec ls -l {} \;
The -xdev flag is used to only search within the same file system, instead of traversing the full directory tree. The amount specified (1024) is in blocks of 512 bytes. Adjust this value for the size of files you're looking for.

Topics: AIX, System Admin

Creating graphs from NMON

Here's how: (This has been tested this with Nmon version 9f, which you can download here):

  • Run nmon -f for a while. This will create nmon output files *.nmon in your current directory.
  • Make sure you've downloaded rrdtool.
  • Install rrdtool by unpacking it in /usr/local/bin.
  • Make sure directory /usr/local/bin is in your $PATH:
    # export PATH="$PATH:/usr/local/bin"
  • Create a directory for the output of the graphs:
    # mkdir output
  • Run the nmon2rrdv9 tool (found in the nmon download):
    # ./nmon2rrdv9 -f [nmon output file] -d ./output -x
  • In directory output an index.html and several gif files will be created. By accessing index.html in a web browser, you can view the graphs. For a sample, click here. Tip: use nweb as your web browser.

Number of results found for topic AIX: 231.
Displaying results: 191 - 200.