Tips & Tricks

  • May 2020
  • PDF

This document was uploaded by user and they confirmed that they have the permission to share it. If you are author or own the copyright of this book, please report to us by using this DMCA report form. Report DMCA


Overview

Download & View Tips & Tricks as PDF for free.

More details

  • Words: 1,773
  • Pages: 8
How to mirror an AIX rootvg The following steps will guide you trough the mirroring of an AIX rootvg. This info is valid for AIX 4.3.3, AIX 5.1, AIX 5.2 and AIX 5.3. • • • •



Make sure you have an empty disk, in this example its hdisk1 Add the disk to the vg via "extendvg rootvg hdisk1 Mirror the vg via: "mirrorvg rootvg" Adapt the bootlist to add the current disk, the system will then fail to hdisk1 is hdisk0 fails during startup o do bootlist -o -m normal o this will list currently 1 disk, in this exmaple hdisk0 o do bootlist -m normal hdisk0 hdisk1 Run a bosboot on both new disks, this will install all software needed for boot on the disk o bosboot -ad hdisk0 o bosboot -ad hdisk1

AIX performance tips and tricks The following commands can be used in order to debug performance problems on an AIX machine. This info is valid for AIX 4.3.3, AIX 5.1, AIX 5.2 and AIX 5.3.

Nmon tools nmon performance -- free tool to analyze AIX performance This free tool gives you a huge amount of information all on one screen. Even though IBM doesn't officially support the tool and you must use it at your own risk, you can get a wealth of performance statistics. Why use five or six tools when one free tool can give you everything you need? The tool can be found here. nmon analyser -- free tool to produce AIX performance reports This free tool is designed to take files produced by the NMON performance tool and turn them into spreadsheets containing high quality graphs ready to cut and paste into performance reports. The tool also produces analyses for ESS and EMC subsystems. It is available for both Lotus 1-2-3 and Microsoft Excel. The tool can be found here.

Determine your AIX level oslevel -r

[root@sys /] oslevel -r 5100-07 [root@sys /]

Determine the load of your system By executing uptime, you get the load on your system. The load indicates the amount of programs that are being executed @ the same time. [root@sys /] uptime 04:19PM up 62 days, 8.77 [root@sys /]

1:57,

3 users,

load average: 12.26, 11.86,

Determine the cpu usage (user/sys/idle/wait) Use the command vmstat 10 10. [root@sys /] vmstat 10 10 kthr memory page faults cpu ----- ----------- ------------------------ ------------ ----------r b avm fre re pi po fr sr cy in sy cs us sy id wa 4 1 257816 2166 0 0 0 315 287 0 615 10202 1030 9 19 51 22 8 1 257579 2412 0 0 0 147 1407 0 588 32601 1745 17 81 1 1 11 1 259625 171 0 0 0 494 10911 0 647 31634 1440 18 82 0 0 11 1 259720 270 0 0 0 281 2413 0 593 34101 1652 21 79 0 0 11 1 259282 555 0 0 0 246 2619 0 669 33614 1814 16 84 0 0 ... [root@sys /]

Determine the memory/swap usage of an AIX system Use the commands svmon and lsps.

[root@sys /] lsps -a Page Space Physical Volume Volume Group Auto Type hd6 hdisk0 rootvg yes lv [root@sys /] svmon size inuse free memory 262128 260139 288 pg space 196608 91566 work pin 66609 in use 228672 [root@sys /]

pers 0 7884

Size

%Used

Active

768MB

47

yes

clnt 0 23583

pin 66603

virtual 258643

lpage 0 0

Svmon uses frames, multiply every frame by 1024 to get the size in bytes. Also be sure to install the packages bos.perf.tools in order to get svmon work.

Determine the IO load on your systems disks Use the command iostat, do know thet the first entry is the entry since boot.

[root@sys /] lslpp -w /usr/bin/svmon File Fileset Type --------------------------------------------------------------------------/usr/bin/svmon bos.perf.tools File [root@sys /] iostat 5 2

tty: iowait 21.6

tin

tout

0.1

4.8

Disks: hdisk1 hdisk0 cd0

% tm_act 1.6 1.8 0.0

avg-cpu:

tty: iowait 0.0

Kbps 16.4 16.9 0.0

tin

tout

0.0

135.2

Disks: hdisk1 hdisk0 cd0 [root@sys /]

% sys

% idle

8.7

18.5

51.2

tps 3.5 3.7 0.0

avg-cpu:

% tm_act 0.0 2.4 0.0

% user

Kbps 0.0 15.2 0.0

Kb_read 6873724 10202425 0

Kb_wrtn 81062953 80417825 0

% user

% sys

% idle

17.4

82.6

0.0

tps 0.0 3.4 0.0

%

Kb_read 0 76 0

%

Kb_wrtn 0 0 0

If you get as output: [root@sys /] iostat tty: iowait 21.6

tin

tout

0.1

4.8

avg-cpu:

% user

% sys

% idle

8.7

18.5

51.2

" Disk history since boot not available. " [root@sys /]

you have to activate iostat counters by typing the following command: •

/usr/sbin/chdev -l sys0 -a "iostat=true"

AIX temperature sensors By executing the command /usr/lpp/diagnostics/bin/uesensor, you can, on supported platform, get the fan speeds and temperature of your system: [root@sys 3 0 11 31 9001 0 11 9001 1 11 9001 2 11 9001 3 11 9002 0 11 9002 1 11 9002 2 11 9002 3 11 9004 0 11 9004 1 11 9004 2 11

/] /usr/lpp/diagnostics/bin/uesensor -a P1 2100 F1 2760 F2 1890 F3 1890 F4 5129 P1 3129 P1 5129 P1 12077 P1 3 P3-V1 3 P3-V2 3 P3-V3

[root@sys /]

%

How to clean an AIX wtmp log file (/var/adm/wtmp) This document explains how you can reduce the size of wtmp in a GOOD way This info is valid for AIX 4.3.3, AIX 5.1, AIX 5.2 and AIX 5.3. Cleaning of wtmp on AIX is not done by "echo >/var/adm/wtmp". There are 2 supported ways to clean wtmp: • •

cp /dev/null /var/adm/wtmp format /var/adm/wtmp to ASCII text, clean the 'bogus' entrys and convert it back to wtmp format, you can do this by using the tool fwtmp: o be sure /tmp has enough space o convert the wtmp to ASCII --> /tmp/dummy.file o /usr/sbin/acct/fwtmp /tmp/dummy.file o edit the file /tmp/dummy.file via "grep -v" or just plain vi o convert the ASCII output back -->/var/adm/wtmp o /usr/sbin/acct/fwtmp -ic /var/adm/wtmp

How to configure AIX syslogd (/etc/syslog.conf) The following steps will guide you trough configuring syslog on an AIX system. This info is valid for AIX 4.3.3, AIX 5.1, AIX 5.2 and AIX 5.3. By default, an AIX system will not do syslog'ging. For a strange reason, the default install on an AIX install will not place entry's in /etc/syslog.conf, leaving a totl userless syslogd. Even more, comparing the syslogd on AIX to another Unix, (ex: Linux), you will notice that .* doesn't work. So make sure that your priority level is never *. Comming from a Linux world, you most probably want the following config: mail.debug user.debug kern.debug syslog.debug daemon.debug

/var/log/mail /var/log/user /var/log/kern /var/log/syslog /var/log/daemon

auth.debug local2.debug

/var/log/secure /var/log/sudo

As AIX standard has no logrotate daemon running, you want to adapt syslogd todo the rotating on his own, an example would be: mail.debug /var/log/mail rotate size 100k files 4 # 4 files, 100kB each user.debug /var/log/user rotate files 12 time 1m # 12 files, monthly rotate kern.debug /var/log/kern rotate files 12 time 1m compress # 12 files, monthly rotate, compress ...

When adaptions are made to /etc/syslog.conf, make sure to restart syslogd. [root@sys /] refresh -s syslogd 0513-095 The request for subsystem refresh was completed successfully. [root@sys /]

How to configure AIX to use LDAP authentication The doc will guide you trough websites you can use to adapt AIX to use LDAP authentication. This info is valid for AIX 4.3.3, AIX 5.1, AIX 5.2 and AIX 5.3. mksecldap command LDAP Authentication Load Module Make sure that if you use AIX systems <5.2, you'll need to setup an AIX schema. This also means that systems <5.2 cannot auth. against an OpenLDAP server doing auth. for multiple platforms, you'll need the AIX schema in the OpenLDAP server. RFC2307 is implemented from AIX5.2 onwards.

How to create an AIX LPP / BFF package This page will explain you HOWTO create an AIX LPP / BFF package This info is valid for AIX 4.3.3, AIX 5.1, AIX 5.2 and AIX 5.3. To start with, you'll need the mklpp package from Bull. You can find the tool here. A mirror you can find here. Install this package via the smitty interface: • •

chmod +x bull.mklpp-1.2.9.0.exe ./bull.mklpp-1.2.9.0.exe

• •

inutoc . smitty install_all

Make a lv volume lvlpp and make a filesystems on it. Mount this filesystem under /lppdir. Create following directory's under /lppdir: bff, in, lpp, out, and build: • •

cd /lppdir mkdir bff in lpp out build

Example package build: zlib First we create the build env: • •

mkdir /lppdir/lpp/zlib mkdir /lppdir/build/zlib

Download the source of zlib and place it in /lppdir/build/zlib • • • • •

cd /lppdir/build/zlib wget http://www.zlib.net/zlib-1.2.2.tar.gz (can change) gunzip zlib-1.2.2.tar.gz tar -xvf zlib-1.2.2.tar ln -s zlib-1.2.2 zlib

Be sure to change the umask to 022, so your install directory is ok. (umask 022) Adapt the path and add /usr/local/bin to it. (export PATH=$PATH:/usr/local/bin) Run the compille instructions for zlib: • • •

cd /lppdir/build/zlib/zlib ./configure make

Install zlib in a changed root env: •

make install prefix=/lppdir/lpp/zlib/usr/local

Make the lpp subdirs for the package •

mkdir /lppdir/lpp/zlib/usr/lpp

Pick a name for your package, take for exmaple: freeware.zlib Make the lpp subdir for your package: •

mkdir /lppdir/lpp/zlib/usr/lpp/freeware.zlib

Go into the directory /lppdir/lpp/zlib and create the lpp_name file: 4 R I freeware.zlib { freeware.zlib.rte 1.2.1.1 01 N U en_US Zlib, Data compression library [ *prereq bos.net.tcp.client v=4 r>1 % INSTWORK 70 70 % % % % ] }

You will have to place the version in there(1.2.1.1) the name of the package (freeware.zlib / freeware.zlib.rte) and an explanation (Zlib, Data compression library). If needed, you can place prereq's. All other fields will be auto generated. Make the .info subdir and create the copyright file: • •

mkdir /lppdir/lpp/zlib/.info touch /lppdir/lpp/zlib/.info/freeware.zlib.rte.copyright (you can add whatever you want in this file)

Now you can build your package by doing: • •

cd /lppdir/lpp/zlib mklpp

[root@sys /lppdir/lpp/zlib] mklpp rm -f .info/freeware.zlib.rte.al rm -f .info/freeware.zlib.rte.size rm -f .info/freeware.zlib.rte.inventory rm -f .info/backup_files rm -f usr/lpp/freeware.zlib/liblpp.a rm -f usr/lpp/freeware.zlib/inst_root/liblpp.a rm -f .info/liblpp.a rm -f //lppdir/out/zlib-1.2.1.1.bff //lppdir/out/zlib1.2.1.1.bff.asc \ //lppdir/zip/zlib-1.2.1.1.exe //lppdir/bff/zlib1.2.1.1.bff \ //lppdir/bff/zlib-1.2.1.1.bff.asc No freeware.zlib.rte.al, applying logic to the problem... No size file, try this for size... No inventory file, inventing it... No cfgfiles script, no pre-configured option, forget it Making .info/liblpp.a archive No root part to make Making list of files to backup Updating lpp_name Making installp format distribution on //lppdir/out/zlib-1.2.1.1.bff

Target "all" is up to date. [root@sys /lppdir/lpp/zlib]

Do note that mklpp automaticly create post and pre scripts for install and de-install in the .info/. You can add extra commands in these scripts for your own purpose

Related Documents

Tips & Tricks
May 2020 8
Tips & Tricks
June 2020 9
Tips&tricks
June 2020 13
Tips & Tricks
December 2019 27
Tips And Tricks
November 2019 33