System rpt

  • Follow


i'm looking for a AIX5.1 command which will print out all system
resources ie disks, cpu (speed), memory (physcal / virtual), IP, model
#, serial # pretty much everything you need for a systen aduit. thanks

0
Reply dunphyj (6) 3/30/2005 3:54:45 PM

In article <1112198085.631771.279540@o13g2000cwo.googlegroups.com>, jdunphy wrote:
> i'm looking for a AIX5.1 command which will print out all system
> resources ie disks, cpu (speed), memory (physcal / virtual), IP, model
> #, serial # pretty much everything you need for a systen aduit. thanks
> 

Someone pointed me to a script 'Inventory-Long.ksh'.
Does it do all you're wanting?

------------------------------------------
#!/usr/bin/ksh
#/*  start_doc  */
#/***********************************************************************
#*                     Program Information                              *
#*                                                                      *
#* Program Name        : Inventory-Long                                 *
#* Date Written        : 03/08/01                                       *
#* Author              : William D. Wood                                *
#* System              : IBM SP                                         *
#* Subsystem           : Administration                                 *
#* Example             : Inventory-Long > result 2>&1                   *
#* Purpose             : Create listing of current system configuration *
#* Description         : Uses AIX commands to list pertinent system     *
#*                       information into a single file                 *
#*                                                                      *
#************************************************************************
#*                        Revision History                              *
#*                                                                      *
#*  Name       Date      Revision                                       *
#*             Revised   Description/Authorization                      *
#* --------    --------  ---------------------------------------------- *
#* woodwd      03/08/01  Created initial script                         *
#                                                                       *
#************************************************************************
# PBZ - log                                                             *
#************************************************************************
#                                                                       *
#  ddelija    09/24/02 /rootop/Inventory-Long.ksh root:700              *       
#  ddelija    10/07/02 symetrix interafce added count_EMC,list_symetrix *
#  zfindrik                                                             *
#  ddelija    11/12/02 get_model added                                  *
#  ddelija    31/01/03 list_Platform_firmwarea added                    *
#  ddelija    10/02/03 get_model modified to work on regatta            *
#  ddelija    08/04/03 list_tunables list /etc/tunables/nextboot        *
#  ddelija    30/04/03 display_info1 to avoid eval break - no memory    *
#                                                                       *
#***********************************************************************/
#/*  end_doc  */


################################################################################
##
##  Subroutine: Exit program upon operator request or if error encountered
##
################################################################################
exit_prog ()
{
  print ""
  print "Exiting program '$PROGNAME'.  Exit code = 1"
  print "Program exited on $(date '+%a, %h %d at %r')"
  print ""
  print "Thank you."
  print ""
  exit 1
}


################################################################################
##
##  Subroutine: Exit program upon interrupt request (^C)
##
################################################################################
exit_break ()
{
  print ""
  print ""
  print "Exiting program '$PROGNAME' abnormally due to interrupt request!"
  print "Please re-run program."
  print ""
  print "Program exited on $(date '+%a, %h %d at %r')"
  print ""
  print " Thank you."
  print ""
  exit 1
}


################################################################################
##
##  Subroutine: find out model of the machine 
##
################################################################################
get_model () {

CODE=`lsattr -E -l sys0 | awk '$1~/modelname/ { print $2 }'`
echo "RS/6000 Model    = $CODE"

return

#old non-working version 
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";;
        4C) MODEL="7248-43P";;
        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";;
         *) MODEL="Unknown";;
esac
echo "RS/6000 Model    = "$MODEL" "$CODE


}
################################################################################
##
##  Subroutine: List for p6** only list platform firmware
##
################################################################################
list_Platform_firmware()
{
	lscfg -vp|grep -p 'Platform Firmware:'
}

################################################################################
##
##  Subroutine: List information about CPU/version
##
################################################################################
list_machine ()
{
   print "============================"
   print "MACHINE-SPECIFIC INFORMATION"
   print "============================"
   print ""
   display_info "CPU Information" "uname -a"
   display_info "Platform Firmware" "list_Platform_firmware"
   display_info "Machine model" "get_model"
   display_info "OS Level" "oslevel"
   display_info "OS Maintenance Level" "instfix -i | grep AIX_ML"
}

################################################################################
##
##  Subroutine: List information about volume groups
##
################################################################################
list_vgs ()
{
   print "========================"
   print "VOLUME GROUP INFORMATION"
   print "========================"
   print ""
   display_info "List of All Volume Groups" "lsvg"
   display_info "List of Varied On Volume Groups" "lsvg -o"
   VOLS="$(lsvg -o)"
   for i in $VOLS
   do
      display_info "Volume Layout of $i" "lsvg $i"
      display_info "Physical Layout of $i" "lsvg -p $i"
      display_info "Logical Layout of $i" "lsvg -l $i"
   done

   return 0
}


################################################################################
##
##  Subroutine: List information about logical volumes
##
################################################################################

list_lvs ()
{
   print "=========================="
   print "LOGICAL VOLUME INFORMATION"
   print "=========================="
   print ""
   VOLS="$(lsvg -o)"
   for i in $VOLS
   do
      LVS="$(lsvg -l $i | tail +3 | awk '{print $1}')"
      for j in $LVS
      do
         display_info "Logical Volume layout of $i" "lslv -l $j; print; lslv $j"
      done
   done

   return 0
}

################################################################################
##
##  Subroutine: List information about physical volumes
##
################################################################################
list_pvs ()
{
   print ""
   print "==========================="
   print "PHYSICAL VOLUME INFORMATION"
   print "==========================="
   print ""
   display_info "List of physical volumes" "lspv"
   VOLS="$(lspv | awk '{print $1}')"
   for i in $VOLS
   do
      display_info "Information for $i" "lspv $i"
      display_info "Logical Layout of $i" "lspv -l $i"
      display_info "Physical layout of $i" "lspv -p $i"
   done

   return 0
}


################################################################################
##
##  Subroutine: List startup information (/etc/inittab and rc.local)
##
################################################################################
list_startup ()
{
   print ""
   print "==================="
   print "STARTUP INFORMATION"
   print "==================="
   print ""
#  display_info "Inittab File" "lsitab -a"
   if [ -f /etc/rc.local ]
   then
     display_info "/etc/rc.local File" "cat /etc/rc.local"
   else
     display_info "/etc/rc.local File" "print \"No rc.local file exists\" "
   fi

   return 0
}


################################################################################
##
##  Subroutine: List filesystem information
##
################################################################################
list_fs ()
{
   print ""
   print "======================"
   print "FILESYSTEM INFORMATION"
   print "======================"
   print ""
   display_info "List of filesystems" "lsfs"
   display_info "List of /etc/filesystems" "cat /etc/filesystems"

   return 0
}


################################################################################
##
##  Subroutine: List paging spaces
##
################################################################################
list_ps ()
{
   print ""
   print "========================"
   print "PAGING SPACE INFORMATION"
   print "========================"
   print ""
   display_info "Size of Real Memory" "lsattr -El sys0 -a realmem"
   display_info "List of Paging Spaces" "lsps -a"
   display_info "Paging Space Summary" "lsps -s"

   return 0
}


################################################################################
##
##  Subroutine: List user and group information
##
################################################################################
list_users ()
{
   print ""
   print "======================"
   print "USER/GROUP INFORMATION"
   print "======================"
   print ""
   display_info "Group Information" "lsgroup ALL"
   display_info "User Information" "lsuser ALL"

   return 0
}

################################################################################
##
##  Subroutine: List network information
##
################################################################################
list_net ()
{
   print ""
   print "==================="
   print "NETWORK INFORMATION"
   print "==================="
   print ""
   display_info "Network Information" "netstat -in"
   display_info "Network Route Information" "netstat -rn"
   NETS=$(netstat -in | tail +2 | awk '{print $1}' | uniq)
   for i in $NETS
   do
     display_info "Interface Configuration" "ifconfig $i"
   done
   display_info "Host Information" "cat /etc/hosts"

}

################################################################################
##
##  Subroutine: List network tunning parameters
##
################################################################################
list_no ()
{
   print ""
   print "============================"
   print "NETWORK OPTIONS INFORMATION"
   print "============================"
   print ""
   display_info "Network Options Information" "no -a"

   return 0
}


################################################################################
##
##  Subroutine: List licensed product information
##
################################################################################
list_lpp ()
{
   print ""
   print "============================"
   print "LICENSED PRODUCT INFORMATION"
   print "============================"
   print ""
   display_info "Licensed Program Products" "lslpp -L"

   return 0
}


################################################################################
##
##  Subroutine: List Device information
##
################################################################################
list_devs ()
{
   print ""
   print "==========================="
   print "DETAILED DEVICE INFORMATION"
   print "==========================="
   print ""
############################################
#eval break on our 5.2 regatta - tu much devices 
#so new operation display_info1
############################################
   display_info1 "Installed Resources" "lscfg -v"
   display_info "Customized Devices" "lsdev -C | sort"
   DEVS=$(lsdev -C | sort  | awk '{print $1}')
   for i in $DEVS
   do
      display_info "$i" "lsattr -F \"attribute value description\" -l $i"
   done

   return 0
}


################################################################################
##
##  Subroutine: count EMC disks and print table / control
##
################################################################################

################################################################################
##
##  Subroutine: count EMC disks and print table / control
##
################################################################################
count_EMC ()
{
#########################################################
#Our local specifics - 
#With Zaneta Findrik 07tj Oct 2002 Inventroy_long.ksh
#########################################################

test -x symdev || return

	#tokens to be filtered
	TOKENS="RDF1 RDF2 BCV 2-Way"
	#results of trhree different commands are put into table 
	#it must be the same visual control

	OUT=/tmp/$$.emc
	OUTS=""
 
	PORT=0
	SCSI=14b
	OUTO=${OUT}${SCSI}
	symdev list -sa $SCSI -p $PORT  > $OUTO
	OUTS=$OUTS" "$OUTO

	SCSI=3b
	OUTO=${OUT}${SCSI}
	symdev list -sa $SCSI -p $PORT  > $OUTO
	OUTS=$OUTS" "$OUTO

	OUTO=${OUT}.pd
	sympd list > $OUTO
	OUTS=$OUTS" "$OUTO


	printf "%s	%s	%s	%s\n" $TOKENS
	printf "-------------------------------------------------------"

	for f in $OUTS
	do
	printf "\n"
		for t in $TOKENS
		do
			N=$(grep "$t" $f| grep power | wc -l)
			printf "%d	" $N
		done
	done
	printf "\n"
	printf "-------------------------------------------------------"
	printf "\n"

	#remove the tmp data
	test -n "$OUTS" && rm -rf $OUTS

return 0

}

################################################################################
##
##  Subroutine: List SYMETRIX information
##
################################################################################
list_symetrix ()
{
   test -x /usr/symcli/bin/sympd || return

   print ""
   print "==========================="
   print "DETAILED SYMETRIX INFORMATION"
   print "==========================="
   print ""

   display_info "" "sympd list"            
   display_info "All Symetrix RDFs" "symrdf list"            
   display_info "All Symetrix devices" "symdev list"            
   display_info "All Symetrix DISKs" "symdev list -da all"    
   display_info "All Powerpath Devices" "sympd  list -powerpath" 
   display_info "All Symetrix Device Groups" "symdg  list"            
   display_info "All Symetrix Device groups-verbose" "symdg  list -v"         
   display_info "Symetrix Configuration" "symcfg list -v"         
   display_info "BCV Configuration" "symbcv list"            

   display_info "EMC disk info by three different commands" "count_EMC"            

   return 0
}

################################################################################
##
##  Subroutine: List tunables information
##
################################################################################
list_tunables () 
{
   print ""
   print "==========================="
   print "TUNABLES INFORMATION"
   print "==========================="
   print ""

#  display_info "ioo tunables" "ioo -L"
#  display_info "vmo tunables" "wmo -L"
   display_info "no tunables" "no -a"
   display_info "nfso tunables" "nfso -a"
#  display_info "schedo tunables" "schedo -L"

   return 0
}

################################################################################
##
##  Subroutine: Display command information in a nice format
##
################################################################################
display_info ()
{
   print "$1 [$2] \n------------------------------------------------------------------------------ \n$(eval $2)\n"
   return 0
}

display_info1 ()
{
   print "$1 [$2] \n------------------------------------------------------------------------------ \n"
   eval $2
   print "\n"
   return 0
}


#########################################################################
##
##  MAIN PROGRAM
##
#########################################################################
PROGNAME=$0

print "#start"
print "Program started on $(hostname) on $(date '+%a, %h %d at %r')"
print ""

#########################################################################
##
##  Trap for a ^C break; send to separate function
##
#########################################################################
trap exit_break 2

## List Machine/Version Information
list_machine

## List volume group information
list_vgs

## List Logical Volume Information
list_lvs

## List Physical Volume information
list_pvs

## List Startup information
list_startup

## List filesystem information
list_fs

## List Paging Spaces
list_ps

## List user and group information
list_users

##  List network information
list_net

##  List network tuning information
list_no

## List Device information
list_devs

## List licensed production information
list_lpp

## List symetrix EMC informations
list_symetrix
##

## List tunables 
list_tunables 
##

print ""
print "Program completed on $(hostname) on $(date '+%a, %h %d at %r')"
print ""
print "#end"

##
##  Exit with a successful status; Program completed
##
exit 0
------------------------------------------
0
Reply Mike 3/30/2005 7:21:20 PM


"jdunphy" <dunphyj@gmail.com> writes:

> i'm looking for a AIX5.1 command which will print out all system
> resources ie disks, cpu (speed), memory (physcal / virtual), IP, model
> #, serial # pretty much everything you need for a systen aduit. thanks
> 

http://servdoc.sourceforge.net

Uli

-- 
                             '''
                             (0 0)
                +------oOO----(_)--------------+
                |                              |
                |         Ulrich Herbst        |
                |                              |
                |      Ulrich.Herbst@gmx.de    |
                +-------------------oOO--------+
                            |__|__|
                             || ||
                            ooO Ooo
0
Reply Ulrich 4/28/2005 5:06:55 AM

Mike that script works AWSOME i turned it over to my level 1 admins and
it has made there invetory task much eaiser now they are asking if you
have any thing like that for sun servers

0
Reply jdunphy 5/24/2005 3:37:05 AM

3 Replies
85 Views

(page loaded in 0.06 seconds)

Similiar Articles:








7/24/2012 7:38:58 PM


Reply: