Solved

solaris system information

Posted on 2011-09-27
10
465 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
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!

 
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 78

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

[Webinar] Code, Load, and Grow

Managing multiple websites, servers, applications, and security on a daily basis? Join us for a webinar on May 25th to learn how to simplify administration and management of virtual hosts for IT admins, create a secure environment, and deploy code more effectively and frequently.

Question has a verified solution.

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

Suggested Solutions

Let's say you need to move the data of a file system from one partition to another. This generally involves dismounting the file system, backing it up to tapes, and restoring it to a new partition. You may also copy the file system from one place to…
Why Shell Scripting? Shell scripting is a powerful method of accessing UNIX systems and it is very flexible. Shell scripts are required when we want to execute a sequence of commands in Unix flavored operating systems. “Shell” is the command line i…
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…
Learn how to get help with Linux/Unix bash shell commands. Use help to read help documents for built in bash shell commands.: Use man to interface with the online reference manuals for shell commands.: Use man to search man pages for unknown command…

739 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