/[sysadmin-cookbook]/recepies/smart/dump-smart.sh
This is repository of my old source code which isn't updated any more. Go to git.rot13.org for current projects!
ViewVC logotype

Annotation of /recepies/smart/dump-smart.sh

Parent Directory Parent Directory | Revision Log Revision Log


Revision 277 - (hide annotations)
Thu Sep 29 20:47:11 2011 UTC (12 years, 6 months ago) by dpavlin
File MIME type: application/x-sh
File size: 915 byte(s)
extended dumper which also dumps controller information
1 dpavlin 277 #!/bin/sh -x
2    
3     tw_cli=/srv/3ware/x86_64/tw_cli
4     sas2ircu=/srv/sas2ircu_linux_x86_rel/sas2ircu
5    
6     cd /srv/smart
7     dir=`hostname -s`
8     test -d $dir || mkdir $dir
9     cd $dir
10     #ls -d /sys/block/sd* | cut -d/ -f4 | xargs -i sh -cx "/usr/sbin/smartctl -a /dev/{} > smart.{}"
11    
12     if [ -z "$DEBUG" ] ; then
13    
14     ls /dev/disk/by-id/scsi-* | grep -v part[0-9]* | while read dev ; do
15     echo $dev
16     name=`echo $dev | sed 's/^.*scsi-//'`
17     sudo smartctl -a $dev > smart.$name
18     done
19    
20     fi
21    
22     test -x $sas2ircu && $sas2ircu LIST | grep 1000h | awk '{ print $1 }' | xargs -i $sas2ircu {} DISPLAY > controller.lsi_sysbios
23    
24     if [ -x $tw_cli ] ; then
25     controller=`$tw_cli show | grep ^c[0-9] | cut -d" " -f1`
26     if [ ! -z "$controller" ] ; then
27     $tw_cli /$controller show all > controller.3ware
28     $tw_cli /$controller/bbu show all >> controller.3ware
29     fi
30     fi
31    
32     test ! -z "$DEBUG" && exit 1
33    
34     git add smart.sd* controller.*
35     git commit -m `date +%Y-%m-%d.%H:%M:%S` -a

Properties

Name Value
svn:executable *

  ViewVC Help
Powered by ViewVC 1.1.26