root@nas:~# lsusb |grep Disk Bus 001 Device 002: ID 152d:2336 JMicron Technology Corp. / JMicron USA Technology Corp. Hard Disk Drive root@nas:~# /usr/sbin/smartctl -a -d usbjmicron,0 /dev/sdc|grep Cels 194 Temperature_Celsius 0x0022 044 055 000 Old_age Always - 44 (0 18 0 0 0) root@nas:~# /usr/sbin/smartctl -a -d usbjmicron,1 /dev/sdd|grep Cels 194 Temperature_Celsius 0x0022 045 058 000 Old_age Always - 45 (0 18 0 0 0)
Et avec dd :
root@machine:~# dd if=/dev/mem bs=32k skip=31 count=1 | strings -n 8 | grep -i bios 1+0 records in 1+0 records out 32768 bytes (33 kB) copied, 0.00120498 seconds, 27.2 MB/s IBM COMPATIBLE 486 BIOS COPYRIGHT Phoenix Technologies, Ltd Phoenix-Award BIOS v6.00PG
root@serverl0104185:~# hpacucli controller slot=0 pd 2:0 show Smart Array 6i in Slot 0 physicaldrive 2:0 SCSI Bus: 2 SCSI ID: 0 Status: OK Drive Type: Data Drive Interface Type: Parallel SCSI Size: 72.8 GB Transfer Mode: Ultra 320 Wide Transfer Speed: 320 MB/Sec Rotational Speed: 10000 Firmware Revision: HPBC serialnumber: D214949K
Sur la machine à monitorer, modifier le fichier /etc/snmp/snmpd.conf :
rocommunity dtc # Following entries were added by HP Insight Management Agents at # Fri Feb 26 13:02:43 CET 2010 dlmod cmaX /usr/lib64/libcmaX64.so rwcommunity dtcrw 127.0.0.1 rocommunity dtc X.X.X.X rocommunity dtc localhost trapsink X.X.X.X dtc syscontact Root <root@localhost> (configure /etc/snmp/snmp.local.conf) syslocation DTC(edit /etc/snmp/snmpd.conf)
De cette manière hpshm pourra accéder via SNMP (Data Source).
Pour avoir l'aide omreport -?, puis omreport chassis -?, etc.
omreport chassis info
omreport chassis memory
omreport chassis nics index=0
omreport chassis processors
root@server7712123:~# omreport storage controller|grep ^ID ID : 0
root@server7712123:~# omreport storage vdisk controller=0 |egrep "ID|Name|Layout" ID : 0 Name : Virtual Disk 0 Layout : RAID-1 Device Name : /dev/sda ID : 1 Name : Virtual Disk 1 Layout : RAID-1 Device Name : /dev/sdb ID : 2 Name : Virtual Disk 2 Layout : RAID-1 Device Name : /dev/sdc
omconfig storage vdisk action=deletevdisk controller=0 vdisk=2
root@server7712123:~# omreport storage pdisk controller=0 |egrep "^ID|State" ID : 0:0:0 State : Online ID : 0:0:1 State : Online ID : 0:0:2 State : Ready ID : 0:0:3 State : Ready ID : 1:0:4 State : Ready ID : 1:0:5 State : Ready
omconfig storage controller action=createvdisk controller=0 raid=r10 size=max pdisk=0:0:2,0:0:3,1:0:4,1:0:5
root@server7712123:~# omreport storage vdisk controller=0 |egrep "ID|Name|Layout" ID : 0 Name : Virtual Disk 0 Layout : RAID-1 Device Name : /dev/sda ID : 1 Name : Virtual Disk 1 Layout : RAID-10 Device Name : /dev/sdb
root@server7712123:~# fdisk -l /dev/sdb Disk /dev/sdb: 145.4 GB, 145492017152 bytes 255 heads, 63 sectors/track, 17688 cylinders Units = cylinders of 16065 * 512 = 8225280 bytes Disk /dev/sdb doesn't contain a valid partition table
En conservant le format classique omreport :
omreport system alertlog |awk ' /^Severity/ {Sev=$0;S=$3} /^ID/ {Id=$0} /^Date/ {Date=$0} /^Category/ {Cat=$0} /^Desc/ {if (S!="Ok") {print Sev "\n" Id "\n" Date "\n" Cat "\n" $0"\n"}}'
En construisant sous la forme une alerte par ligne :
omreport system alertlog |awk ' /^Severity/ {$1="";$2="";Sev=$0} /^ID/ {$1="";$2="";Id=$0} /^Date/ {$1="";$2="";$3="";$4="";Date=$0} /^Category/ {$1="";$2="";Cat=$0} /^Desc/ {$1="";$2=""; print Sev ":" Id ":" Date ":" Cat ":" $0}'
Et pour avoir un état global du bousin :
echo "Etat du systeme" omreport system|grep :|grep -v "SEVERITY"|while read line;do echo " $line";done echo "Etat du chassis" omreport chassis|grep :|grep -v "SEVERITY"|while read line;do echo " $line";done listeControleur=`omreport storage controller|awk '/^ID/ {print $3}'` for controleur in $listeControleur do echo "Controleur $controleur" echo " Disques Physiques" omreport storage pdisk controller=$controleur|awk '/Status/ {status=$3} /Name/ {$1="";$2="";print " "status":"$0}' echo " Disques Virtuels" #omreport storage vdisk controller=$controleur|awk '/Status/ {status=$3} /^Name/ {$1="";$2="";print " "status":"$0}' omreport storage vdisk controller=$controleur|awk ' /Status/ {status=$3} /^Name/ {$1="";$2="";name=$0} /Device Name/ {$1="";$2="";$3="";print " "status":"name":"$0}' done
Index : 0 Slot ID : PCI1 Adapter : [Not Occupied] Data Bus Width : 8x or x8 -> PCI-Express Index : 1 Slot ID : PCI2 Adapter : [Not Occupied] Data Bus Width : 64 Bits -> PCI-X Index : 2 Slot ID : PCI3 Adapter : [Not Occupied] Data Bus Width : 64 Bits -> PCI-X
Par contre en priorité il faut installer les cartes d'abord sur le PCI3 après le PCI2 et ensuite le 1.