Solved

solaris system information

Posted on 2011-09-27
10
469 Views
Last Modified: 2012-05-12
Hi,

I am writing a shell script in solaris that will capture the system information like below

echo "$HOSTNAME"
echo "----------------------------------"
echo "Hostname                          
echo "Host IP address(es)             
echo "Main Memory (MB)            
echo "Physical CPUs on Machine       
echo "Number of Cores per CPU           
echo "Total Number of CPUs/ Virtual CPU        
echo "CPU Type                    
echo "OS Name                                    
echo "OS Release                       
echo "OS Architecture (32/64)         
echo "Kernel Version                    
echo "Hardware Manufacturer         
echo "Hardware Make/Model                     

The above script I had it for Linux and works good. Since the linux commands wont work on Solaris i need another sets of commands..

Please help
0
Comment
Question by:luser9999
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
10 Comments
 

Author Comment

by:luser9999
ID: 36708628
so far I found,

HOSTNAME=`hostname`
IP_ADDRS=`/sbin/ifconfig -a | grep 'inet' | grep -v '127.0.0.1' | cut -f2 -d ' '`
IP_ADDRS=`echo $IP_ADDRS | sed 's/\n//g'`

MEMORY=`/usr/sbin/prtconf | grep 'Memory' | cut -f2 -d ":"`
0
 

Author Comment

by:luser9999
ID: 36708754
can any one please respond .. kind of urgent

thanks
0
 
LVL 7

Expert Comment

by:Jacobfw
ID: 36708838
0
Independent Software Vendors: We Want Your Opinion

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

 
LVL 7

Expert Comment

by:Jacobfw
ID: 36708845
prtdiag may have additional information that you want
0
 
LVL 7

Expert Comment

by:Jacobfw
ID: 36708847
/usr/platform/`uname -i`/sbin/prtdiag -v

/usr/sbin/prtconf
0
 

Author Comment

by:luser9999
ID: 36708944
I am running on a vm based x86 solaris instance and above commands does not much of help..

I finally need the following, if you can give me a command that would be great...
Physical CPUS :
Number of cores per CPU
Total number of CPU/ virtual CPU
CPU MHz
OS Architecture
OS Kernel
Hardware model/ vendor

thanks
0
 

Author Comment

by:luser9999
ID: 36709018
can some one tell me if these are correct

NPROC=`(/usr/bin/kstat -m cpu_info | grep chip_id | sort -u | wc -l | tr -d ' ')`
VPROC=`(/usr/bin/kstat -m cpu_info | grep 'module: cpu_info' | sort -u | wc -l | tr -d ' ')`
NCORE=`(/usr/bin/kstat -m cpu_info | grep core_id | awk '{ print $2 }'| sort -u | wc -l | tr -d ' ')`
CORES=$(($VPROC/$NCORE))

NPROC= number of physical processor
VPROC virtual processors
NCORE- number of cores
CORES cores per cpu
0
 
LVL 79

Expert Comment

by:arnold
ID: 36710207
uname -a has information that will indicate which platform it is on Sparc or the alternative.
more /etc/release
0
 
LVL 1

Accepted Solution

by:
asmodeus66 earned 500 total points
ID: 36716136
are you looking for something like this
echo `/usr/bin/hostname`
echo "----------------------------------"
echo "Hostname "`/usr/bin/hostname`
echo "Host IP address(es)" $(/sbin/ifconfig -a | /usr/bin/awk 'BEGIN {ips=""} /inet/ && $2 !~ /127.0.0/ {ips=ips", "$2} END {print substr(ips,3)}')
echo "Main Memory (MB)" $(/usr/sbin/prtconf | /usr/bin/awk '/Memory size/ {print $3,$4}')
echo "Physical CPUs on Machine"$(/usr/sbin/psrinfo -pv | grep 'The physical' | /usr/bin/wc -l)
echo "Number of Cores per CPU "$(/usr/sbin/psrinfo -pv | /usr/bin/head -1 | /usr/bin/awk '{print $5}')
echo "Total Number of CPUs/ Virtual CPU"$(/usr/sbin/psrinfo | /usr/bin/wc -l)
echo "CPU Type" $(/usr/sbin/psrinfo -pv | /usr/bin/awk '{if (NR==2) print $1}')
echo "OS Name" $(uname -s)
echo "OS Release" $(uname -r)
echo "OS Architecture (32/64)" $(/usr/bin/file /platform/`uname -i`/kernel/unix | /usr/bin/awk '{print $3}')
echo "Kernel Version" $(uname -v)
/usr/platform/`uname -i`/sbin/prtdiag -v | head -1 | \
 nawk -v tag=`uname -m` \
 'BEGIN {manuf="";model="";arch=0}
  {for (i=3; i<=NF; i++)
   { if ($i==tag) {arch=1;continue}
     if (arch==0) manuf=manuf " " $i;
      else model=model " " $i}
   }
   END {printf("Hardware Manufacturer%s\n",manuf);
        printf("Hardware Make/Model%s\n",model)}'

Open in new window


Example output
user@host ~ $./test.sh
host
----------------------------------
Hostname hostname
Host IP address(es) 10.x.x.x, 10.x.x.x, 10.x.x.x, 10.x.x.x, 10.x.x.x, 10.x.x.x, 10.x.x.x, 10.x.x.x, 10.x.x.x
Main Memory (MB) 130848 Megabytes
Physical CPUs on Machine 2
Number of Cores per CPU 64
Total Number of CPUs/ Virtual CPU 128
CPU Type UltraSPARC-T2+
OS Name SunOS
OS Release 5.10
OS Architecture (32/64) 64-bit
Kernel Version Generic_142909-17
Hardware Manufacturer Sun Microsystems
Hardware Make/Model T3-1

Open in new window


tested on t3/t5240/M5000
0

Featured Post

Technology Partners: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Java performance on Solaris - Managing CPUs There are various resource controls in operating system which directly/indirectly influence the performance of application. one of the most important resource controls is "CPU".   In a multithreaded…
Background Still having to process all these year-end "csv" files received from all these sources (including Government entities), sometimes we have the need to examine the contents due to data error, etc... As a "Unix" shop, our only readily …
Learn several ways to interact with files and get file information from the bash shell. ls lists the contents of a directory: Using the -a flag displays hidden files: Using the -l flag formats the output in a long list: The file command gives us mor…
This video shows how to set up a shell script to accept a positional parameter when called, pass that to a SQL script, accept the output from the statement back and then manipulate it in the Shell.
Suggested Courses

628 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question