• Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 415
  • Last Modified:

script to find system configuration solaris

Dear experts -

I would like  if any one of you has a script to find system configuration in solaris such as
 Hostname, OS version, Kernel version, Processor/CPU, Total RAM, Hard disks,mount points

appreciate your help

Regards
0
akp007
Asked:
akp007
2 Solutions
 
AmolCommented:
No need of script,

Run the following command,

prtdiag -v - processor/CPU info
prtconf -v | grep Mem -  Total Memory
df -h - Filesystems or mount points
format - hard disks
uname -a - hostname and version
0
 
turnbulldCommented:
Here ya go.  You'll want to add echo or printf statements to separate and format the output.
#!/bin/sh

#Hostname
hostname

#OS version
cat /etc/release | head -1

#Kernel version
uname -a

#Processor/CPU
prtdiag -v | while read LN; do 
  echo $LN | grep "Processor Sockets" > /dev/null 2>&1
  rval=$?
  if [ $rval -eq 0 ]; then
    fnd=0
  else
    if [ "X${fnd}" = "X0" ]; then
      tst_char=`echo $LN | cut -c1`
      if [ "X${tst_char}" = "X=" ]; then
        break
      else
        echo $LN | grep "^Version" > /dev/null 2>&1
        rval=$?
        if [ ! ${rval} -eq 0 ]; then
          echo $LN
        fi
      fi
    fi
  fi
done

  
#Total RAM
prtconf -v | grep "^Memory"

#Hard disks
echo \0 | format | while read LN; do   
  echo $LN | grep "^AVAIL" > /dev/null 2>&1
  rval=$?
  if [ $rval -eq 0 ]; then
    fnd=0
  else
    if [ "X${fnd}" = "X0" ]; then
      echo $LN | grep "^Specify" > /dev/null 2>&1
      rval=$?
      if [ ! $rval -eq 0 ]; then
        echo $LN
      else 
        break
      fi
    fi
  fi
done

#mount points
df -k

Open in new window

0
 
akp007Author Commented:
Thanks for the timely help

Regards
0

Featured Post

Get your problem seen by more experts

Be seen. Boost your question’s priority for more expert views and faster solutions

Tackle projects and never again get stuck behind a technical roadblock.
Join Now