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
Use the following command to interactively find and remove core dumps on your system:
# find / -name core -exec file {} \; -exec rm -i {} \;
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.
To kill all processes of a specific user, enter:
# ps -u [user-id] -o pid | grep -v PID | xargs kill -9Another 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
Searching with grep in directories with large amounts of files, can get the following error:
The parameter list is too longThe workaround is as follows:
# ls | xargs grep "[search string]"E.g.
# ls | xargs grep -i "error"
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
When you receive an error like:
Do not specify an existing filewhen using iptrace or tcpdump, then this is probably caused by a kernel extension already loaded.
To resolve this, run:
# iptrace -uAfter this, the kernel externsion is removed and iptrace or tcpdump will work again.
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 discoverwill 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=0If these are disabled, you shouldn't see any ICMP messages any more.
# no -p -o udp_pmtu_discover=0
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.
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.


