Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations SkipVought on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Inventory script for RS6k

Status
Not open for further replies.

june54

Technical User
Jun 4, 2003
160
0
0
US
Folks

Does anyone know any software that I could use to generate a invetory of all my RS6000 . At this time we have 55 servers and it is becoming hard to keep track of them. Or maybe someone has a script they could share that would do it ...

Thanks
 
Have a look at cfg2html. It's a script you can find in Internet that gives complete documentation about OS, Kernel, Filesystems, Devices, etc...
 
cfg2html is good, but you could also use prtconf & lslpp -al .

Mike

"Whenever I dwell for any length of time on my own shortcomings, they gradually begin to seem mild, harmless, rather engaging little things, not at all like the staring defects in other people's characters."
 
you might want to grab
lscfg -vp
as well as investigating the
snap
command.
 
Here is a script we use

Sorry it is so long but it delivers quite a lot of information


#!/usr/bin/ksh
#
PROGNAME="$0"
#
VERSION="beta.3.6"
#
NAME="SYSTEM CONFIGURATION REPORT (sysrep)"
#
# (c) Kelvin Yoxall
# Software
#
# 2002 - 2004
#
# History
# I gave up on the program history details many moons ago, it was getting too long!
#

OUTFILE=`uname -n`.html
INDFILE=`uname -n`.ind
SUBINDFILE=`uname -n`.subind
SUBOUTFILE=`uname -n`.subout
TMPFILE=/tmp/$0.tmpfile


#
# function Section_Header
#
Section_Header()
{
echo "$HEADER\c"
LAB=`echo $HEADER | sed "s/ /_/g"`
echo "<h3><li><a href="#$LAB">$HEADER</a></h3>" >>$INDFILE
echo "" >$SUBINDFILE
echo "<h2><center><a name=$LAB>$HEADER</a></center></h2>" >>$SUBINDFILE
echo "<p>" >$SUBOUTFILE
echo "<pre>" >>$SUBOUTFILE
}

#
# function Section_Footer()
#
Section_Footer()
{

echo "\n</pre>\n</p>\n" >> $SUBOUTFILE
echo "<h4><a href="#Contents">Back to Main Contents</a></h3>" >>$SUBOUTFILE
echo "<hr>" >>$SUBOUTFILE
cat $SUBINDFILE $SUBOUTFILE >>$OUTFILE
echo ""

}

#
# function Sub_Section_Header
#
Sub_Section_Header()
{
echo ".\c"
LAB=`echo $SUBHEADER | sed "s/ /_/g"`
echo "<h4><li><a href="#$LAB">$SUBHEADER</a></h4>" >>$SUBINDFILE
echo "<h3><a name=$LAB>$SUBHEADER</a></h3>" >>$SUBOUTFILE
echo "<p>" >>$SUBOUTFILE
echo "<pre>" >>$SUBOUTFILE
echo "<xmp>" >>$SUBOUTFILE
}


#
# function Sub_Section_Footer()
#
Sub_Section_Footer()
{
echo "</xmp>" >>$SUBOUTFILE
echo "</pre>\n</p>" >>$SUBOUTFILE
# Added because netscape is interpreting attributes even in pre formatted text
}


#
# function Program_Details
#
Program_Details()
{
HEADER=$NAME
Section_Header
echo "Program Name: `basename $0`" >>$SUBOUTFILE
echo "\nVersion: $VERSION" >>$SUBOUTFILE
echo "\nExecuted on: `date`" >>$SUBOUTFILE
echo "\nUser Details: `id | awk ' { print $1 } '`" >>$SUBOUTFILE
echo " `id | awk ' { print $2 } '`" >>$SUBOUTFILE
echo " `id | awk ' { print $3 } '`" >>$SUBOUTFILE
Section_Footer
}


#
# function System_Details
#
System_Details()
{
HEADER="System Details"
Section_Header
echo "\nSystem: `uname -a`" >>$SUBOUTFILE
echo "\nHostname: `hostname`" >>$SUBOUTFILE
echo "\nLanguage: $LANG" >>$SUBOUTFILE
echo "\nTime Zone: $TZ" >>$SUBOUTFILE
echo "\nConsole Device: `lscons`" >>$SUBOUTFILE
echo "\nSystem Booted on:`who -b | cut -c 24- `" >>$SUBOUTFILE
echo "\nUptime Details: -" >>$SUBOUTFILE
uptime >>$SUBOUTFILE

echo "\nMachine Platform: `bootinfo -T`" >>$SUBOUTFILE
echo "\nMachine Word Size: `bootinfo -y` bit" >>$SUBOUTFILE

echo "\nNumber of Processors: `lsdev -C | grep proc | wc -l`" >>$SUBOUTFILE
echo "\nProcessor Type: `lsattr -E -l proc0 -a type -O | tail -1`" >>$SUBOUTFILE
SPEED=`lsattr -E -l proc0 -a frequency -O | tail -1`
let SPEED=SPEED/1000000
echo "\nProcessor Speed: $SPEED MHz" >>$SUBOUTFILE

echo "\nMachine Real Memory Size (Bytes): `bootinfo -r`" >>$SUBOUTFILE
echo "\nPaging Space Details: -" >>$SUBOUTFILE
lsps -a >>$SUBOUTFILE

echo "\nSystem Memory Dump Device Details: -" >>$SUBOUTFILE
sysdumpdev -l >>$SUBOUTFILE
echo "\n " >>$SUBOUTFILE
sysdumpdev -e | cut -c 10- >>$SUBOUTFILE

echo "\nNumber of configured Users is: `wc -l </etc/passwd`" >>$SUBOUTFILE
echo "\nNumber of configured Groups is: `wc -l </etc/group`" >>$SUBOUTFILE

echo "\nBootlist details (bootlist -r): -" >>$SUBOUTFILE
echo "Note, this can return null or strange values depending upon system type." >>$SUBOUTFILE
for MODE in normal service
do
echo "\nMode: $MODE: -" >>$SUBOUTFILE
bootlist -m $MODE -r >>$SUBOUTFILE
done

if [ -f /image.data ]
then
echo "\nDate of last mksysb from /image.data file is: \c" >>$SUBOUTFILE
ls -l /image.data | awk ' { print $6 " " $7 " " $8 } ' >>$SUBOUTFILE
else
echo "\nWarning - There may not be a mksysb for this system!" >>$SUBOUTFILE
echo " No /image.data file exists." >>$SUBOUTFILE
fi

echo "\nNumber of entries in Error Log is: `errpt | wc -l`" >>$SUBOUTFILE

Section_Footer
}


#
# function Software_Details
#
Software_Details()
{
HEADER="Software Details"
Section_Header
OSLEVEL=`oslevel`
echo "Operating System Base Level: $OSLEVEL" >>$SUBOUTFILE
if [ "`lslpp -L | grep bos.up`" = "" ]
then
KERNEL=`lslpp -L | grep bos.mp | awk ' { print $2 } '`
else
KERNEL=`lslpp -L | grep bos.up | awk ' { print $2 } '`
fi
echo "\nKernel level: $KERNEL" >>$SUBOUTFILE
echo "\nKernel file details: `ls -l /unix`" >>$SUBOUTFILE
echo "\nOperating System Maintenance Level: `oslevel -r`" >>$SUBOUTFILE
echo "\nFix levels applied:- " >>$SUBOUTFILE
instfix -i | grep AIX_ML >>$SUBOUTFILE
echo "\nNumber Of LPPs Installed is: `lslpp -Lqc | wc -l | awk ' { print $1 } '`" >>$SUBOUTFILE
echo "\nNumber Of LPPs above base level is: `oslevel -g $OSLEVEL 2>/dev/null | wc -l | awk ' { print $1 } '`" >>$SUBOUTFILE

echo "\nFileset State details: -" >>$SUBOUTFILE
lslpp -Lqc | awk '
BEGIN { FS = ":"
c == 0
a == 0
o == 0
b == 0 }
{ if ( $6 == "C" ) c += 1
if ( $6 == "A" ) a += 1
if ( $6 == "O" ) o += 1
if ( $6 == "B" ) b += 1 }
END { print "\tCommitted:",c
print "\tApplied:",a
print "\tObsolete:",o
print "\tBroken:",b }
' >>$SUBOUTFILE

echo "\nChecking fileset consistency"
lppchk -v >$TMPFILE 2>&1
if [ $? -eq 0 ]
then
echo "\nFileset Consistency (lppchk -v) is OK." >>$SUBOUTFILE
else
echo "WARNING - Filesets are not consistent!" >>$SUBOUTFILE
echo "Please check / correct the following errors: -" >>$SUBOUTFILE
cat $TMPFILE >>$SUBOUTFILE
rm $TMPFILE
fi

TCB=`odmget -q "attribute like 'TCB*'" PdAt | grep deflt | cut -f2 -d\"`
if [ "$TCB" = "tcb_enabled" ]
then
echo "\nTrusted Computing Base(TCB) is ENABLED." >>$SUBOUTFILE
echo "\nResults of a TCB Check follow" >>$SUBOUTFILE
tcbck -n ALL >>$SUBOUTFILE 2>&1
else
echo "\nTrusted Comuting Base(TCB) is DISABLED." >>$SUBOUTFILE
fi
Section_Footer
}


#
# function Installed_Filesets
#
Installed_Filesets()
{
HEADER="Installed Filesets (lslpp -L)"
Section_Header
lslpp -L >>$SUBOUTFILE
Section_Footer
}


#
# function Filesets_History
#
Filesets_History()
{
HEADER="Installed Filesets Installation History (lslpp -h)"
Section_Header
lslpp -h >>$SUBOUTFILE
Section_Footer
}

#
# function Installed_Fixes
#
Installed_Fixes()
{
HEADER="Installed Fixes (instfix -iv)"
Section_Header
instfix -iv >>$SUBOUTFILE
Section_Footer
}


#
# function Locales
#
Locales()
{
HEADER="Locales"
Section_Header
echo "<ol>" >>$SUBINDFILE
SUBHEADER="Public locales available"
Sub_Section_Header
locale -a >>$SUBOUTFILE
Sub_Section_Footer
SUBHEADER="Current locales (applied)"
Sub_Section_Header
locale >>$SUBOUTFILE
Sub_Section_Footer
echo "</ol>" >>$SUBINDFILE
Section_Footer
}

#
# function License_Details
#
License_Details()
{
HEADER="Licensing, LUM and Nodelock Details"
Section_Header
echo ".\c"
echo "License Details: -" >>$SUBOUTFILE
lslicense >>$SUBOUTFILE
echo ".\c"
echo "\nAuthentication method is `lsauthent`." >>$SUBOUTFILE

for GROUP in iforls iforncs
do
echo ".\c"
echo "\nStatus of $GROUP daemons: -" >>$SUBOUTFILE
lssrc -g $GROUP >>$SUBOUTFILE
done

echo ".\c"
if [ -x /usr/lib/netls/bin/ls_targetid ]
then
echo "\nTargit ID details: -" >>$SUBOUTFILE
/usr/lib/netls/bin/ls_targetid >>$SUBOUTFILE 2>/dev/null
else
echo "\nNo ls_targetid command, check that fileset ????? is installed!" >>$SUBOUTFILE
fi

echo ".\c"
for FILE in /var/ifor/nodelock
do
if [ -f $FILE ]
then
echo "\nContents of nodelock file $FILE: -" >>$SUBOUTFILE
cat $FILE >>$SUBOUTFILE
echo "\n " >>$SUBOUTFILE
else
echo "\nnodelock file $FILE does not exist!" >>$SUBOUTFILE
fi
done
Section_Footer
}

#
# function System_Config
#
System_Config()
{
HEADER="System Configuration (lscfg -vp)"
Section_Header
lscfg -vp >>$SUBOUTFILE
Section_Footer
}

#
# function System_Devices
#
System_Devices()
{
HEADER="System Devices (lsdev -C)"
Section_Header
lsdev -H -C >>$SUBOUTFILE
Section_Footer
}

#
# function PCI_devices
#
PCI_Devices()
{
if [ -x /usr/sbin/lsslot ]
then
HEADER="PCI Hot Plug Slot Status"
Section_Header
/usr/sbin/lsslot -c pci >>$SUBOUTFILE 2>&1
fi
Section_Footer
}


#
# function Physical_Volumes
#
Physical_Volumes()
{
HEADER="Physical Volume Details (lspv)"
Section_Header
echo ".\c"
echo "<ol>" >>$SUBINDFILE
SUBHEADER="Physical Volumes"
Sub_Section_Header
lspv >>$SUBOUTFILE
Sub_Section_Footer
echo "<h3>Physical Volume Details: -</h3>" >>$SUBOUTFILE
for PV in `lspv | awk ' { print $1 } '`
do
echo ".\c"
SUBHEADER="Details for PV: $PV"
Sub_Section_Header
if [ "`lsdev -Ccdisk | grep $PV | grep Available`" = "" ]
then
echo "$PV is not in an Available state, unable to gather details.\n" >>$SUBOUTFILE
else
if [ "`lspv | grep $PV | awk ' { print $2 } ' `" = "none" ]
then
echo "$PV does not have a PVID, unable to gather details.\n" >>$SUBOUTFILE
else
PVVG=`lspv | grep $PV | awk ' { print $3 } '`
if [ "`lsvg -o | grep $PVVG`" = "" ]
then
echo "$PV volume group ($PVVG) is not varied on, unable to gather details.\n" >>$SUBOUTFILE
else
lspv $PV >>$SUBOUTFILE
echo "\nMAPS for Volume: $PV\n" >>$SUBOUTFILE
lspv -M $PV >>$SUBOUTFILE
echo "\n" >>$SUBOUTFILE
fi
fi
fi
Sub_Section_Footer
done
echo "</ol>" >>$SUBINDFILE
Section_Footer
}


#
# function Volume_Groups
#
Volume_Groups()
{
HEADER="Volume Group Details"
Section_Header
echo ".\c"
echo "Volume Groups: -\n" >>$SUBOUTFILE
lsvg >>$SUBOUTFILE
echo ".\c"
echo "\n\nVaried On Volume Groups: - \n" >>$SUBOUTFILE
lsvg -o >>$SUBOUTFILE
echo "<h3>Volume Group Details: -</h3>" >>$SUBOUTFILE
echo "<ol>" >>$SUBINDFILE
for VG in `lsvg -o`
do
echo ":\c"
SUBHEADER="Volume Group: $VG"
Sub_Section_Header
echo "Major Node Number:`ls -l /dev/$VG | awk ' { print $5 } ' `" >>$SUBOUTFILE
lsvg $VG >>$SUBOUTFILE
echo "\nPhysical Volumes(PVs) contained within: -" >>$SUBOUTFILE
lsvg -p $VG >>$SUBOUTFILE
echo "\nLogical Volumes(LVs) contained within: -" >>$SUBOUTFILE
lsvg -l $VG >>$SUBOUTFILE
Sub_Section_Footer
done
echo "</ol>" >>$SUBINDFILE
Section_Footer
}

#
# function Logical_Volumes
#
Logical_Volumes()
{
HEADER="Logical Volume & JFS Details"
Section_Header
for VG in `lsvg -o`
do
echo ":\c"
echo "<h3>Logical Volumes in Volume Group: $VG</h3><ol>" >>$SUBINDFILE
for LV in `lsvg -l $VG | awk ' { print $1 }' | tail +3`
do
SUBHEADER="$LV"
Sub_Section_Header
lslv $LV >>$SUBOUTFILE
echo "\nDistribution: - " >>$SUBOUTFILE
lslv -l $LV >>$SUBOUTFILE
echo " " >>$SUBOUTFILE
echo "\nMaps: - " >>$SUBOUTFILE
lslv -m $LV >>$SUBOUTFILE
echo " " >>$SUBOUTFILE
FS="N/A"
FS=`lslv -l $LV | grep $LV | awk ' BEGIN { FS=":" } { print $2 } '`
if [ "$FS" != "N/A" ]
then
echo "JFS details: - " >>$SUBOUTFILE
lsfs -q $FS >>$SUBOUTFILE
echo "\nUsage details: - " >>$SUBOUTFILE
df -v $FS >>$SUBOUTFILE
else
echo "No JFS file system details available." >>$SUBOUTFILE
fi
Sub_Section_Footer
done
echo "</ol>" >>$SUBINDFILE
done
Section_Footer
}

#
# function File_Systems
#
File_Systems()
{
HEADER="File System Details"
Section_Header
echo "<ol>" >>$SUBINDFILE
SUBHEADER="Mounted File Systems"
Sub_Section_Header
mount >>$SUBOUTFILE
Sub_Section_Footer
SUBHEADER="NFS mounted file systems"
Sub_Section_Header
lsnfsmnt >>$SUBOUTFILE
Sub_Section_Footer
SUBHEADER="File System space (K)"
Sub_Section_Header
df -vk >>$SUBOUTFILE
Sub_Section_Footer
lsnfsexp >$TMPFILE 2>/dev/null
SUBHEADER="NFS exported file systems"
Sub_Section_Header
if [ -s $TMPFILE ]
then
cat $TMPFILE >>$SUBOUTFILE
else
echo "\nNo NFS exported file systems. " >>$SUBOUTFILE
fi
Sub_Section_Footer
SUBHEADER="Contents of /etc/filesystems"
Sub_Section_Header
cat /etc/filesystems >>$SUBOUTFILE
Sub_Section_Footer
SUBHEADER="Virtual File System Details"
Sub_Section_Header
lsvfs -a >>$SUBOUTFILE
Sub_Section_Footer
echo "</ol>" >>$SUBINDFILE
Section_Footer
}


#
# function HACMP_Details
#
HACMP_Details()
{
if [ "`lslpp -L | grep cluster`" != "" ]
then
HEADER="HACMP Details"
Section_Header

if [ -x /usr/sbin/cluster/utilities/cllsres ]
then
echo "<ol>" >>$SUBINDFILE
for CMND in cllscf "cllsif -c" cllsres clshowres cllsnode clfindres
do
SUBHEADER="$CMND on `uname -n`"
Sub_Section_Header
/usr/sbin/cluster/utilities/$CMND >>$SUBOUTFILE 2>&1
Sub_Section_Footer
done

SUBHEADER="Resource Group details"
Sub_Section_Header
odmget HACMPgroup >>$SUBOUTFILE 2>&1
Sub_Section_Footer

SUBHEADER="Application Server details"
Sub_Section_Header
odmget HACMPserver >>$SUBOUTFILE 2>&1
Sub_Section_Footer

SUBHEADER="Bull add-on details"
Sub_Section_Header
odmget HACMPbullservice >>$SUBOUTFILE 2>&1
Sub_Section_Footer

SUBHEADER="All post/pre events from HACMPevent:"
Sub_Section_Header
odmget HACMPevent | egrep "post|pre" | grep -v " previously executed " >>$SUBOUTFILE 2>&1
Sub_Section_Footer

SUBHEADER="HACMP Subsystem details"
Sub_Section_Header
for SUBSYS in grpsvcs grpglsm emsvcs topsvcs
do
echo "</pre></p>\n<h4>Subsystem details for $SUBSYS</h4>\n<p><pre>" >>$SUBOUTFILE
lssrc -ls $SUBSYS >>$SUBOUTFILE 2>&1
done
Sub_Section_Footer

SUBHEADER="Application Server START Script Contents"
Sub_Section_Header
echo "<ol>" >>$SUBINDFILE
odmget HACMPserver >$TMPFILE
for F in `cat $TMPFILE | grep "start =" | awk ' { print $3 }' | sed "s/\"//g" `
do
SUBHEADER="Script File: $F"
Sub_Section_Header
cat $F >>$SUBOUTFILE
Sub_Section_Footer
done
echo "</ol>" >>$SUBINDFILE
Sub_Section_Footer

SUBHEADER="Application Server STOP Script Contents"
Sub_Section_Header
echo "<ol>" >>$SUBINDFILE
odmget HACMPserver >$TMPFILE
for F in `cat $TMPFILE | grep "stop =" | awk ' { print $3 }' | sed "s/\"//g" `
do
SUBHEADER="Script File: $F"
Sub_Section_Header
cat $F >>$SUBOUTFILE
Sub_Section_Footer
done
echo "</ol>" >>$SUBINDFILE
Sub_Section_Footer

else
echo "HACMP commands ignored. cllsres not found." >>$SUBOUTFILE
fi

echo "</ol>" >>$SUBINDFILE
Section_Footer
fi
}

#
# Function EMC_Details
#
EMC_Details()
{
HEADER="EMC Symmetrix Details"
Section_Header
if [ -d /usr/symcli/bin ]
then
TEMPPATH=$PATH
PATH=$PATH:/usr/symcli/bin
fi
if [ -x /usr/sbin/powermt ]
then
COMMAND="/usr/sbin/powermt"
else
COMMAND=`whence powermt`
fi
SUBHEADER="PowerPath"
Sub_Section_Header
if [ "$COMMAND" != "" ]
then

if [ -f /etc/powerpath_registration ]
then
echo "</pre></p><h3>PowerPath Reg File Contents (/etc/powerpath_registration)</h3><p><pre>" >>$SUBOUTFILE
cat /etc/powerpath_registration >>$SUBOUTFILE
echo "\n" >>$SUBOUTFILE
eval $COMMAND check_registration >>$SUBOUTFILE 2>&1
else
echo "\n*** WARNING ***" >>$SUBOUTFILE
echo "PowerPath Reg File: /etc/powerpath_registration NOT FOUND!" >>$SUBOUTFILE
fi

echo ".\c"
echo "</pre></p><h3>PowerPath Paths</h3><p><pre>" >>$SUBOUTFILE
eval $COMMAND display >>$SUBOUTFILE 2>&1

echo ".\c"
echo "</pre></p><h3>PowerPath Devices</h3><p><pre>" >>$SUBOUTFILE
eval $COMMAND display dev=all >>$SUBOUTFILE 2>&1
else
echo "Unable to locate Power Path commands, assuming no Power Path installed.\n" >>$SUBOUTFILE
fi
Sub_Section_Footer

SUBHEADER="EMC - syminq"
Sub_Section_Header
if [ -x "`whence syminq`" ]
then
echo ".\c"
syminq -v >>$SUBOUTFILE 2>&1
echo " \n" >>$SUBOUTFILE
else
echo "Warning: syminq command not in search path" >>$SUBOUTFILE
fi
Sub_Section_Footer

SUBHEADER="EMC - sym device groups"
Sub_Section_Header
if [ -x "`whence symdg`" ]
then
echo ".\c"
symdg -v list >>$SUBOUTFILE 2>&1
echo " \n" >>$SUBOUTFILE
else
echo "Warning: symdg command not in search path" >>$SUBOUTFILE
fi
Sub_Section_Footer

SUBHEADER="EMC - sym devices"
Sub_Section_Header
if [ -x "`whence symdev`" ]
then
echo ".\c"
symdev -v list >>$SUBOUTFILE 2>&1
echo " \n" >>$SUBOUTFILE
else
echo "Warning: symdev command not in search path" >>$SUBOUTFILE
fi
Sub_Section_Footer

echo "</ol>" >>$SUBINDFILE
Section_Footer
if [ "$TEMPPATH" != "" ]
then
PATH=$TEMPPATH
fi
}


#
# Function Network_Details
#
Network_Details()
{
HEADER="Network Details"
Section_Header
echo "<ol>" >>$SUBINDFILE

SUBHEADER="Netstat Verbose (netstat -v)"
Sub_Section_Header
netstat -v >>$SUBOUTFILE
Sub_Section_Footer

SUBHEADER="Interface Details"
Sub_Section_Header
lsdev -Ccif >$TMPFILE
echo "<ol>" >>$SUBINDFILE
for INTF in `cat $TMPFILE | awk ' { print $1 } '`
do
echo "</xmp></pre></p>" >>$SUBOUTFILE
SUBHEADER="Interface: `grep $INTF $TMPFILE`"
Sub_Section_Header
ifconfig $INTF >>$SUBOUTFILE 2>/dev/null
Sub_Section_Footer
done
echo "</ol>" >>$SUBINDFILE
Sub_Section_Footer

SUBHEADER="Routing Table Contents"
Sub_Section_Header
netstat -rn >>$SUBOUTFILE
Sub_Section_Footer

SUBHEADER="DNS Information"
Sub_Section_Header
for FILE in /etc/resolv.conf /etc/netsvc.conf /etc/irs.conf
do
if [ -f $FILE ]
then
echo "</xmp></pre></p><h3>Contents of $FILE file</h3><p><pre><xmp>" >>$SUBOUTFILE
cat $FILE >>$SUBOUTFILE
else
echo "</xmp></pre></p><h3>$FILE not configured</h3><p><pre><xmp>" >>$SUBOUTFILE
fi
done
Sub_Section_Footer

SUBHEADER="Contents of /etc/hosts file"
Sub_Section_Header
cat /etc/hosts >>$SUBOUTFILE
Sub_Section_Footer

SUBHEADER="Trusted Host details"
Sub_Section_Header
for F in /.rhosts /etc/hosts.equiv /etc/hosts.lpd /usr/sbin/cluster/etc/rhosts
do
if [ -f $F ]
then
echo "\n</xmp></pre></p><h3>Contents of $F file</h3><p><pre><xmp>" >>$SUBOUTFILE
cat $F >>$SUBOUTFILE
else
echo "\n</xmp></pre></p><h3>File $F does not exist</h3><p><pre><xmp>" >>$SUBOUTFILE
fi
done
Sub_Section_Footer

SUBHEADER="Network Object Values (no -a)"
Sub_Section_Header
no -a >>$SUBOUTFILE
Sub_Section_Footer

echo "</ol>" >>$SUBINDFILE
Section_Footer
}


#
# function DAS
#
DAS()
{
if [ -f /usr/bin/navicli_getconf ]
then
HEADER="Disk Array Subsystem Details (Navisphere)"
Section_Header
/usr/bin/navicli_getconf -d /tmp/$0.Navisphere >>$TMPFILE 2>$TMPFILE
if [ $? -eq 0 ]
then
for FILE in `ls /tmp/$0.Navisphere`
do
echo ".\c"
echo "\nFile name: $FILE\n" >>$SUBOUTFILE
cat /tmp/$0.Navisphere/$FILE >>$SUBOUTFILE
done
echo ""
else
cat $TMPFILE >>$SUBOUTFILE
fi
Section_Footer
fi
}


#
# function ATF
#
ATF()
{
if [ -f /usr/sbin/atf/atfi ]
then
HEADER="ATF Details"
Section_Header
echo "<ol>" >>$SUBINDFILE
SUBHEADER="ATF Software Details"

Sub_Section_Header
lslpp -h atf.obj >>$SUBOUTFILE
Sub_Section_Footer

SUBHEADER="ATF Object Details"
Sub_Section_Header
echo "<ol>" >>$SUBINDFILE
for i in `lsdev -C | grep atf | awk ' { print $1 } ' `
do
if [ "$i" = "" ]
then
echo "\nThere are no ATF objects!" >>$SUBOUTFILE
else
echo ".\c"
SUBHEADER="ATF object: $i" >>$SUBOUTFILE
Sub_Section_Header
/usr/sbin/atf/atfi -d $i -p >>$SUBOUTFILE
Sub_Section_Footer
fi
done
echo "</ol>" >>$SUBINDFILE
Sub_Section_Footer
echo "</ol>" >>$SUBINDFILE
Section_Footer
fi
}


#
# function SSA_Details
#
SSA_Details()
{
HEADER="SSA Details"
Section_Header
FLAG=n
ADAPTERS=`lsdev -Ccadapter -t ssa`
if [ "$ADAPTERS" = "" ]
then
echo "</pre></p><h3>No SSA adapters found</h3><p><pre>" >>$SUBOUTFILE
else
echo "</pre></p><h3>SSA adapters</h3><p><pre>" >>$SUBOUTFILE
lsdev -Ccadapter -t ssa >>$SUBOUTFILE
FLAG=y
fi
ADAPTERS=`lsdev -C -t ssa160 -c adapter`
if [ "$ADAPTERS" = "" ]
then
echo "</pre></p><h3>No SSA160 adapters found</h3><p><pre>" >>$SUBOUTFILE
else
echo "</pre></p><h3>SSA160 adapters</h3><p><pre>" >>$SUBOUTFILE
lsdev -C -t ssa160 -c adapter >>$SUBOUTFILE
FLAG=y
fi
if [ "$FLAG" = "y" ]
then
echo "<ol>" >>$SUBINDFILE
SUBHEADER="SSA Physical Disks"
Sub_Section_Header
lsdev -C -c pdisk -sssar -H >>$SUBOUTFILE
Sub_Section_Footer
SUBHEADER="SSA Logical Disks"
Sub_Section_Header
lsdev -C -thdisk -cdisk -sssar -H >>$SUBOUTFILE
Sub_Section_Footer
SUBHEADER="SSA Disk Mappings - Physical to Logical" >>$SUBOUTFILE
Sub_Section_Header
for i in `lsdev -CS1 -cpdisk -sssar -F name`
do
echo "$i: `ssaxlate -l $i`" >>$SUBOUTFILE
done
Sub_Section_Footer
SUBHEADER="SSA Disk Mappings - Logical to Physical" >>$SUBOUTFILE
Sub_Section_Header
for i in `lsdev -CS1 -cdisk -sssar -F name`
do
echo "$i: `ssaxlate -l $i`" >>$SUBOUTFILE
done
Sub_Section_Footer
echo "</ol>" >>$SUBINDFILE
fi
Section_Footer
}


#
# function NetBackup
#
NetBackup()
{
if [ -f /usr/openv/netbackup/version ]
then
HEADER="NetBackup S/W Details"
Section_Header
echo ".\c"
echo "NetBackup appears to be installed, Version Info follows:-\n" >>$SUBOUTFILE
cat /usr/openv/netbackup/version >>$SUBOUTFILE
if [ -f /usr/openv/netbackup/bp.conf ]
then
echo ".\c"
echo "Contents of file: bp.conf\n" >>$SUBOUTFILE
cat /usr/openv/netbackup/bp.conf >>$SUBOUTFILE
fi
Section_Footer
fi
}


#
# function dev_Details
#
dev_Details()
{
HEADER="/dev Directory Details"
Section_Header
ls -ialR /dev >>$SUBOUTFILE
Section_Footer
}


#
# function Device_Attributes
#
Device_Attributes()
{
HEADER="Device Attributes (lsattr)"
Section_Header
echo "<ol>" >>$SUBINDFILE
for DEV in `lsdev -C | awk ' { print $1 } ' | sort `
do
SUBHEADER="Device: $DEV"
Sub_Section_Header
lsattr -H -E -l $DEV >>$SUBOUTFILE
Sub_Section_Footer
done
echo "</ol>" >>$SUBINDFILE
Section_Footer
}



#
# function arp_Table
#
arp_Table()
{
HEADER="Arp table"
Section_Header
arp -a >>$SUBOUTFILE
Section_Footer
}



#
# function Login_Details
#
Login_Details()
{
HEADER="Login details (who -a)"
Section_Header
who -a >>$SUBOUTFILE
Section_Footer
}

#
# function Subsys_Details
#
Subsys_Details()
{
HEADER="Subsystem details"
Section_Header
lssrc -a >>$SUBOUTFILE
Section_Footer
}

#
# function Process_Details
#
Process_Details()
{
HEADER="Process details"
Section_Header

SUBHEADER="ps -ef"
Sub_Section_Header
ps -ef >>$SUBOUTFILE
Sub_Section_Footer

SUBHEADER="ps aux"
Sub_Section_Header
ps aux >>$SUBOUTFILE
Sub_Section_Footer

SUBHEADER="ps alx"
Sub_Section_Header
ps alx >>$SUBOUTFILE
Sub_Section_Footer

SUBHEADER="ps avx"
Sub_Section_Header
ps avx >>$SUBOUTFILE
Sub_Section_Footer

echo "</ol>" >>$SUBINDFILE
Section_Footer
}


#
# function iostat_Details
#
iostat_Details()
{
HEADER="iostat details"
Section_Header
iostat >>$SUBOUTFILE
Section_Footer
}


#
# function vmstat_Details
#
vmstat_Details()
{
HEADER="vmstat Details"
Section_Header

SUBHEADER="vmstat"
Sub_Section_Header
vmstat >>$SUBOUTFILE
Sub_Section_Footer

SUBHEADER="vmstat -s"
Sub_Section_Header
vmstat -s >>$SUBOUTFILE
Sub_Section_Footer

SUBHEADER="vmstat -i"
Sub_Section_Header
vmstat -i >>$SUBOUTFILE
Sub_Section_Footer

echo "</ol>" >>$SUBINDFILE
Section_Footer
}


#
# function rsf_Details
#
rsf_Details()
{
if [ -x /usr/bin/sm_rsf ]
then
HEADER="RSF details"
Section_Header
/usr/bin/sm_rsf status >>$SUBOUTFILE 2>&1
Section_Footer
fi
}


#
# function wlm_Details
#
wlm_Details()
{
HEADER="Work Load Management details"
Section_Header
echo ".\c"
echo "</pre></p><h3>Status:</h3><p><pre>" >>$SUBOUTFILE
wlmcntrl -q >>$SUBOUTFILE 2>&1
echo ".\c"
echo "</pre></p><h3>Classes:</h3><p><pre>" >>$SUBOUTFILE
lsclass -f >>$SUBOUTFILE
Section_Footer
}


#
# function List_Users
#
List_Users()
{
HEADER="List of Users and attributes"
Section_Header
lsuser -f ALL >>$SUBOUTFILE
Section_Footer
}


#
# function User_Chk
#
User_Chk()
{
HEADER="User definition check"
Section_Header
usrck -n ALL >>$SUBOUTFILE 2>&1
if [ $? -eq 0 ]
then
echo "No errors in User definition check." >>$SUBOUTFILE
fi
Section_Footer
}


#
# function List_Groups
#
List_Groups()
{
HEADER="List of Groups and attributes"
Section_Header
lsgroup -f ALL >>$SUBOUTFILE
Section_Footer
}


#
# function Group_Chk
#
Group_Chk()
{
HEADER="Group definition check"
Section_Header
grpck -n ALL >>$SUBOUTFILE 2>&1
if [ $? -eq 0 ]
then
echo "No errors in Group definition check." >>$SUBOUTFILE
fi
Section_Footer
}


#
# function Role_Details
#
Role_Details()
{
HEADER="Role details"
Section_Header
lsrole -f ALL >>$SUBOUTFILE
Section_Footer
}


#
# function crontab_Details
#
crontab_Details()
{
HEADER="Contents of crontab files"
Section_Header
echo "</pre></p><h3>List of crontab users files & attributes</h3><p><pre>" >>$SUBOUTFILE
ls -l /var/spool/cron/crontabs >>$SUBOUTFILE
echo "<ol>" >>$SUBINDFILE
for F in `ls /var/spool/cron/crontabs`
do
SUBHEADER="Crontab File: $F"
Sub_Section_Header
cat /var/spool/cron/crontabs/$F >>$SUBOUTFILE
Sub_Section_Footer
done
echo "</ol>" >>$SUBINDFILE
Section_Footer
}


#
# function Print_Details()
#
Print_Details()
{
HEADER="Printing Subsystem Details"
Section_Header
echo "<ol>" >>$SUBINDFILE
SUBHEADER="Print Queues" >>$SUBOUTFILE
Sub_Section_Header
lsallq >>$SUBOUTFILE
Sub_Section_Footer
SUBHEADER="/etc/qconfig contents"
Sub_Section_Header
cat /etc/qconfig >>$SUBOUTFILE
Sub_Section_Footer
for Q in `lsallq`
do
SUBHEADER="Print Queue: $Q"
Sub_Section_Header
echo " " >>$SUBOUTFILE
echo "Queue Details:-" >>$SUBOUTFILE
lsque -q $Q >>$SUBOUTFILE
echo " " >>$SUBOUTFILE
echo "Queue Device Details:-" >>$SUBOUTFILE
QD=`lsque -q $Q | tail -1 | awk ' { print $3 } '`
lsquedev -q $Q -d $QD >>$SUBOUTFILE
echo " " >>$SUBOUTFILE
echo "Virtual Printer Characteristics:-" >>$SUBOUTFILE
lsvirprt -q $Q -d $QD >>$SUBOUTFILE
Sub_Section_Footer
done
echo "</ol>" >>$SUBINDFILE
Section_Footer
}


#
 
Hi

If you have such a huge server farm running AIX i'd recommend you to configure the dsh (Distributed Shell) so you can run the prtconf or the script unclebrian posted on all the servers you want at the same time. You can even use OpenSSH connections to secure your communications and have one administrative console from where you issue commands to all your servers.

Hope this helps
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top