Hp acu cli


#1

Installatie

More info: https://oitibs.com/install-hp-acu-cli-on-debian/





Controle
Om de status van de controller te controleren:

hpacucli ctrl all show status

Om de status van de disken (fysiek en virtueel) te controleren

hpacucli ctrl all show config






Controle script
Om dit nu in een scriptje te plaatsen, en bv via cron elke nacht te laten runnen, kan je volgend script gebruiken:
cat check_disks_moni.sh 
#!/bin/bash

# Email settings
email_recipient="Jouw@mail.adres"

# Current datetime in YYYY-MM-DD_HH-MM-SS
date=`date +%Y-%m-%d_%H-%M-%S`

# Make sure the log directory exists.
/bin/mkdir -p /scripts/log
log_filename=/scripts/log/$date.log
hostname=`hostname`
email_subject="Harddrive Failed On $hostname"

if hpacucli ctrl all show config | grep -q -i Failed; 
then
	echo -e "Harddrive Check Run: $date" > $log_filename
	echo -e "\nUsing Command: hpacucli ctrl all show config" >> $log_filename
	hpacucli ctrl all show config >> $log_filename
	/usr/bin/mail -s "$email_subject" "$email_recipient" < $log_filename
else
	echo -e "Harddrive check ran: $date" > /scripts/log/check_disks_moni.log
fi

Dank aan: https://www.randomhacks.co.uk/monitoring-hp-rai-array-on-ubuntu-server/