Translate

Wednesday, 20 August 2014

Remember to include a disclaimer in your herald

Many people forget to change the default "Welcome to AIX" login message, and message of the day and leave themseleves open to attackers claiming that they did not know this was a private system.

You should always change both the "/etc/security/login.cfg" and "/etc/motd" files because one is displayed before you login, and the other after you login.

# chsec -f /etc/security/login.cfg -s default -a herald="This is a private system\n\rLogin: "

If you are using Secure Shell:

1. create a login banner file.

# vi /etc/ssh/sshd-banner

2. Edit the sshd_config file.

# vi /etc/sshd/sshd_config

3. Add/edit the following line:

Banner /etc/ssh/sshd-banner
4. Restart the SSH daemon

# stopsrc -s sshd ; startsrc –s sshd

Tuesday, 19 August 2014

An interesting book?

I have just finished reading the book "The decline and fall of IBM an American Idol".

It gives a very interesting account of the way in which IBM has changed since the days of the Watson dynasty, and highlights many of the problems faced by it today. I have to say that whilst I do agree with much of what the author says, I think that the second half of the book, which is little more than a collection of anonymous email rants is a bit tedious.

For those of you with a Kindle or the program on your laptop or tablet, you can find it here:
http://www.amazon.co.uk/Decline-Fall-IBM-American-Icon-ebook/dp/B00KRHWZ22/


Monday, 18 August 2014

A simpler alternative HMC management interface

This project provides a simpler alternative command-line and menu-driven interface for managing your HMC: http://ezh.sourceforge.net/

Sunday, 17 August 2014

An interesting alternative to DSH

ClusterSSH is a graphical cluster administration tool that runs from your Linux graphical desktop. Once you install the RPMs, share your pulic SSH keys, and define a cluster in "/etc/clusters", you can enter a command in the central console and it will be run siumultaneously on all the clients.

The software is a little quirky at present because you see all the terminals open on the desktop and the results appear on each screen as it is executed, however later versions may improve on this.

For more details and installation instructions see: http://www.unixmen.com/clusterssh-manage-multiple-ssh-sessions-on-linux/

This utility could help act as an AIX to Linux migration aid?

Wednesday, 13 August 2014

Using Splitvg to make backups

If you need to backup a logical volume or volume group with the minimum amount of downtime the easiest way is to mirror it and then create a snapshot as follows:

mirrorvg [ -S | -s ] [ -Q ] [ -c copies] [ -m ] [ -p copyn=mirrorpool ] volumegroup [ physicalvolume ... ]

Now split off a copy of the mirror using the splitvg command

splitvg  [ -y SnapVGname ]  [ -c  Copy ] [ -f  ] [ -i ]  VGname
This splits a single mirror copy of a fully mirrored volume group into a snapshot volume group. The original volume group VGname will stop using the disks that are now part of the snapshot volume group SnapVGname.

This method can also be used to split-off copies of one or more logical-volumes.


Splitting copies of a logical volume

The splitlvcopy command splits copies from one logical volume and creates a new and separate logical volume from them. The general syntax of the splitlvcopy command is as follows:

splitlvcopy [ -f ] [ -y NewLogicalVolumeName ] [ -Y Prefix ] LogicalVolume
Copies [ PhysicalVolume ... ]

To split one copy of each logical partition belonging to the logical volume named
“oldlv” which currently has 3 copies of each logical partition, and create the logical volume “newlv”, use the splitlvcopy command as follows:

# splitlvcopy -y newlv oldlv 2

Each logical partition in the logical volume “oldlv” now has two physical partitions.
Each logical partition in the logical volume “newlv” now has one physical partition.

Mirroring is an LVM task that you perform only on logical volumes to migrate data. The following example shows how to create a mirror copy of a logical volume using the mklvcopy command:

# mklvcopy -e m -s y -k datalv 2 hdisk3 hdisk7
 .
 .
# splitlvcopy -y splitlv datalv 1



Importing a new Volume Group

Accidentally importing a disk that has a root volume group can have disasterous results on your AIX system because it renames the logical-volumes required to boot your system, therefore you should know something  about a disk or disks before you attempt to import them.

Here are some handy LVM commands that help you to see what is on a disk(s) without importing:

List the maximum number of logical volumes allowed in the VG
# lqueryvg -p PVname -N

Show the PP size ?
# lqueryvg -p PVname -s

Show the number of free PPs in the VG
# lqueryvg -p PVname -F

Show the current number of LVs in the VG
# lqueryvg -p PVname -n

List the current number of PVs in the VG
# lqueryvg -p PVname -c

Display the total number of VGDAs for the VG
# lqueryvg -p PVname -D

List each LVID, LV name, state for each logical volume
# lqueryvg -p PVname -l

List each PVID, number of VGDAs and state for each PV in the VG
# lqueryvg -p PVname -P

List all the attributes with tags for the vG
# lqueryvg -p PVname -At

Show a physical volume' VGID
# lqueryvg -p PVname -v

Move a physical partition
# lmigratepp -g VGID -p old_PVID -n old_PPNum -P new_PVID -N new_PPNum

Retrive the VG name for a particular LV from ODM
# getlvodm -b LVID

Retrive all configured PVs from ODM
# getlvodm -C

Retrive the major number for a VGID from ODM
# getlvodm -d VGID

Retrive the logical volume allocation characteristics for a LVID from ODM
# getlvodm -c LVID

Retrive the free configured PVs from ODM
# getlvodm -F

Retrive the strip size for a LVID from ODM
# getlvodm -F LVID

Retrive the PV name for a PVID from ODM
# getlvodm -g PVID

Retrive all VG names from the ODM
# getlvodm -h

Retrive the VGID for a PVID from ODM
# getlvodm -j PVID

Retrive the LVs and LVIDs for a VG name or VGID from ODM
# getlvodm -L VGDescriptor

Retrive the LVID/LV Name for a LV Name or LVID from ODM
# getlvodm -l LVDescriptor

Retrive the mount point for a LVID from ODM
# getlvodm -m LVID

Retrive the stripe width for a LVID from ODM
# getlvodm -N LVID

Retrive the PVID/PN name for a PV name or PVID from ODM
# getlvodm -p PVDesciptor

Retrive the PV names, PVIDs and VGs of all configured PVs from ODM
# getlvodm -P

Retrive the relocatable flag for a LVID from ODM
# getlvodm -r LVID

Retrive the VG state for a VG from ODM
# getlvodm -s VGDescriptor

Retrive the timestamp for a VG from ODM
# getlvodm -T VGDescriptor

Retrive the VG name for a VGID from ODM
# getlvodm -t VGID

Retrive the auto-on value for a VG name or VGID from ODM
# getlvodm -v VGDesciptor

Retrive the VGID for a vG name
# getlvodm -v VGDesciptor

Retrive the PV names and PVIDs for a VG from ODM
# getlvodm -w VGDesciptor

How to retrive the LV type for a LVID from ODM
# getlvodm -y LVID

How to retrive the concurrent capable flag for a VG from ODM
# getlvodm -X VGDescriptor

How to retrive the auto-on concurrent flag for a VG from ODM
# getlvodm -x VGDescriptor

Display the contents of LVCB
# getlvcb -A LVName

List the number of copies of a LV from LVCB
# getlvcb -c LVName

List the file system name of a LV from LVCB
# getlvcb -f LVName

List the label of a LV from LVCB
# getlvcb -L LVName
Display the type of the file system from LVCB
# getlvcb -t LVName

Display the upper limit from LVCB
# getlvcb -u LVName

Tuesday, 12 August 2014

AIX signals

Have you ever wondered what the kill signals do, well simply enter: kill -l for a list:

# kill -l
 1) HUP   14) ALRM     27) MSG       40) bad trap  53) bad trap
 2) INT   15) TERM     28) WINCH     41) bad trap  54) bad trap
 3) QUIT  16) URG      29) PWR       42) bad trap  55) bad trap
 4) ILL   17) STOP     30) USR1      43) bad trap  56) bad trap
 5) TRAP  18) TSTP     31) USR2      44) bad trap  57) bad trap
 6) LOST  19) CONT     32) PROF      45) bad trap  58) bad trap
 7) EMT   20) CHLD     33) DANGER    46) bad trap  59) bad trap
 8) FPE   21) TTIN     34) VTALRM    47) bad trap  60) GRANT
 9) KILL  22) TTOU     35) MIGRATE   48) bad trap  61) RETRACT
10) BUS   23) IO       36) PRE       49) bad trap  62) SOUND
11) SEGV  24) XCPU     37) bad trap  50) bad trap  63) SAK
12) SYS   25) XFSZ     38) bad trap  51) bad trap
13) PIPE  26) bad trap 39) bad trap  52) bad trap


AIX also has a killall command that any user can run to kill all of his or her processes. The syntax is:

# killall <-Signal>

To list all the signal actions defined for process 11928, enter:
 # procsig <Process>

HUP         caught
INT         caught
QUIT        caught
ILL         caught
TRAP        caught
ABRT        caught
EMT         caught
FPE         caught
KILL        default  RESTART
BUS         caught

..
..

To see the current working directory for a process:

# procwdx 88473628847362:        /home/root/



To display the current stack of process 11928, enter:

# procstack 11928
8847362: -ksh
0xd022da40  waitpid(??, ??, ??) + 0x1c0
0x1000945c  job_wait(??) + 0xfc
0x10029ef0  xec_switch(??, ??, ??, ??, ??) + 0x4d0
0x1002ba70  sh_exec(??, ??, ??) + 0x3f0
0x100016f8  exfile() + 0x498
0x100008ac  main(??, ??) + 0x58c
0x10000168  __start() + 0x68