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, HMC, System Admin

HMC Access & Security Issues

As of Hardware Management Console (HMC) Release 3, Version 2.3, the rexec command is no longer available on the HMC. Use ssh command instead. From Version 2.5, users are required to enter a valid HMC user id/password when downloading the WebSM client from the HMC. The URL for the WebSM client is: http://[HMC fully qualified domain name]/remote_client.html.

Standard users receive the restriced shell via a set -r in .mysshrc when logging in. Comment the set -r command in /opt/hsc/data/ssh/hmcsshrc to get rid of the restricted shell for your users (it gets copied to $HOME/.mysshrc). For more information on commands that can be used in restriced shell on the HMC, go to HMC Power 4 Hints & Tips.

A special hscpe user ID can be created which has unrestricted shell access via the pesh command. Use lshmc -v to determine the serial number of the HMC (after *SE). Then call IBM support and request for the password of the hscpe user for the pesh command. IBM is able to generate a password for the hscpe user for one day.

Topics: AIX, System Admin

Control-M

When exchanging text files between Windows and AIX systems, you often run into ^M (CTRL-M) characters at the end of each line in a text file. To remove these ugly characters:

tr -d '^M' < [inputfile] > [outputfile]
To type the ^M character on the command line: press CTRL, then type v and the m.

Another way: download this zip archive: controlm.zip (1KB).

This zip archive includes 2 files: unix2dos and dos2unix, which you can run on AIX:

To convert a Windows file to Unix file:
# dos2unix [filename]

Topics: AIX, System Admin

Centralized shell history

It's a good idea to centralize the shell history files for ease in tracking the actions done by the users:

Create a ${hist_dir}. Add the following lines to the /etc/profile file:

export HISTFILE=/${hist_dir}/${LOGNAME}_`date "+%Y%m%d_%H%M%S"`
export HISTSIZE=2000

Topics: AIX, System Admin

FTP umask

A way to change the default 027 umask of ftp is to change the entry in /etc/inetd.conf for ftpd:

ftp stream tcp6 nowait root /usr/sbin/ftpd -l -u 117
This will create files with umask 117 (mode 660). Using the -l option will make sure the FTP sessions are logged to the syslogd. If you want to see these FTP messages in the syslogd output, then you should add to /etc/syslog.conf:
daemon.info [filename]

Topics: AIX, System Admin

Sending attachments from AIX

How do you send an attachment via e-mail from AIX to Windows? Uuencode is the answer:

# uuencode [source-file] [filename].b64 | mail -v -s "subject" [email-address]
For example:
# uuencode /etc/motd motd.b64 | mail -v -s "Message of the day" email@hostname.com
The .b64 extension gets recognized by Winzip. When you receive your email in Outlook, you will have an attachment, which can be opened by Winzip (or any other unzip tool).

You can combine this into a one-liner:
# ( echo "This is the body";uuencode /etc/motd motd.b64 ) | mail -s "This is the subject" email@hostname.com
If you want to attach tar of gzip images to an e-mail, you can also simply use those extensions to send through email, as these extensions are also properly recognized by Winzip:
# uuencode file.tar file.tar | mailx -s "subject" email@hostname.com
# uuencode file.tar.gz file.tar.gz | mailx -s "subject" 
email@hostname.com

Topics: AIX, Red Hat / Linux

Line numbers in VI

To display line numbers in VI: Press ESC, then type

:set number
To remove the line numbers again, type
:set nonumber

Topics: AIX, System Admin

DLpar with DVD-ROM

Adding a DVD-ROM with DLpar is very easy. Removing however, can be somewhat more difficult, especially when you've run cfgmgr and devices have been configured. This is how to remove it. Remove all cdrom devices found with lsdev -Cc cdrom:

# rmdev -dl cd0
# rmdev -dl ide0
Then remove all devices found with:
# lsdev -C | grep pci
All PCI devices still in use, can't be removed. The one not in use, is the PCI device where the DVD-ROM drive on was configured. You have to remove it before you can do a DLPAR remove operation on it. Now do your DLPAR remove operation.

Topics: AIX, System Admin

Defunct processes

Defunct processes are commonly known as "zombies". You can't "kill" a zombie as it is already dead. Zombies are created when a process (typically a child process) terminates either abnormally or normally and it's spawning process (typically a parent process) does not "wait" for it (or has yet to "wait" for it) to return an exit status.

It should be noted that zombies DO NOT consume any system resources (except a process slot in the process table). They are there to stay until the server is rebooted.

Zombies commonly occur on programs that were (incompletely) ported from old BSD systems to modern SysV systems, because the semantics of signals and/or waiting is different between these two OS families.

See: http://www.hyperdictionary.com/dictionary/zombie+process

Topics: AIX, System Admin

Montoring a system without logging in

Let's say you have a helpdesk, where they must be able to run a script under user-id root to check or monitor a system:

First, create a script, you wish your helpdesk to run.

Modify your /etc/inetd.conf file and add:

check stream tcp wait root /usr/local/bin/script.sh
Where script.sh is the script you've written.

Modify your /etc/services file and add:
check 4321/tcp
You may change the portnumber to anything you like, as long as it's not in use.

Now, you may run:
# telnet [system] 4321
And your script will be magically run and it's output displayed on your screen. If the output of the script isn't displayed on your screen very long, just put a sleep command at the end of your script.

Topics: AIX, HMC, Logical Partitioning

Lpar tips

The uname -Ls command will show you the partition number and the partition (lpar) name. When setting the resource allocation for a partition profile, set the minimum to the absolute bare minimum, and set the maximum as high as possible.

For memory there are special considerations:

  • If you set the maximum too low and you wish to exceed above the maximum amount of memory defined in the active profile, you can't simply adjust the profile and put extra memory in via DLPAR, because the LPAR has been initialized with a certain page table size, based on the maximum amount of memory setting. Therefore, a reboot will be required when you wish to use more memory than defined in the active profile. If you do try it however, you'll receive the following error:
    HMCERRV3DLPAR018: There is no memory available for dynamic logical partioning on this partition.
  • If you set the maximum too high, the partition will be initialize with a large page table size, which uses too much memory for overhead, which you might never use.

Number of results found for topic AIX: 231.
Displaying results: 201 - 210.