Pages

Wednesday, December 21, 2016

Linux script sample 1. A good example of for loop, sed, cut, if

==============
usb-device.sh
==============
Script for checking usb devices.The actual logic not importatnt - just a good example of for loop, sed, cut, etc...

for dir in `find /proc/bus/usb -type d -regex .+[0-9]+`
do
   bus=`basename $dir` 
   cntl=`echo $bus | sed 's/^0*/usb/' `
   interface="0"

   for device in `lsusb -s $bus: |cut -d' ' -f4|sed -e 's/://' | tr '\n' ' '`
   do
      devicetype=`lsusb -v -s $bus:$device | grep bDeviceClass | sed -e 's/^ *bDeviceClass \+[0-9]\+ //'`
      manufacturer=`lsusb -v -s $bus:$device | grep iManufacturer | sed -e 's/^ *iManufacturer \+[0-9]\+ //'`
      interfaceSubClass=`lsusb -v -s $bus:$device | grep bInterfaceSubClass | sed -e 's/^ *bInterfaceSubClass \+[0-9]\+ //'`
      if [ "$interfaceSubClass" = "SCSI" ]; then
          i=1
          for interface in `lsusb -v -s $bus:$device | grep bInterfaceNumber | sed -e 's/^ *bInterfaceNumber \+//'`
          do
              product=`lsusb -v -s $bus:$device | grep iInterface | sed -e 's/^ *iInterface \+[0-9]\+ //' | head -n $i | tail -n 1`
              if [ -z "$product" ]; then 
                  product=`lsusb -v -s $bus:$device | grep iProduct | sed -e 's/^ *iProduct \+[0-9]\+ //' | head -n $i | tail -n 1`
              fi

              devicetype=`lsusb -v -s $bus:$device | grep bInterfaceClass | sed -e 's/^ *bInterfaceClass \+[0-9]\+ //' | head -n $i | tail -n 1`

              echo -e "$cntl\t$bus-$device-$interface\t$devicetype\t$product\t$manufacturer"

              i=`expr $i + 1`
          done
      else
          if [ "$interfaceSubClass" = "SCSI" ]; then
              product=`lsusb -v -s $bus:$device | grep iProduct | sed -e 's/^ *iProduct \+[0-9]\+ //'`
              #echo -e "$cntl\t$bus-$device\t$devicetype\t$product"
              echo -e "$cntl\t$bus-$device-$interface\t$devicetype\t$product\t$manufacturer"
          fi
      fi
   done
done

Thursday, December 8, 2016

ORACLE CPU Utilization

Check out the history

SELECT snap_id, 
       begin_time||'-'||end_time AS TIME,
       metric_name, 
       metric_unit,
       ROUND(maxval) MAX, ROUND(AVERAGE) AVG
 FROM DBA_HIST_SYSMETRIC_SUMMARY
WHERE UPPER(metric_name ) LIKE '%CPU%' 
  AND end_TIME > SYSDATE -3
ORDER BY metric_name ASC, snap_id DESC



SNAP_ID TIME                    METRIC_NAME              METRIC_UNIT              MAX AVG

------- ---------------------   -----------------------  ---------------------------      --- ---

  27535 20162911 07:59-08:59 CPU Usage Per Sec    CentiSeconds Per Second      292 36

  27534 20162911 06:59-07:59 CPU Usage Per Sec    CentiSeconds Per Second       19 14

  27533 20162911 05:59-06:59 CPU Usage Per Sec    CentiSeconds Per Second       25 15

  27532 20162911 04:59-05:59 CPU Usage Per Sec    CentiSeconds Per Second       58 16

  27531 20162911 04:00-04:59 CPU Usage Per Sec    CentiSeconds Per Second      392 26

  27530 20162911 03:00-04:00 CPU Usage Per Sec    CentiSeconds Per Second     1375 74
  27529 20162911 02:00-03:00 CPU Usage Per Sec    CentiSeconds Per Second      105 84
  27528 20162911 01:00-02:00 CPU Usage Per Sec    CentiSeconds Per Second      797 37
  27527 20162911 00:00-01:00 CPU Usage Per Sec    CentiSeconds Per Second      177 19

  27535 20162911 07:59-08:59 CPU Usage Per Txn    CentiSeconds Per Txn          53  6
  27534 20162911 06:59-07:59 CPU Usage Per Txn    CentiSeconds Per Txn           4  3
  27533 20162911 05:59-06:59 CPU Usage Per Txn    CentiSeconds Per Txn           4  3
  27532 20162911 04:59-05:59 CPU Usage Per Txn    CentiSeconds Per Txn          12  3
  27531 20162911 04:00-04:59 CPU Usage Per Txn    CentiSeconds Per Txn          32  4
  27530 20162911 03:00-04:00 CPU Usage Per Txn    CentiSeconds Per Txn         274 14
  27529 20162911 02:00-03:00 CPU Usage Per Txn    CentiSeconds Per Txn          21 16
  27528 20162911 01:00-02:00 CPU Usage Per Txn    CentiSeconds Per Txn          87  4
  27527 20162911 00:00-01:00 CPU Usage Per Txn    CentiSeconds Per Txn          37  4

  27535 20162911 07:59-08:59 Database CPU Time Ratio   % Cpu/DB_Time            10  2
  27534 20162911 06:59-07:59 Database CPU Time Ratio   % Cpu/DB_Time             2  1
  27533 20162911 05:59-06:59 Database CPU Time Ratio   % Cpu/DB_Time             2  1
  27532 20162911 04:59-05:59 Database CPU Time Ratio   % Cpu/DB_Time             5  1
  27531 20162911 04:00-04:59 Database CPU Time Ratio   % Cpu/DB_Time             4  2
  27530 20162911 03:00-04:00 Database CPU Time Ratio   % Cpu/DB_Time             56 5
  27529 20162911 02:00-03:00 Database CPU Time Ratio   % Cpu/DB_Time              9 8
  27528 20162911 01:00-02:00 Database CPU Time Ratio   % Cpu/DB_Time             37 3
  27527 20162911 00:00-01:00 Database CPU Time Ratio   % Cpu/DB_Time              3 1

  27535 20162911 07:59-08:59 Host CPU Utilization (%)  % Busy/(Idle+Busy)      100 68
  27534 20162911 06:59-07:59 Host CPU Utilization (%)  % Busy/(Idle+Busy)       64 62
  27533 20162911 05:59-06:59 Host CPU Utilization (%)  % Busy/(Idle+Busy)      100 59
  27532 20162911 04:59-05:59 Host CPU Utilization (%)  % Busy/(Idle+Busy)       99 46
  27531 20162911 04:00-04:59 Host CPU Utilization (%)  % Busy/(Idle+Busy)       92 45
  27530 20162911 03:00-04:00 Host CPU Utilization (%)  % Busy/(Idle+Busy)       88 64
  27529 20162911 02:00-03:00 Host CPU Utilization (%)  % Busy/(Idle+Busy)      100 73
  27528 20162911 01:00-02:00 Host CPU Utilization (%)  % Busy/(Idle+Busy)       95 64  
  27527 20162911 00:00-01:00 Host CPU Utilization (%)  % Busy/(Idle+Busy)       82 58

SELECT snap_id, 
       begin_time||'-'||end_time AS TIME,
       metric_name, 
       metric_unit,
       ROUND(maxval) MAX, ROUND(AVERAGE) AVG
 FROM DBA_HIST_SYSMETRIC_SUMMARY
WHERE UPPER(metric_name ) LIKE '%PARSE%' 
  AND end_TIME > SYSDATE -3
ORDER BY metric_name ASC, snap_id DESC


SNAP_ID TIME                 METRIC_NAME                 METRIC_UNIT              MAX AVG
------- -------------------- --------------------------- -----------------------  --- ---
27535 20162911 07:59-08:59 Execute Without Parse Ratio %(ExecWOParse/TotalExec)   100  80
27534 20162911 06:59-07:59 Execute Without Parse Ratio %(ExecWOParse/TotalExec)    86  84
27533 20162911 05:59-06:59 Execute Without Parse Ratio %(ExecWOParse/TotalExec)    87  83
27532 20162911 04:59-05:59 Execute Without Parse Ratio %(ExecWOParse/TotalExec)    87  84
27531 20162911 04:00-04:59 Execute Without Parse Ratio %(ExecWOParse/TotalExec)    87  82
27530 20162911 03:00-04:00 Execute Without Parse Ratio %(ExecWOParse/TotalExec)    99  86
27529 20162911 02:00-03:00 Execute Without Parse Ratio %(ExecWOParse/TotalExec)   100  87
27528 20162911 01:00-02:00 Execute Without Parse Ratio %(ExecWOParse/TotalExec)    87  82
27527 20162911 00:00-01:00 Execute Without Parse Ratio %(ExecWOParse/TotalExec)    86  82
27535 20162911 07:59-08:59 Hard Parse Count Per Sec  Parses Per Second              6   0
27534 20162911 06:59-07:59 Hard Parse Count Per Sec  Parses Per Second              5   0
27533 20162911 05:59-06:59 Hard Parse Count Per Sec  Parses Per Second              7   0
27532 20162911 04:59-05:59 Hard Parse Count Per Sec  Parses Per Second              7   0
27531 20162911 04:00-04:59 Hard Parse Count Per Sec  Parses Per Second             53   2
27530 20162911 03:00-04:00 Hard Parse Count Per Sec  Parses Per Second             64   4
27529 20162911 02:00-03:00 Hard Parse Count Per Sec  Parses Per Second            188  20
27528 20162911 01:00-02:00 Hard Parse Count Per Sec  Parses Per Second             40 2
27527 20162911 00:00-01:00 Hard Parse Count Per Sec  Parses Per Second             50   1
27535 20162911 07:59-08:59 Hard Parse Count Per Txn  Parses Per Txn                 1   0
27534 20162911 06:59-07:59 Hard Parse Count Per Txn  Parses Per Txn                 1   0
27533 20162911 05:59-06:59 Hard Parse Count Per Txn  Parses Per Txn                 1   0
27532 20162911 04:59-05:59 Hard Parse Count Per Txn  Parses Per Txn                 1   0
27531 20162911 04:00-04:59 Hard Parse Count Per Txn  Parses Per Txn                 4   0
27530 20162911 03:00-04:00 Hard Parse Count Per Txn  Parses Per Txn                 4   0
27529 20162911 02:00-03:00 Hard Parse Count Per Txn  Parses Per Txn                 38  4
27528 20162911 01:00-02:00 Hard Parse Count Per Txn  Parses Per Txn                 3   0
27527 20162911 00:00-01:00 Hard Parse Count Per Txn  Parses Per Txn                 3   0
27535 20162911 07:59-08:59 Parse Failure Count Per Sec Parses Per Second     0   0
27534 20162911 06:59-07:59 Parse Failure Count Per Sec Parses Per Second     0   0
27533 20162911 05:59-06:59 Parse Failure Count Per Sec Parses Per Second     0   0
27532 20162911 04:59-05:59 Parse Failure Count Per Sec Parses Per Second     0   0
27531 20162911 04:00-04:59 Parse Failure Count Per Sec Parses Per Second    19   0
27530 20162911 03:00-04:00 Parse Failure Count Per Sec Parses Per Second    21 1
27529 20162911 02:00-03:00 Parse Failure Count Per Sec Parses Per Second     0 0
27528 20162911 01:00-02:00 Parse Failure Count Per Sec Parses Per Second    11   0
27527 20162911 00:00-01:00 Parse Failure Count Per Sec Parses Per Second    11   0
27535 20162911 07:59-08:59 Soft Parse Ratio        % SoftParses/TotalParses   100  99
27534 20162911 06:59-07:59 Soft Parse Ratio        % SoftParses/TotalParses   100 100
27533 20162911 05:59-06:59 Soft Parse Ratio        % SoftParses/TotalParses   100 100
27532 20162911 04:59-05:59 Soft Parse Ratio        % SoftParses/TotalParses   100 100
27531 20162911 04:00-04:59 Soft Parse Ratio          % SoftParses/TotalParses   100  98
27530 20162911 03:00-04:00 Soft Parse Ratio        % SoftParses/TotalParses   100  97
27529 20162911 02:00-03:00 Soft Parse Ratio        % SoftParses/TotalParses   100  96
27528 20162911 01:00-02:00 Soft Parse Ratio        % SoftParses/TotalParses   100  98
27527 20162911 00:00-01:00 Soft Parse Ratio        % SoftParses/TotalParses   100  99
27535 20162911 07:59-08:59 Total Parse Count Per Sec Parses Per Second   118  50
27534 20162911 06:59-07:59 Total Parse Count Per Sec Parses Per Second    59  31
27533 20162911 05:59-06:59 Total Parse Count Per Sec Parses Per Second   343  37
27532 20162911 04:59-05:59 Total Parse Count Per Sec Parses Per Second    74  29
27531 20162911 04:00-04:59 Total Parse Count Per Sec Parses Per Second   188  37
27530 20162911 03:00-04:00 Total Parse Count Per Sec Parses Per Second   369  70
27529 20162911 02:00-03:00 Total Parse Count Per Sec Parses Per Second  1532 156
27528 20162911 01:00-02:00 Total Parse Count Per Sec Parses Per Second   177  38
27527 20162911 00:00-01:00 Total Parse Count Per Sec Parses Per Second   273  35
27535 20162911 07:59-08:59 Total Parse Count Per Txn Parses Per Txn            22   9
27534 20162911 06:59-07:59 Total Parse Count Per Txn Parses Per Txn         9   6
27533 20162911 05:59-06:59 Total Parse Count Per Txn Parses Per Txn            55   7
27532 20162911 04:59-05:59 Total Parse Count Per Txn Parses Per Txn            14   6
27531 20162911 04:00-04:59 Total Parse Count Per Txn Parses Per Txn             35   7
27530 20162911 03:00-04:00 Total Parse Count Per Txn Parses Per Txn            38  12
27529 20162911 02:00-03:00 Total Parse Count Per Txn Parses Per Txn           294  30
27528 20162911 01:00-02:00 Total Parse Count Per Txn Parses Per Txn            30   6
27527 20162911 00:00-01:00 Total Parse Count Per Txn Parses Per Txn            18   6




Check on the Parse Wait Stats
http://www.databasejournal.com/features/oracle/article.php/10893_3341851_2/Parsing-in-Oracle.htm



Possible Solutions
Option one to reduce hard parse events:
1. SELECT name, value FROM V$PARAMETER WHERE name LIKE '%cursor%'
2. Change CURSOR SHARING from EXACT which is the default to SIMILAR
ALTER SYSTEM SET CURSOR_SHARING = 'SIMILAR'

Oracle by Example - ORA-09968: unable to lock file

====================
General
====================
Oracle has stopped unexpectedly, without any apparent error in alert.log
When trying to startup after this shutdown, following error appears:
ORA-09968: unable to lock file

====================
alert.log
====================
Starting up 1 dispatcher(s) for network address '(ADDRESS=(PARTIAL=YES)(PROTOCOL=TCP))'...
Thu Nov 24 14:54:48 2016
MMNL started with pid=16, OS id=578
starting up 1 shared server(s) ...
Oracle Data Guard is not available in this edition of Oracle.
ORACLE_BASE from environment = /software/oracle
Thu Nov 24 14:54:48 2016
ALTER DATABASE   MOUNT
sculkget: failed to lock /software/oracle/111/dbs/lkIGT exclusive
sculkget: lock held by PID: 2278
ORA-09968: unable to lock file
Linux-x86_64 Error: 11: Resource temporarily unavailable
Additional information: 2278
ORA-1102 signalled during: ALTER DATABASE   MOUNT...
Thu Nov 24 14:54:54 2016
Shutting down instance (abort)
License high water mark = 1
USER (ospid: 2127): terminating the instance
Instance terminated by USER, pid = 2127

====================
Solution
====================
Per Oracle Metalink #160395

fact: Oracle Server - Enterprise Edition
fact: Unix platforms only
symptom: Database startup fails
symptom: ORA-01102: cannot mount database in EXCLUSIVE mode
symptom: ORA-09968: scumnt: unable to lock file
symptom: The lk<SID> file is created successfully

cause: There are some client shadow processes hanging. Although the lk<SID> file is deleted the hanging processes still have a lock on the open file handle. This prevents the database to startup although a new lk<SID> file can be created successfully.

An oracle process (background or shadow process) that exists while the instance 
is not started (crashed or not cleanly stopped) can have a lock on a file while 
this file is actually removed from the system. This is because on UNIX there is 
still a lock on the open file handle.

The fix:
Once Oracle is stopped, verify if there are existing oracle processes for the database :

  $ ps -ef | grep $ORACLE_SID

Kill the hanging processes to release the lock on the file handle :

  $ kill -signal <PID>

Monday, December 5, 2016

Storage - HP CLI commands by example

======================
Commands Index
======================
For some reason the I/O on a system was very time consuming.
When checking with HP CLI commands, it was evident that the CompactFlash Controller components are faulted, making writes to the disk to be without cache, and as a result very slow.

======================
General commands:
======================
lsscsi
iostat

======================
HP CLI commands:
======================
show system
show time
show vdisks
show disks
show events error last 100


======================
HP hpacucli commands:
======================
HPACUCLI stands for HP Array Configuration Utility CLI.
HPACUCLI Reference

======================
HP hpssacli commands:
======================
HOSSACLI Reference
======================


======================

Examples
======================


root@db_server:~>% lsscsi
[1:0:9:0]    enclosu HP       P2000 G3 SAS     T250  -      
[1:0:9:10]   disk    HP       P2000 G3 SAS     T250  /dev/sdai
[1:0:9:11]   disk    HP       P2000 G3 SAS     T250  /dev/sdaj
[1:0:9:12]   disk    HP       P2000 G3 SAS     T250  /dev/sdak
[1:0:9:13]   disk    HP       P2000 G3 SAS     T250  /dev/sdal
[1:0:9:14]   disk    HP       P2000 G3 SAS     T250  /dev/sdam
[1:0:9:15]   disk    HP       P2000 G3 SAS     T250  /dev/sdan
[1:0:9:16]   disk    HP       P2000 G3 SAS     T250  /dev/sdao
[1:0:9:17]   disk    HP       P2000 G3 SAS     T250  /dev/sdap
[1:0:9:18]   disk    HP       P2000 G3 SAS     T250  /dev/sdaq
[1:0:9:19]   disk    HP       P2000 G3 SAS     T250  /dev/sdar
[1:0:9:20]   disk    HP       P2000 G3 SAS     T250  /dev/sdas
[1:0:9:21]   disk    HP       P2000 G3 SAS     T250  /dev/sdat
[1:0:9:22]   disk    HP       P2000 G3 SAS     T250  /dev/sdau
[1:0:9:23]   disk    HP       P2000 G3 SAS     T250  /dev/sdav
[1:0:9:24]   disk    HP       P2000 G3 SAS     T250  /dev/sdaw
[1:0:9:25]   disk    HP       P2000 G3 SAS     T250  /dev/sdax
[1:0:9:26]   disk    HP       P2000 G3 SAS     T250  /dev/sday
[1:0:9:27]   disk    HP       P2000 G3 SAS     T250  /dev/sdaz
[1:0:9:28]   disk    HP       P2000 G3 SAS     T250  /dev/sdba
[1:0:9:29]   disk    HP       P2000 G3 SAS     T250  /dev/sdbb
[1:0:9:30]   disk    HP       P2000 G3 SAS     T250  /dev/sdbc
[1:0:9:31]   disk    HP       P2000 G3 SAS     T250  /dev/sdbd
[1:0:9:32]   disk    HP       P2000 G3 SAS     T250  /dev/sdbe
[1:0:9:33]   disk    HP       P2000 G3 SAS     T250  /dev/sdbf
[1:0:9:34]   disk    HP       P2000 G3 SAS     T250  /dev/sdbg
[1:0:9:35]   disk    HP       P2000 G3 SAS     T250  /dev/sdbh
[1:0:9:36]   disk    HP       P2000 G3 SAS     T250  /dev/sdbi
[1:0:9:37]   disk    HP       P2000 G3 SAS     T250  /dev/sdbj
[1:0:9:38]   disk    HP       P2000 G3 SAS     T250  /dev/sdbk
[1:0:9:39]   disk    HP       P2000 G3 SAS     T250  /dev/sdbl
[1:0:9:40]   disk    HP       P2000 G3 SAS     T250  /dev/sdbm
[1:0:9:41]   disk    HP       P2000 G3 SAS     T250  /dev/sdbn
[1:0:9:50]   disk    HP       P2000 G3 SAS     T250  /dev/sdbo
[1:0:9:52]   disk    HP       P2000 G3 SAS     T250  /dev/sdbp
[1:0:9:60]   disk    HP       P2000 G3 SAS     T250  /dev/sdbq
[1:0:9:61]   disk    HP       P2000 G3 SAS     T250  /dev/sdbr


root@db_server:~>% iostat
Linux 2.6.18-308.24.1.el5 (db_server)     12/05/2016

avg-cpu:  %user   %nice %system %iowait  %steal   %idle
           9.25    0.00    2.78    1.55    0.00   86.42

Device:            tps   Blk_read/s   Blk_wrtn/s   Blk_read   Blk_wrtn
cciss/c0d0       19.91       195.40       834.04 17116726059 73061406312
cciss/c0d0p1      0.01         0.00         0.00          0          0
cciss/c0d0p2     19.90         0.00         0.00          0          0
dm-0              0.00         0.00         0.00      49482      62136
dm-1              9.74        10.83        76.65  948509642 6714683808
dm-2              6.29         9.77        47.07  855453178 4123664168
dm-3             68.96         3.28       549.89  287077202 48170202184
dm-4              1.46         2.97        11.48  260490314 1005519912
dm-5              4.15         2.46        32.72  215611762 2866339352
dm-6              0.01         0.02         0.05    1578930    4773624
dm-7              0.02         0.07         0.11    6364480    9672624
dm-8              1.81        16.14        11.27 1413684858  986900392
dm-9              0.00         0.00         0.00       1832          0
dm-10             0.00         0.00         0.00       1832          0
dm-11             0.02         1.83         0.04  160358298    3839128
dm-12            15.41       144.36       104.45 12646223930 9149346952
dm-13             0.12         2.94         0.30  257146754   26323944
dm-14             0.00         0.00         0.00      47534      31910
dm-15             0.00         0.00         0.00       1832          0
dm-16             0.00         0.00         0.00       1832          0
dm-17             0.00         0.00         0.00        880          0
dm-18             0.00         0.00         0.00        880          0
dm-19             0.00         0.00         0.00        880          0
dm-20             0.00         0.00         0.00        920          0
dm-21             0.00         0.00         0.00        920          0
dm-22             0.00         0.00         0.00        920          0
dm-23             0.00         0.00         0.00        920          0
dm-24             0.00         0.00         0.00        920          0




cd /usr/local/etc/starhome/load_alarm/conf/
root@db_server:/usr/local/etc/starhome/load_alarm/conf>% cat load_alarm.conf
cpu_critical=90
cpu_warning=85
memory_critical=95
memory_warning=90
disk_critical=90
disk_warning=85
check_msa=1
msa_ip1=111.222.333.216
msa_ip2=111.222.333.217

root@db_server:/usr/local/etc/starhome/load_alarm/conf>% ssh 111.222.333.217
Password:
HP StorageWorks MSA Storage P2000 G3 SAS
System Name: my_system
System Location: MY_COMPANY
Version: TS250P002
# show system
System Information
------------------
System Name: my_system
System Contact: MY_COMPANY
System Location: MY_COMPANY
System Information: MY_COMPANY
Midplane Serial Number: 00557PO19E22A
Vendor Name: HP StorageWorks
Product ID: P2000 G3 SAS
Product Brand: MSA Storage
SCSI Vendor ID: HP
SCSI Product ID: P2000 G3 SAS
Enclosure Count: 1
Health: Degraded
Health Reason: A subcomponent of this component is unhealthy.
Supported Locales: English (English), Spanish (español), French (français), German (Deutsch), Italian (italiano), Japanese (æ¥Ã¦¬Ã¨Âª), Dutch (Nederlands), Chinese-Simplified (ç®Ã¤½Ã¤¸­Ã¦), Chinese-Traditional (ç¹Ã©«Ã¤¸­Ã¦), Korean (í국ì´)

  Unhealthy Component
  -------------------
  Component ID: Enclosure 1, Controller A, CompactFlash
  Health: Fault
  Health Reason: The component is not present.
  Health Recommendation: - Replace the FRU that contains this component.

  Unhealthy Component
  -------------------
  Component ID: Enclosure 1, Controller B, CompactFlash
  Health: Fault
  Health Reason: The component is not present.
  Health Recommendation: - Replace the FRU that contains this component.

  Unhealthy Component
  -------------------               
  Component ID: Disk 1.7
  Health: Degraded
  Health Reason: The disk may contain invalid metadata.
  Health Recommendation: - See "Troubleshooting Steps for Leftover Drives" in the HP MSA2000/P2000 Guided Troubleshooting Best Practices.


Success: Command completed successfully. (2016-12-05 13:04:00)


# show vdisks
Name    Size     Free     Own Pref   RAID   Disks Spr Chk  Status Jobs      Job%      Serial Number                    Drive Spin Down       
  Spin Down Delay       Health     Health Reason Health Recommendation
----------------------------------------------------------------------------------------------------------------------------------------------
vdisk1  4796.0GB 3536.0GB A   A      RAID10 16    0   64k  FTOL                       00c0ff19c45a0000e33c235200000000 Disabled              
  0                     OK                                            
vdisk2  1199.0GB 68.9GB   B   B      RAID10 4     0   64k  FTOL                       00c0ff19c4590000eb3c235200000000 Disabled              
  0                     OK                                            
vdisk3  599.5GB  59.4GB   A   A      RAID1  2     0   N/A  FTOL                       00c0ff19c45a0000ef3c235200000000 Disabled              
  0                     OK                                             
----------------------------------------------------------------------------------------------------------------------------------------------
Success: Command completed successfully. (2016-12-05 13:06:49)

# show disks
Location Serial Number         Vendor   Rev              How Used   Type Size    Rate*(Gb/s) SP Health    
  Health Reason                          
  Health Recommendation                                                                                             
--------------------------------------------------------------------------------------------------------------------
1.1      EA01PD51VTA01320      HP       HPD6             VDISK      SAS  600.1GB 3.0            OK        
                                          
  
1.2      EA01PD51VT1A1320      HP       HPD6             VDISK      SAS  600.1GB 6.0            OK        
                                          
  
1.3      EA01PD51VSKW1320      HP       HPD6             VDISK      SAS  600.1GB 6.0            OK        
                                          
  
1.4      EA01PD51VPG01320      HP       HPD6             VDISK      SAS  600.1GB 6.0            OK        
                                          
  
1.5      EA01PD51VPPV1320      HP       HPD6             VDISK      SAS  600.1GB 6.0            OK        
                                          
  
1.6      EA01PD51VT0K1320      HP       HPD6             VDISK      SAS  600.1GB 6.0            OK        
                                          
  
1.7      EA01PD51VSPC1320      HP       HPD6             LEFTOVR    SAS  600.1GB 6.0            Degraded  
  The disk may contain invalid metadata. 
  - See "Troubleshooting Steps for Leftover Drives" in the HP MSA2000/P2000 Guided Troubleshooting Best Practices.
1.8      EA01PD51VPPW1320      HP       HPD6             VDISK      SAS  600.1GB 6.0            OK        
                                          
  
1.9      EA01PD51VT1W1320      HP       HPD6             VDISK      SAS  600.1GB 6.0            OK        
                                          
  
1.10     EA01PD51VTEG1320      HP       HPD6             VDISK      SAS  600.1GB 6.0            OK        
                                          
                                     
1.11     EA01PD51VSMG1320      HP       HPD6             VDISK      SAS  600.1GB 6.0            OK        
                                          
  
1.12     EA01PD51VTDL1320      HP       HPD6             VDISK      SAS  600.1GB 6.0            OK        
                                          
  
1.13     EA01PD51VT0U1320      HP       HPD6             VDISK      SAS  600.1GB 6.0            OK         
                                          
  
1.14     EA01PD51VPGK1320      HP       HPD6             VDISK      SAS  600.1GB 6.0            OK        
                                          
  
1.15     EA01PD51W1B21321      HP       HPD6             VDISK      SAS  600.1GB 6.0            OK        
                                          
1.16     EA01PD51VSM01320      HP       HPD6             VDISK      SAS  600.1GB 3.0            OK        
                                          
  
1.17     EA01PD51W19G1321      HP       HPD6             VDISK      SAS  600.1GB 6.0            OK        
                                          
  
1.18     EA01PD51W0M71321      HP       HPD6             VDISK      SAS  600.1GB 6.0            OK         
                                          
  
1.19     EA01PD51W0M11321      HP       HPD6             VDISK      SAS  600.1GB 6.0            OK        
                                          
  
1.20     EA01PD51W14F1321      HP       HPD6             VDISK      SAS  600.1GB 6.0            OK        
                                          
  
1.21     EA01PD51VPRA1320      HP       HPD6             VDISK      SAS  600.1GB 6.0            OK        
                                          
                                     
1.22     EA01PD51VTDT1320      HP       HPD6             VDISK      SAS  600.1GB 6.0            OK        
                                          
  
1.23     EA01PD51W1211321      HP       HPD6             VDISK      SAS  600.1GB 3.0            OK        
                                          
  
1.24     EA01PD51W16U1321      HP       HPD6             AVAIL      SAS  600.1GB 6.0            OK        
                                          
  
--------------------------------------------------------------------------------------------------------------------
Info: * Rates may vary. This is normal behavior. (2016-12-05 13:06:55)

Success: Command completed successfully. (2016-12-05 13:06:55)

# show events error last 100
2016-12-05 11:18:28 [354] #B9887: P2000 G3 SAS Array SN#00C0FF19FA59 Controller B WARNING Host SAS topology was changed. (host port: 1, 0 out of 4 PHYs are up, link speed: Autonegotiated)  
2016-12-05 11:18:27 [354] #A11028: P2000 G3 SAS Array SN#00C0FF19FA59 Controller A WARNING Host SAS topology was changed. (host port: 1, 0 out of 4 PHYs are up, link speed: Autonegotiated)  
2016-12-04 15:25:52 [354] #B9881: P2000 G3 SAS Array SN#00C0FF19FA59 Controller B WARNING Host SAS topology was changed. (host port: 1, 0 out of 4 PHYs are up, link speed: Autonegotiated)  
2016-12-04 15:25:51 [354] #A11022: P2000 G3 SAS Array SN#00C0FF19FA59 Controller A WARNING Host SAS topology was changed. (host port: 1, 0 out of 4 PHYs are up, link speed: Autonegotiated)  
2016-12-04 12:01:54 [354] #A11015: P2000 G3 SAS Array SN#00C0FF19FA59 Controller A WARNING Host SAS topology was changed. (host port: 2, 0 out of 4 PHYs are up, link speed: Autonegotiated)  
2016-12-04 12:01:54 [354] #A11014: P2000 G3 SAS Array SN#00C0FF19FA59 Controller A WARNING Host SAS topology was changed. (host port: 1, 0 out of 4 PHYs are up, link speed: Autonegotiated)  
2016-12-04 12:01:06 [204] #A10990: P2000 G3 SAS Array SN#00C0FF19FA59 Controller A WARNING An error was detected related to the CompactFlash card.  
2016-12-04 12:01:06 [242] #A10989: P2000 G3 SAS Array SN#00C0FF19FA59 Controller A ERROR Auto-write-through trigger event: CompactFlash failed.  
2016-12-04 12:00:19 [112] #A10985: P2000 G3 SAS Array SN#00C0FF19FA59 Controller A WARNING Host link down. (port: 4)  
2016-12-04 12:00:19 [112] #A10984: P2000 G3 SAS Array SN#00C0FF19FA59 Controller A WARNING Host link down. (port: 3)  
2016-12-04 12:00:19 [112] #A10983: P2000 G3 SAS Array SN#00C0FF19FA59 Controller A WARNING Host link down. (port: 2)  
2016-12-04 12:00:19 [112] #A10982: P2000 G3 SAS Array SN#00C0FF19FA59 Controller A WARNING Host link down. (port: 1)  
2016-12-04 11:36:48 [354] #A10975: P2000 G3 SAS Array SN#00C0FF19FA59 Controller A WARNING Host SAS topology was changed. (host port: 2, 0 out of 4 PHYs are up, link speed: Autonegotiated)  
2016-12-04 11:36:48 [354] #A10974: P2000 G3 SAS Array SN#00C0FF19FA59 Controller A WARNING Host SAS topology was changed. (host port: 1, 0 out of 4 PHYs are up, link speed: Autonegotiated)  
2016-12-04 11:36:48 [354] #B9852: P2000 G3 SAS Array SN#00C0FF19FA59 Controller B WARNING Host SAS topology was changed. (host port: 2, 0 out of 4 PHYs are up, link speed: Autonegotiated)  
2016-12-04 11:36:48 [354] #B9851: P2000 G3 SAS Array SN#00C0FF19FA59 Controller B WARNING Host SAS topology was changed. (host port: 1, 0 out of 4 PHYs are up, link speed: Autonegotiated)  
2016-12-04 11:36:00 [204] #A10951: P2000 G3 SAS Array SN#00C0FF19FA59 Controller A WARNING An error was detected related to the CompactFlash card.  
2016-12-04 11:36:00 [242] #A10950: P2000 G3 SAS Array SN#00C0FF19FA59 Controller A ERROR Auto-write-through trigger event: CompactFlash failed.  
2016-12-04 11:35:13 [112] #A10946: P2000 G3 SAS Array SN#00C0FF19FA59 Controller A WARNING Host link down. (port: 4)  
2016-12-04 11:35:13 [112] #A10945: P2000 G3 SAS Array SN#00C0FF19FA59 Controller A WARNING Host link down. (port: 3)  
2016-12-04 11:35:13 [112] #A10944: P2000 G3 SAS Array SN#00C0FF19FA59 Controller A WARNING Host link down. (port: 2)  
2016-12-04 11:35:13 [112] #A10943: P2000 G3 SAS Array SN#00C0FF19FA59 Controller A WARNING Host link down. (port: 1)  
2016-12-04 11:28:13 [354] #B9828: P2000 G3 SAS Array SN#00C0FF19FA59 Controller B WARNING Host SAS topology was changed. (host port: 2, 0 out of 4 PHYs are up, link speed: Autonegotiated)  
2016-12-04 11:28:13 [354] #B9827: P2000 G3 SAS Array SN#00C0FF19FA59 Controller B WARNING Host SAS topology was changed. (host port: 1, 0 out of 4 PHYs are up, link speed: Autonegotiated)  
2016-12-04 11:27:26 [204] #A10912: P2000 G3 SAS Array SN#00C0FF19FA59 Controller A WARNING An error was detected related to the CompactFlash card.  
2016-12-04 11:27:26 [242] #A10911: P2000 G3 SAS Array SN#00C0FF19FA59 Controller A ERROR Auto-write-through trigger event: CompactFlash failed.  
2016-12-04 11:26:39 [112] #A10907: P2000 G3 SAS Array SN#00C0FF19FA59 Controller A WARNING Host link down. (port: 4)  
2016-12-04 11:26:39 [112] #A10906: P2000 G3 SAS Array SN#00C0FF19FA59 Controller A WARNING Host link down. (port: 3)  
2016-12-04 11:26:39 [112] #A10905: P2000 G3 SAS Array SN#00C0FF19FA59 Controller A WARNING Host link down. (port: 2)  
2016-12-04 11:26:39 [112] #A10904: P2000 G3 SAS Array SN#00C0FF19FA59 Controller A WARNING Host link down. (port: 1)  
2016-01-21 23:37:54 [495] #A9771: P2000 G3 SAS Array SN#00C0FF19FA59 Controller A WARNING The algorithm for best-path routing selected the alterna
te path to a disk because the I/O error count on the primary path reached its threshold. (disk: channel: 0, ID: 22, SN: EA01PD51W1211321, enclosure: 1, slot: 23)  
2016-01-21 23:37:16 [204] #B9071: P2000 G3 SAS Array SN#00C0FF19FA59 Controller B WARNING An error was detected related to the CompactFlash card.  
2016-01-21 23:37:16 [242] #B9070: P2000 G3 SAS Array SN#00C0FF19FA59 Controller B ERROR Auto-write-through trigger event: CompactFlash failed.  
2016-01-21 23:33:31 [354] #A9753: P2000 G3 SAS Array SN#00C0FF19FA59 Controller A WARNING Host SAS topology was changed. (host port: 2, 0 out of 4 PHYs are up, link speed: Autonegotiated)  
2016-01-21 23:33:31 [354] #A9752: P2000 G3 SAS Array SN#00C0FF19FA59 Controller A WARNING Host SAS topology was changed. (host port: 1, 0 out of 4 PHYs are up, link speed: Autonegotiated)  
2016-01-21 23:31:55 [084] #A9741: P2000 G3 SAS Array SN#00C0FF19FA59 Controller A WARNING Killed partner controller. (reason: Other not present)  
2016-01-21 23:25:51 [354] #A9732: P2000 G3 SAS Array SN#00C0FF19FA59 Controller A WARNING Host SAS topology was changed. (host port: 2, 0 out of 4 PHYs are up, link speed: Autonegotiated)  
2016-01-21 23:25:51 [354] #A9731: P2000 G3 SAS Array SN#00C0FF19FA59 Controller A WARNING Host SAS topology was changed. (host port: 1, 0 out of 4 PHYs are up, link speed: Autonegotiated)  
2016-01-21 23:25:49 [204] #B9043: P2000 G3 SAS Array SN#00C0FF19FA59 Controller B WARNING An error was detected related to the CompactFlash card.  
2016-01-21 23:25:49 [242] #B9042: P2000 G3 SAS Array SN#00C0FF19FA59 Controller B ERROR Auto-write-through trigger event: CompactFlash failed.  
2016-01-21 23:24:15 [084] #A9715: P2000 G3 SAS Array SN#00C0FF19FA59 Controller A WARNING Killed partner controller. (reason: Other not present)  
2016-01-21 23:20:55 [495] #A9694: P2000 G3 SAS Array SN#00C0FF19FA59 Controller A WARNING The algorithm for best-path routing selected the alternate path to a disk because the I/O error count on the primary path reached its threshold. (disk: channel: 0, ID: 22, SN: EA01PD51W1211321, enclosure: 1, slot: 23)  
2016-01-21 23:20:21 [204] #B9017: P2000 G3 SAS Array SN#00C0FF19FA59 Controller B WARNING An error was detected related to the CompactFlash card.  
2016-01-21 23:20:21 [242] #B9016: P2000 G3 SAS Array SN#00C0FF19FA59 Controller B ERROR Auto-write-through trigger event: CompactFlash failed.  
2016-01-21 23:16:15 [314] #A9681: P2000 G3 SAS Array SN#00C0FF19FA59 Controller A ERROR There is a problem with a FRU. (FRU type: A/C PSU, Right, enclosure: 1, product ID: , SN: , version: , related event serial number: A9680, related event code: 168)  
2016-01-21 23:16:15 [168] #A9680: P2000 G3 SAS Array SN#00C0FF19FA59 Controller A ERROR Enclosure event: fault. (enclosure: 1, WWN: 500c0ff019e22a3c) power supply 2, power supply status:  DC failure, AC failure, HP      SPS-CHASSIS     2023  
2016-01-20 22:27:17 [274] #B9006: P2000 G3 SAS Array SN#00C0FF19FA59 Controller B WARNING A PHY was disabled. (enclosure: 1, module (disabled path
to this disk): B, disk slot: 7, reason: Disabled because of empty disk slot)  
2016-01-20 22:27:17 [274] #B9005: P2000 G3 SAS Array SN#00C0FF19FA59 Controller B WARNING A PHY was disabled. (enclosure: 1, module (disabled path to this disk): A, disk slot: 7, reason: Disabled because of empty disk slot)  
2016-01-20 22:27:12 [274] #A9665: P2000 G3 SAS Array SN#00C0FF19FA59 Controller A WARNING A PHY was disabled. (enclosure: 1, module (disabled path to this disk): B, disk slot: 7, reason: Disabled because of empty disk slot)  
2016-01-20 22:27:12 [274] #A9664: P2000 G3 SAS Array SN#00C0FF19FA59 Controller A WARNING A PHY was disabled. (enclosure: 1, module (disabled path to this disk): A, disk slot: 7, reason: Disabled because of empty disk slot)  
2015-09-17 10:51:15 [354] #B8758: P2000 G3 SAS Array SN#00C0FF19FA59 Controller B WARNING Host SAS topology was changed. (host port: 2, 0 out of 4 PHYs are up, link speed: Autonegotiated)  
2015-09-17 10:51:15 [354] #B8757: P2000 G3 SAS Array SN#00C0FF19FA59 Controller B WARNING Host SAS topology was changed. (host port: 1, 0 out of 4 PHYs are up, link speed: Autonegotiated)  
2015-09-17 10:51:14 [354] #A9235: P2000 G3 SAS Array SN#00C0FF19FA59 Controller A WARNING Host SAS topology was changed. (host port: 2, 0 out of 4 PHYs are up, link speed: Autonegotiated)  
2015-09-17 10:51:14 [354] #A9234: P2000 G3 SAS Array SN#00C0FF19FA59 Controller A WARNING Host SAS topology was changed. (host port: 1, 0 out of 4 PHYs are up, link speed: Autonegotiated)  
2015-09-17 10:50:26 [204] #B8735: P2000 G3 SAS Array SN#00C0FF19FA59 Controller B WARNING An error was detected related to the CompactFlash card.  
2015-09-17 10:50:26 [242] #B8734: P2000 G3 SAS Array SN#00C0FF19FA59 Controller B ERROR Auto-write-through trigger event: CompactFlash failed.  
2015-09-17 10:49:38 [112] #B8730: P2000 G3 SAS Array SN#00C0FF19FA59 Controller B WARNING Host link down. (port: 4)  
2015-09-17 10:49:38 [112] #B8729: P2000 G3 SAS Array SN#00C0FF19FA59 Controller B WARNING Host link down. (port: 3)  
2015-09-17 10:49:38 [112] #B8728: P2000 G3 SAS Array SN#00C0FF19FA59 Controller B WARNING Host link down. (port: 2)  
2015-09-17 10:49:38 [112] #B8727: P2000 G3 SAS Array SN#00C0FF19FA59 Controller B WARNING Host link down. (port: 1)  
2015-09-17 10:16:49 [354] #B8705: P2000 G3 SAS Array SN#00C0FF19FA59 Controller B WARNING Host SAS topology was changed. (host port: 2, 0 out of 4 PHYs are up, link speed: Autonegotiated)  
2015-09-17 10:16:49 [354] #B8704: P2000 G3 SAS Array SN#00C0FF19FA59 Controller B WARNING Host SAS topology was changed. (host port: 1, 0 out of 4 PHYs are up, link speed: Autonegotiated)  
2015-09-17 10:16:38 [112] #A9182: P2000 G3 SAS Array SN#00C0FF19FA59 Controller A WARNING Host link down. (port: 4)  
2015-09-17 10:16:38 [112] #A9181: P2000 G3 SAS Array SN#00C0FF19FA59 Controller A WARNING Host link down. (port: 3)  
2015-09-17 10:16:37 [112] #A9180: P2000 G3 SAS Array SN#00C0FF19FA59 Controller A WARNING Host link down. (port: 2)  
2015-09-17 10:16:37 [112] #A9179: P2000 G3 SAS Array SN#00C0FF19FA59 Controller A WARNING Host link down. (port: 1)  
2015-09-17 10:16:01 [204] #B8670: P2000 G3 SAS Array SN#00C0FF19FA59 Controller B WARNING An error was detected related to the CompactFlash card.  
2015-09-17 10:16:01 [242] #B8669: P2000 G3 SAS Array SN#00C0FF19FA59 Controller B ERROR Auto-write-through trigger event: CompactFlash failed.  
2015-09-17 10:15:14 [112] #B8665: P2000 G3 SAS Array SN#00C0FF19FA59 Controller B WARNING Host link down. (port: 4)  
2015-09-17 10:15:14 [112] #B8664: P2000 G3 SAS Array SN#00C0FF19FA59 Controller B WARNING Host link down. (port: 3)  
2015-09-17 10:15:14 [112] #B8663: P2000 G3 SAS Array SN#00C0FF19FA59 Controller B WARNING Host link down. (port: 2)  
2015-09-17 10:15:14 [112] #B8662: P2000 G3 SAS Array SN#00C0FF19FA59 Controller B WARNING Host link down. (port: 1)  
2014-07-01 21:44:01 [314] #B7734: P2000 G3 SAS Array SN#00C0FF19FA59 Controller B ERROR There is a problem with a FRU. (FRU type: A/C PSU, Right, enclosure: 1, product ID: , SN: , version: , related event serial number: B7733, related event code: 168)  
2014-07-01 21:44:01 [168] #B7733: P2000 G3 SAS Array SN#00C0FF19FA59 Controller B ERROR Enclosure event: fault. (enclosure: 1, WWN: 500c0ff019e22a3c) power supply 2, power supply status:  AC failure, HP      SPS-CHASSIS     2023  
2014-07-01 21:39:51 [314] #B7729: P2000 G3 SAS Array SN#00C0FF19FA59 Controller B ERROR There is a problem with a FRU. (FRU type: A/C PSU, Left, enclosure: 1, product ID: , SN: , version: , related event serial number: B7728, related event code: 168)  
2014-07-01 21:39:51 [168] #B7728: P2000 G3 SAS Array SN#00C0FF19FA59 Controller B ERROR Enclosure event: fault. (enclosure: 1, WWN: 500c0ff019e22a3c) power supply 1, power supply status:  DC failure, AC failure, HP      SPS-CHASSIS     2023  

2014-05-22 05:56:43 [354] #B7649: P2000 G3 SAS Array SN#00C0FF19FA59 Controller B WARNING Host SAS topology was changed. (host port: 1, 0 out of 4 PHYs are up, link speed: Autonegotiated)  
2014-02-25 16:02:03 [354] #B7482: P2000 G3 SAS Array SN#00C0FF19FA59 Controller B WARNING Host SAS topology was changed. (host port: 1, 0 out of 4 PHYs are up, link speed: Autonegotiated)  
2014-02-25 15:58:35 [354] #B7481: P2000 G3 SAS Array SN#00C0FF19FA59 Controller B WARNING Host SAS topology was changed. (host port: 2, 0 out of 4 PHYs are up, link speed: Autonegotiated)  

Success: Command completed successfully. (2016-12-05 13:07:35)

#
# show time
Error: The command was not recognized. (2016-12-05 13:08:46)

======================
HP hpacucli commands:
======================
Basic general check:

root@my_server:~>% hpacucli ctrl slot=0 ld all show

Error: The controller identified by "slot=0" was not detected.

root@my_server:~>% hpacucli ctrl all show

Smart Array P400 in Slot 1    (sn: P61620F9VV69P4)

root@my_server:~>% hpacucli ctrl slot=1 ld all show

Smart Array P400 in Slot 1

   array A

      logicaldrive 1 (136.7 GB, RAID 1+0, OK)

   array B (Failed)

      logicaldrive 2 (136.7 GB, RAID 1+0, Failed)


   array C
      logicaldrive 3 (136.7 GB, RAID 1+0, OK)


======================
HP hpssacli commands:
======================
root@my_server:~>% hpssacli ctrl all show config



Smart Array P440ar in Slot 0 (Embedded)   (sn: PDNLH0BRH1726V)



   Internal Drive Cage at Port 1I, Box 3, OK

   Internal Drive Cage at Port 2I, Box 0, OK
   array A (SAS, Unused Space: 0  MB)

      logicaldrive 1 (558.9 GB, RAID 1, OK)

      physicaldrive 1I:3:1 (port 1I:box 3:bay 1, SAS, 600 GB, OK)
      physicaldrive 1I:3:2 (port 1I:box 3:bay 2, SAS, 600 GB, OK)



root@my_server:~>% hpssacli ctrl all show status

Smart Array P440ar in Slot 0 (Embedded)
   Controller Status: OK
   Cache Status: OK
   Battery/Capacitor Status: OK