Archive for category AIX

OpenSSL-1.0.0a on AIX v5.3


Well once again I find myself scrambling to get something done that was known but not well communicated during the project life-cycle.¬† So I need to update all managed AIX machines running v5.3 to include OpenSSL (openssl-1.0.0a to be exact) and once again my disdain for AIX rears it ugly head, which is represented by the Zombie to the left ūüôā¬† Aside from my personal dislike of the Korn shell… Maybe I am not being fair to AIX as I don’t really work in an AIX optimal environment, taking full advantage of all of the great tools they do have (NIM, clustering, SAN, etc…).¬† But managing them as 1-off’s just plain stinks.¬† Suffice it to say that I would NOT recommend deploying a stand-alone AIX server in any circumstance as you cannot realize anything near it’s full potential.¬† Anyway, here is what I did to rectify the issue at hand.

# Install SSL on AIX 5.3.0.0
# get the rpm.rte package on the system
mkdir /opt/ssl4AIX
cd /opt/ssl4AIX
installp -qacXgd rpm.rte rpm.rte
# Grab the other packages and put them on the AIX system
# http://www-03.ibm.com/systems/power/software/aix/linux/toolbox/download.html
rpm -ivh gcc-4.2.0-3.aix5.3.ppc.rpm
rpm -ivh libgcc-4.2.0-3.aix5.3.ppc.rpm
# Create a sym link – Check this first following RPM installs for correct PATHS
# find / -name libgcc_s.a
# /opt/freeware/lib/gcc/powerpc-ibm-aix5.3.0.0/4.2.0/ppc64/libgcc_s.a
# /opt/freeware/lib/gcc/powerpc-ibm-aix5.3.0.0/4.2.0/pthread/ppc64/libgcc_s.a
# /opt/freeware/lib/gcc/powerpc-ibm-aix5.3.0.0/4.2.0/pthread/libgcc_s.a
# /opt/freeware/lib/gcc/powerpc-ibm-aix5.3.0.0/4.2.0/libgcc_s.a
# Now make the link
ln -s /opt/freeware/lib/gcc/powerpc-ibm-aix5.3.0.0/4.2.0/libgcc_s.a /usr/lib/libgcc_s.a
#
gunzip openssl-1.0.0a.tar.gz
tar -xf openssl-1.0.0a.tar
cd openssl-1.0.0a
./Configure shared –prefix=/usr aix-gcc
make
make test
# If all goes well !!!
make install

Incidentally, you need an IBM account if you want to download these packages from http://www-03.ibm.com/systems/power/software/aix/linux/toolbox/download.html… LOL

That stinks as well ūüė¶

, , , , , , , , ,

1 Comment

AIX 5.1 mksysb…reliable-backup?


I hate to use the word ‘hate’ but I really ‘hate’ AIX.¬† Now it may be that I am just not a true expert and I don’t know enough about the OS to be fair, but that is my stance.¬† I have never had as much difficulty with any other OS as with AIX, any flavor.¬† In any event, I have to manage these system on a regular basis and one of the tasks I usually setup on the system in an automated backup to the often-times included internal tape drive (usually 4mm).¬† I had a system crash last week and I had to restore it from a rescue boot CD, which worked quite well, aside from the 14 times it took me to get the RS6000 to actually boot from the CD.¬†¬† So of course it lost a majority of it’s settings, all of my automation scripts being the topic for today.¬† I must admit that it is quite likely that I caused the issue in the first place by trying to mirror 3 drives in the rootvg, as a test of course, and it just never seemed to be the same after.¬† Even following a complete removal of the 3rd hdisk and all of its pointers… something just wasn’t right, until one morning it was just completely hosed.¬† So anyway, one of my complaints with AIX is that even within the same parent release levels; i.e. v5.1, v5.2, v5.3, the commands to not translate well if at all across them?¬† I have been wondering why I have not seen an email reporting on this systems backups… well of course I had a case incompatibility issue in my script that I took from a v5.2 system to use on this v5.1 system.¬† I have the tested and functional script below for use on an AIX v5.1 RS6000 server ūüôā

#!/usr/bin/ksh
#
typeset -r datetime=`date`
typeset -r date=`date +%Y%m%d`
typeset logfile=”/opt/proserve/logs/backup.$date.log”
typeset maillog=”/opt/proserve/logs/maillog.$date.log”
typeset errlog=”/opt/proserve/logs/errlog.$date.log”
. /opt/proserve/clientconfig
{
echo “\n” > $logfile
echo “===============================================================”
echo ”¬†¬†¬†¬†¬†¬†¬†¬†¬†¬†¬†¬†¬†¬†¬†¬†¬†¬†¬†¬†¬†¬† MKSYSB and System Report¬†¬†¬†¬†¬†¬†¬†¬†¬†¬†¬†¬†¬†¬†¬†¬†¬†¬†¬†¬† ”
echo ”¬†¬†¬†¬†¬†¬†¬†¬†¬†¬†¬†¬†¬†¬†¬†¬†¬†¬†¬†¬†¬†¬†¬†¬† for activities run¬†¬†¬†¬†¬†¬†¬†¬†¬†¬†¬†¬†¬†¬†¬†¬†¬†¬†¬†¬† ”
echo ”¬†¬†¬†¬†¬†¬†¬†¬†¬†¬†¬†¬†¬†¬†¬†¬†¬†¬†¬†¬† $datetime ”
echo “===============================================================”
echo “\nClient Information Section”
echo “——————————————-”
echo “\nCustomer – $clientname ”
echo “\nSystem status – `uptime`\n”
echo “Users currently logged into this system:”
echo “***NOTE*** – Any data changed on this system by users”
echo ”¬†¬†¬†¬†¬†¬†¬†¬†¬†¬†¬†¬† currently logged in will not be backed up!”
who
echo “\n===============================================================”
echo “\nCurrent System Error Report:”
errpt
echo “\n===============================================================”
echo “\nCurrent Filesystem Space:”
df -k
echo “\n===============================================================”
echo “\nSystem Information:”
prtconf
echo “\n===============================================================”
echo “\nCurrent tape information:\n”
tctl status
echo “\nRewinding tape……….”
tctl rewind
echo “\nBeginning system backup @ $datetime\n”
/usr/bin/mksysb¬† ‘-e’¬† ‘-v’ ‘-i’ ‘-X’¬† /dev/rmt0
echo “Backup ended at `date`”
} 1>$logfile 2>$errlog
cat $logfile > $maillog
echo “\n===============================================================” >> $maillog
echo “\nAdditional messages reported during backup:” >> $maillog
cat $errlog >> $maillog
mail -s “System Backup and Status Report” -r root@proserve-solutions.com $email_list < $maillog
exit

The issue was that v5.1 didn’t like the ‘V’ that v5.2 uses… I just changed the ‘V’ to a ‘v’ and that worked fine… Guess I should take a look at the log files before assuming that something is compatible.¬† Ya know I just had a thought, I wonder if my hatred for AIX is actually displaced and should be focused on ksh…¬† I am a bash lover without a doubt… korn may not be for me ūüôā

, , , , , , , ,

2 Comments

VSI Fax… WTF?


So I work for a small consulting firm and we are a software re-seller for… wow I walked right into that… I should have set this up to lead to something ironic… but I am obviously not that adept… ERP software… one of the fine features of this product is it’s ability to send a fax (LOL) directly from the client… This is actually pretty state-of-the-art for manufacturing technology.. Anyway as usual I was looking through my hundreds of scribbles in Notepad++ and saw a bunch of this crap… I thought it was pretty humerus.. although mostly useless.¬† So here it is for your amusement as well… this is a non-edited string of thoughts ūüôā¬† I am fairly certain this was taken from an IBM AIX v5.3 P-Series system… The accompanying drawing is from a Facebook friend of mine, Marie-Claude Sabourin, kind of reminds me of some random character from Coraline.

VSIFAX commands:

1433    vfxstat
1434    vfxsched
1435    vfxsched restart
1439    vfxsched stop
1440    vfxsched start
1442    vfxcancel 18449
1445    vfxsched restart
1460    vfxstat |pg
1461    vfxadmin enable fax1
1465    vfxsched stop
1466    ps -ef |grep fax
1467    kill -9 30196 33298
1468    ps -ef |grep fax
1469     vfxsched start
1473    cd $VSIFAX/lib
1476    cd ../spool
1478    cd logs
1480    cat fax1

qe-rs2 # vfxstat |pg

Device       Comments              State
———–¬† ——————–¬† ————-
fax1         Fax Modem #1          Unknown [Too many no-dials encountered]
lb           LoopBack              Unknown
lcr          LCR hold queue        Unknown [Holding queue only]
sm           SendMail              Unknown

Job Num  Dest      User       Submitted    Scheduled   Att  Pri  Result  Group
——-¬† ——–¬† ——–¬† ———–¬† ———–¬† —¬† —¬† ——¬† —–
18453    fax1      SRS       11/24 09:06      NOW        3    m  NODIAL
18454    fax1      SRS       11/24 09:07      NOW        2    m  NODIAL
18455    fax1      HOW       11/24 13:17      NOW        0    m  QUEUED
qe-rs2 # vfxadmin enable fax1
Device fax1 enabled
qe-rs2 # vfxstat

Device       Comments              State
———–¬† ——————–¬† ————-
fax1         Fax Modem #1          Unknown
lb           LoopBack              Unknown
lcr          LCR hold queue        Unknown [Holding queue only]
sm           SendMail              Unknown

Job Num  Dest      User       Submitted    Scheduled   Att  Pri  Result  Group
——-¬† ——–¬† ——–¬† ———–¬† ———–¬† —¬† —¬† ——¬† —–
18453    fax1      SRS       11/24 09:06      NOW        3    m  NODIAL
18454    fax1      SRS       11/24 09:07      NOW        2    m  NODIAL
18455    fax1      HOW       11/24 13:17      NOW        0    m  QUEUED
qe-rs2 # vfxstat

Device       Comments              State
———–¬† ——————–¬† ————-
fax1         Fax Modem #1          Unknown
lb           LoopBack              Unknown
lcr          LCR hold queue        Unknown [Holding queue only]
sm           SendMail              Unknown

Job Num  Dest      User       Submitted    Scheduled   Att  Pri  Result  Group
——-¬† ——–¬† ——–¬† ———–¬† ———–¬† —¬† —¬† ——¬† —–
18453    fax1      SRS       11/24 09:06      NOW        3    m  NODIAL
18454    fax1      SRS       11/24 09:07      NOW        2    m  NODIAL
18455    fax1      HOW       11/24 13:17      NOW        0    m  QUEUED
qe-rs2 # vfxstat

Device       Comments              State
———–¬† ——————–¬† ————-
fax1         Fax Modem #1          Unknown
lb           LoopBack              Unknown
lcr          LCR hold queue        Unknown [Holding queue only]
sm           SendMail              Unknown

Job Num  Dest      User       Submitted    Scheduled   Att  Pri  Result  Group
——-¬† ——–¬† ——–¬† ———–¬† ———–¬† —¬† —¬† ——¬† —–
18453    fax1      SRS       11/24 09:06      NOW        3    m  NODIAL
18454    fax1      SRS       11/24 09:07      NOW        2    m  NODIAL
18455    fax1      HOW       11/24 13:17      NOW        0    m  QUEUED
qe-rs2 # vfxsched stop
Server is not running
qe-rs2 # ps -ef |grep fax
vsifax 14880 33298¬†¬† 0 09:49:33¬†¬†¬†¬†¬† –¬† 0:00 /a/vsifax/lbin/lb-fim -d lb
vsifax 17140 33298¬†¬† 0 09:49:31¬†¬†¬†¬†¬† –¬† 0:00 /a/vsifax/lbin/vnetfax
root 25746 21134   0 14:26:01  pts/2  0:00 grep fax
vsifax 30196 33298¬†¬† 0 09:49:31¬†¬†¬†¬†¬† –¬† 0:00 /a/vsifax/lbin/vgsched
vsifax 31314 33298¬†¬† 0 09:49:33¬†¬†¬†¬†¬† –¬† 0:00 /a/vsifax/lbin/sm-fim -d sm
vsifax 33298¬†¬†¬†¬† 1¬†¬† 0 09:49:31¬†¬†¬†¬†¬† –¬† 0:01 /a/vsifax/lbin/vrsched
vsifax 38642 33298¬†¬† 0 09:49:32¬†¬†¬†¬†¬† –¬† 0:00 /a/vsifax/lbin/vxmld
qe-rs2 # kill -9 30196 33298
qe-rs2 # ps -ef |grep fax
root 33300 21134   0 14:26:27  pts/2  0:00 grep fax
qe-rs2 #  vfxsched start
vfxsched: Starting the server
vfxsched: Please wait .. done
qe-rs2 # vfxstat
Server on qe-rs2 has been up since 11/24 14:26

Device       Comments              State
———–¬† ——————–¬† ————-
fax1         Fax Modem #1          Dialing (18454) [1-315-655-4319]
lb           LoopBack              Idle
lcr          LCR hold queue        Not running [Holding queue only]
sm           SendMail              Idle

Job Num  Dest      User       Submitted    Scheduled   Att  Pri  Result  Group
——-¬† ——–¬† ——–¬† ———–¬† ———–¬† —¬† —¬† ——¬† —–
18454    fax1      SRS       11/24 09:07      NOW        2    m  SNDING
18453    fax1      SRS       11/24 09:06      NOW        3    m  NODIAL
18455    fax1      HOW       11/24 13:17      NOW        0    m  QUEUED
qe-rs2 # vfxstat
Server on qe-rs2 has been up since 11/24 14:26

Device       Comments              State
———–¬† ——————–¬† ————-
fax1         Fax Modem #1          Dialing (18453) [1-708-532-1811]
lb           LoopBack              Idle
lcr          LCR hold queue        Not running [Holding queue only]
sm           SendMail              Idle

Job Num  Dest      User       Submitted    Scheduled   Att  Pri  Result  Group
——-¬† ——–¬† ——–¬† ———–¬† ———–¬† —¬† —¬† ——¬† —–
18453    fax1      SRS       11/24 09:06      NOW        3    m  SNDING
18455    fax1      HOW       11/24 13:17      NOW        0    m  QUEUED
18454    fax1      SRS       11/24 09:07  11/24 14:31    3    m  NODIAL
qe-rs2 # vfxstat
Server on qe-rs2 has been up since 11/24 14:26

Device       Comments              State
———–¬† ——————–¬† ————-
fax1         Fax Modem #1          Not running [Too many no-dials encountered]
lb           LoopBack              Idle
lcr          LCR hold queue        Not running [Holding queue only]
sm           SendMail              Idle

Job Num  Dest      User       Submitted    Scheduled   Att  Pri  Result  Group
——-¬† ——–¬† ——–¬† ———–¬† ———–¬† —¬† —¬† ——¬† —–
18454    fax1      SRS       11/24 09:07  11/24 14:31    3    m  NODIAL
18453    fax1      SRS       11/24 09:06  11/24 14:32    4    m  NODIAL
18455    fax1      HOW       11/24 13:17  11/24 14:32    1    m  NODIAL
qe-rs2 # cd ../spool
qe-rs2 # ls
archive  dbs      expired  fifos    in       logs     mail     temp
qe-rs2 # cd logs
qe-rs2 # ls
.ckp-lb    lb         sm         vadmind-0  vgsched-1  vmail-3    vnetfax-4  vnotify-5  vxmld
fax1       lb-0       sm-0       vadmind-1  vgsched-2  vmail-4    vnetfax-5  vrsched    vxmld-0
fax1-0     lb-1       sm-1       vadmind-2  vgsched-3  vmail-5    vnotify    vrsched-0  vxmld-1
fax1-1     lb-2       sm-2       vadmind-3  vgsched-4  vnetfax    vnotify-0  vrsched-1  vxmld-2
fax1-2     lb-3       sm-3       vadmind-4  vgsched-5  vnetfax-0  vnotify-1  vrsched-2  vxmld-3
fax1-3     lb-4       sm-4       vadmind-5  vmail-0    vnetfax-1  vnotify-2  vrsched-3  vxmld-4
fax1-4     lb-5       sm-5       vgsched    vmail-1    vnetfax-2  vnotify-3  vrsched-4  vxmld-5
fax1-5     lcr        vadmind    vgsched-0  vmail-2    vnetfax-3  vnotify-4  vrsched-5
qe-rs2 # cat fax1
11/24 14.26.40: “fax1” Fax Interface Module
11/24 14.26.40: Version    = 4.2.2b build 331
11/24 14.26.40: Build info = AIX bigblue 3 4 0076541F4C00
11/24 14.26.40: System     = AIX:3:5:00C9A73E4C00
11/24 14.26.40: Fax Dest   = fax1
11/24 14.26.40: Device     = /dev/tty3
11/24 14.26.40: Process ID = 38650
11/24 14.26.40: Debug      = off
11/24 14.26.40: ——————————————————
11/24 14.26.40: INFO    :     0.426: setting up streams
11/24 14.26.40:¬†¬†¬†¬†¬†¬†¬†¬†¬†¬†¬†¬†¬†¬†¬†¬†¬†¬†¬†¬†¬† module “ldterm” is already on the stream
11/24 14.26.40: INFO    :     0.426: streams set up OK
11/24 14.26.42: EVENT¬†¬† :¬†¬†¬†¬† 2.094: … skipping {AT &F S0=0 E0 Q0 V1}
11/24 14.26.42: found modem: Multi-Tech with 56k Rockwell chipsets
11/24 14.26.43: MTYPE   :     3.494: Modem manufacturer            : CONEXANT
11/24 14.26.43: MTYPE   :     3.494: Modem model                   : V90
11/24 14.26.43: MTYPE   :     3.494: Modem version                 : C2FAX PATCH РV0.04C
11/24 14.26.43: MTYPE   :     3.494: Modem entry used              : Multi-Tech with 56k Rockwell chipsets
11/24 14.26.43: MTYPE   :     3.494: Supported classes             : 0 1 2
11/24 14.26.43: ——————- top of loop ———————-
11/24 14.26.43: MAINLOOP:     3.734: waiting for an event
11/24 14.26.43: SIGNAL  :     3.737: caught SIGUSR1
11/24 14.26.43: ——————————————————
11/24 14.26.43: JOB     :     3.737: processing request 18454 at 2009/11/24 14:26:43
11/24 14.26.43: JOB     :     3.737: Loaded fax file f-18454.tif (1 page: 1-1)
11/24 14.26.52: FAIL    :     8.877: calling Jobfail_env with 108 [No dialtone]
11/24 14.26.52: FAIL    :     8.877: connecting fails with result = 108 [No dialtone]
11/24 14.26.52: FAIL    :     8.877: <No dialtone>
11/24 14.26.52: ——————- top of loop ———————-
11/24 14.26.54: EVENT¬†¬† :¬†¬†¬† 10.518: … skipping {AT &F S0=0 E0 Q0 V1}
11/24 14.26.54: MAINLOOP:    10.758: waiting for an event
11/24 14.26.54: SIGNAL  :    10.761: caught SIGUSR1
11/24 14.26.54: ——————————————————
11/24 14.26.54: JOB     :    10.761: processing request 18453 at 2009/11/24 14:26:54
11/24 14.26.54: JOB     :    10.761: Loaded fax file f-18453.tif (1 page: 1-1)
11/24 14.27.05: FAIL    :    11.378: calling Jobfail_env with 108 [No dialtone]
11/24 14.27.05: FAIL    :    11.378: connecting fails with result = 108 [No dialtone]
11/24 14.27.05: FAIL    :    11.378: <No dialtone>
11/24 14.27.05: ——————- top of loop ———————-
11/24 14.27.07: EVENT¬†¬† :¬†¬†¬† 13.038: … skipping {AT &F S0=0 E0 Q0 V1}
11/24 14.27.07: MAINLOOP:    13.278: waiting for an event
11/24 14.27.07: SIGNAL  :    13.281: caught SIGUSR1
11/24 14.27.07: ——————————————————
11/24 14.27.07: JOB     :    13.281: processing request 18455 at 2009/11/24 14:27:07
11/24 14.27.07: JOB     :    13.282: Loaded fax file f-18455.tif (1 page: 1-1)
11/24 14.27.19: FAIL    :    11.718: calling Jobfail_env with 108 [No dialtone]
11/24 14.27.19: FAIL    :    11.718: connecting fails with result = 108 [No dialtone]
11/24 14.27.19: FAIL    :    11.718: <No dialtone>
11/24 14.27.19: ——————- top of loop ———————-
11/24 14.27.19: FAIL: calling Mainfail_env with 118 [Caught SIGTERM]
11/24 14.27.19: EXIT    :    11.728: Exiting with status 118 at 2009/11/24 14:27:19

, , , , , , , , , ,

2 Comments

AIX-ercise in filesystem Gymnastics


So for the last few hours I have been preparing for a change window I have this weekend to get a customer ready for a migration/upgrade.¬† I really don’t like AIX but this one just about brought me to my knees… I know a perfect image, open wide banana boy!!!

Not sure why I am even posting this aside from the simple fact that I spent so much time on it and want to see it in all it’s splendor somewhere other than in my editor…

I’m not even going to explain this one… Looks like I thought about making this one interactive/automated but it really is a one-off… and since every AIX system I manage, someone else built (ya no consistency) there isn’t much point by way of re-usability…If you are doing some AIX disk extending, maybe this will help you, or maybe not… Maybe I will comment on my own success/failure Monday after I actually do this… although I did do a dry-run of all this on a test box I have… LOL ūüôā

/a is currently 33GB (32384MB) total = 33161216
/a has 17GB FREE
/a must have 15GB = 15595240
#
Thought process…
15595240/33161216*100 = 47%
15595240/20480000*100 = 76%
#
Total current sizes:    Projected new sizes:
/a        =  33GB = 48%
/¬†¬† ¬†¬†¬† ¬†=¬† 64MB = 68% –>¬†¬† 128MB 34%
/usr¬†¬† ¬†= 896MB = 91% –> 1.800GB 45%
/var¬†¬† ¬†= 448MB = 94% –>¬†¬† 896MB 47%
/tmp¬†¬† ¬†= 128MB = 60% –>¬†¬† 256MB 30%
————-
3.080GB Total
#
copy everything from /a to /a3
# For reference later:
lsvg rootvg |grep PPs:|cut -c 42-79
TOTAL PPs:      1084 (69376 megabytes)
FREE PPs:       0 (0 megabytes) <РPoint of interest following the rmfs of /a
USED PPs:       1084 (69376 megabytes)
STALE PPs:      66
#
ps -ef |grep /a/
vgsched stop # prob the only thing running attached to /a process-wise
for i in `ps -ef |grep /a/|awk ‘{print $2}’`; do kill -9 $i; done
umount /a
#
# Destroy /a
rmfs /a
rmlv: Logical volume lv00 is removed.
#Confirm that we got all of /a back as FREE PPs
lsvg rootvg |grep PPs:|cut -c 42-79
# Don’t think I need this after all as I am creating not by PP:
lsvg rootvg|grep “PP SIZE:”
# VG STATE:       active                   PP SIZE:        64 megabyte(s) (64*<number of FREE PE>=size)
# to realize the above “Thought process”:
crfs -v jfs2 -m /a -g rootvg -a size=+41943040 # 20GB (20*1024*1024*1024/512 = 41943040)
mount /a
# Make sure /a is in /etc/filesystems
# Now extend the other filesystems:
chfs -a size=131072 /
chfs -a size=1835008 /usr
chfs -a size=917504 /var
chfs -a size=262144 /tmp
Unchanged:
65536 /home
65536 /opt
df -k
df -g
# Re-sync the rootvg Volume Group:
syncvg rootvg
#
# rootvg:
Total Disk:        35520512 (34688MB = 36GB)
Appropriated:    22544384 (22016MB = 23GB)
Un-allocated:    12976128 (12672MB = 13GB)
#
glohost # df -g¬† (Ya AIX 5.3 builds sometimes allow the -g…)
Filesystem    GB blocks      Free %Used    Iused %Iused Mounted on
/dev/hd4           0.06      0.02   68%     2215     7% /
/dev/hd2           0.88      0.08   91%    26538    12% /usr
/dev/hd9var        0.44      0.03   94%      764     1% /var
/dev/hd3           0.12      0.05   60%     1325     5% /tmp
/dev/hd1           0.06      0.06    4%      433     3% /home
/proc¬†¬†¬†¬†¬†¬†¬†¬†¬†¬†¬†¬†¬†¬†¬†¬† –¬†¬†¬†¬†¬†¬†¬†¬† –¬†¬†¬† –¬†¬†¬†¬†¬†¬†¬†¬† –¬†¬†¬†¬† –¬† /proc
/dev/hd10opt       0.06      0.04   30%     1635    10% /opt
/dev/lv00         31.62     16.75   48%    22260     1% /a
#
rootvg ========== 33.24GB
#

It just goes on and on from here… ūüė¶

, , , , , , , , , , , , , ,

Leave a comment

AIX¬†‚Äėstats-grabber‚Äô


I thought this was a pretty cool little ditty, if you administer AIX that is…

#!/usr/bin/ksh
# Bruce Spencer, IBM
# 2/4/99
# Modified 1/20/2000 to add serial number and “uname -M”
# This program identifies the Model, serial number (PCI only), memory, CPU’
# and disk on a RS/6000

# Hardware Codes for MCA based systems
CODE=`uname -m | cut -c9,10 `
case $CODE in
02) MODEL=”7015-930″;;
10) MODEL=”7016-730, 7013-530, 7016-730″;;
14) MODEL=”7013-540″;;
18) MODEL=”7013-53H”;;
1C) MODEL=”7013-550″;;
20) MODEL=”7015-930″;;
2E) MODEL=”7015-950″;;
30) MODEL=”7013-520, 7018-740/741″;;
31) MODEL=”7012-320″;;
34) MODEL=”7013-52H”;;
35) MODEL=”7012-32H”;;
37) MODEL=”7012-340″;;
38) MODEL=”7012-350″;;
41) MODEL=”7011-220″;;
42) MODEL=”7006-41T/41W”;;
43) MODEL=”7008-M20″;;
46) MODEL=”7011-250″;;
47) MODEL=”7011-230″;;
48) MODEL=”7009-C10″;;
57) MODEL=”7012-390, 7030-3BT”;;
58) MODEL=”7012-380, 7030-3AT”;;
59) MODEL=”7012-39H, 7030-3CT”;;
5C) MODEL=”7013-560″;;
63) MODEL=”7015-970/97B”;;
64) MODEL=”7015-980/98B”;;
66) MODEL=”7013-580/58F”;;
67) MODEL=”7013-570/770/771/R10″;;
70) MODEL=”7013-590″;;
71) MODEL=”7013-58H”;;
72) MODEL=”7013-59H/R12″;;
75) MODEL=”7012-370/375/37T”;;
76) MODEL=”7012-360/365/36T”;;
77) MODEL=”7012-355/55H/55L”;;
79) MODEL=”7013-590″;;
80) MODEL=”7015-990″;;
82) MODEL=”7015-R24″;;
89) MODEL=”7013-595″;;
90) MODEL=”7009-C20″;;
91) MODEL=”7006-42x”;;
94) MODEL=”7012-397″;;
A0) MODEL=”7013-J30″;;
A1) MODEL=”7013-J40″;;
A3) MODEL=”7015-R30″;;
A4) MODEL=”7015-R40″;;
A6) MODEL=”7012-G30″;;
A7) MODEL=”7012-G40″;;
C0) MODEL=”7024-E20″;;
C4) MODEL=”7025-F40″;;
4C) MODEL=`uname -M`;;  # PCI systems
*) MODEL=”Unknown”;;
esac
# echo “Hostname¬†¬†¬†¬†¬†¬†¬†¬† = ” $(hostname)
echo “Host/IP Address¬† = ” $(host $(hostname) )
echo “RS/6000 Model¬†¬†¬† = ” $MODEL

SN=$(lsattr -El sys0 -a systemid 2>/dev/null)
if [ $? -eq 0 ]
then
echo “Serial Number¬†¬†¬† = ” `echo $SN | awk ‘ { print $2 }’`
fi

echo “Number of CPU’s¬† = ” $(lscfg |grep -c “^+ proc”)
echo “Memory (KB)¬†¬†¬†¬†¬† = ” $(lsattr -El sys0 | awk ‘/realmem/ {print $2 }’)
echo “AIX Level¬†¬†¬†¬†¬†¬†¬† = ” $(oslevel)
echo “Number of hdisks = ” $(lspv |wc -l)
echo “Volume Groups”
# list volume groups disk avail/used

for i in $(lsvg)
do
lsvg $i
done | awk ‘
BEGIN¬†¬†¬†¬†¬† { printf(“%10s\t%10s\t%10s\t%10s\t%10s\n”,”VG”,”Total(MB)”,”Free”,”USED”,”Disks”) }
/VOLUME GROUP:/ { printf(“%10s\t”, $3)¬† }
/TOTAL PP/ { ¬†¬† ¬†B=index($0,”(“) + 1
E=index($0,” megaby”)
D=E-B
printf(“%10s\t”, substr($0,B,D) )
}
/FREE PP/¬† { ¬†¬† ¬†B=index($0,”(“) + 1
E=index($0,” megaby”)
D=E-B
printf(“%10s\t”, substr($0,B,D) )
}
/USED PP/¬† { ¬†¬† ¬†B=index($0,”(“)¬† + 1
E=index($0,” megaby”)
D=E-B
printf(“%10s\t”, substr($0,B,D) )
}
/ACTIVE PV/ { printf(“%10s\t\n”, $3)¬† } ‘

, , , , , , , , ,

Leave a comment