HP Management Component Pack

# nano -w /etc/apt/sources.list.d/mcp.list

     + deb http://downloads.linux.hpe.com/SDR/repo/mcp xenial/current non-free  
     
# curl http://downloads.linux.hpe.com/SDR/hpPublicKey1024.pub | apt-key add -
# curl http://downloads.linux.hpe.com/SDR/hpPublicKey2048.pub | apt-key add -
# curl http://downloads.linux.hpe.com/SDR/hpPublicKey2048_key1.pub | apt-key add -
# curl http://downloads.linux.hpe.com/SDR/hpePublicKey2048_key1.pub | apt-key add -
# apt-get update
# apt-get install hp-health hpssacli
# /sbin/hplog -t -f -p

ID     TYPE        LOCATION      STATUS    CURRENT  THRESHOLD
 1  Basic Sensor I/O Zone        Normal   102F/ 39C 158F/ 70C
 2  Basic Sensor Ambient         Normal    62F/ 17C 102F/ 39C
 3  Basic Sensor Processor Zone  Normal    86F/ 30C 260F/127C
 4  Basic Sensor Processor Zone  Normal    86F/ 30C 260F/127C
 5  Basic Sensor System Board    Normal   105F/ 41C 170F/ 77C
 6  Basic Sensor Processor Zone  Normal    86F/ 30C 260F/127C
 7  Basic Sensor Processor Zone  Normal    86F/ 30C 260F/127C

ID     TYPE        LOCATION      STATUS  REDUNDANT FAN SPEED
 1  Var. Speed   I/O Zone        Normal     Yes     Normal   ( 45)
 2  Var. Speed   I/O Zone        Normal     Yes     Normal   ( 45)
 3  Var. Speed   I/O Zone        Normal     Yes     Normal   ( 45)
 4  Var. Speed   I/O Zone        Normal     Yes     Normal   ( 45)
 5  Var. Speed   Processor Zone  Normal     Yes     Normal   ( 41)
 6  Var. Speed   Processor Zone  Normal     Yes     Normal   ( 41)
 7  Var. Speed   Processor Zone  Normal     Yes     Normal   ( 36)
 8  Var. Speed   Processor Zone  Normal     Yes     Normal   ( 36)
 9  Var. Speed   Processor Zone  Normal     Yes     Normal   ( 36)
10  Var. Speed   Processor Zone  Normal     Yes     Normal   ( 36)
11  Var. Speed   Processor Zone  Normal     Yes     Normal   ( 36)
12  Var. Speed   Processor Zone  Normal     Yes     Normal   ( 36)

ID     TYPE        LOCATION      STATUS  REDUNDANT
 1  Standard     Pwr. Supply Bay Normal     Yes
 2  Standard     Pwr. Supply Bay Normal     Yes
    
# /usr/sbin/hpssacli ctrl slot=1 show config

Smart Array P400 in Slot 1                (sn: **************)


   Port Name: 1I

   Port Name: 2I

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

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


      logicaldrive 1 (136.7 GB, RAID 1, OK)

      physicaldrive 2I:1:1 (port 2I:box 1:bay 1, SAS, 146 GB, OK)
      physicaldrive 2I:1:2 (port 2I:box 1:bay 2, SAS, 146 GB, OK)
      physicaldrive 1I:1:8 (port 1I:box 1:bay 8, SAS, 146 GB, OK, spare)

   array B (SAS, Unused Space: 0  MB)


      logicaldrive 3 (136.7 GB, RAID 1, OK)

      physicaldrive 1I:1:5 (port 1I:box 1:bay 5, SAS, 146 GB, OK)
      physicaldrive 1I:1:6 (port 1I:box 1:bay 6, SAS, 146 GB, OK)
      physicaldrive 1I:1:8 (port 1I:box 1:bay 8, SAS, 146 GB, OK, spare)
# apt-get install sendemail

# nano -w Status.sh
#!/bin/bash
 
#===== HP log
FILELOG1="/root/log/"$(date +%Y%m%d%H%M%S)_log.txt
touch $FILELOG1
/sbin/hplog -t -f -p &>$FILELOG1
#=====
 
#===== HP array
FILELOG2="/root/log/"$(date +%Y%m%d%H%M%S)_arr.txt
touch $FILELOG2
/usr/sbin/hpssacli ctrl slot=1 show config &>$FILELOG2
#=====
 
sendemail -f kvm@myDomain -t giancarlo.birello@myDomain -u Status -m Status -a $FILELOG1 $FILELOG2 -s mail.myDomain -q
# apt-get install hp-ams