Added smart_array_disks_temperature
This commit is contained in:
parent
5ece4e1090
commit
5005ca3959
2 changed files with 101 additions and 0 deletions
85
smart_array_disks_temperature
Executable file
85
smart_array_disks_temperature
Executable file
|
@ -0,0 +1,85 @@
|
|||
#! /bin/bash
|
||||
: << =cut
|
||||
|
||||
=head1 NAME
|
||||
|
||||
smart_array_disks_temperature - Plugin to monitor temperature of disk on HP Raid cards.
|
||||
|
||||
=head1 APPLICABLE SYSTEMS
|
||||
|
||||
Only tested on HP Microserver Gen8 with Smart Array P222.
|
||||
|
||||
Maybe works with other HP Prolant Raid cards.
|
||||
|
||||
=head1 CONFIGURATION
|
||||
|
||||
/etc/munin/plugin-conf.d/global or other file in that dir must contain:
|
||||
|
||||
[smart_array_disks_temperature*]
|
||||
user root
|
||||
|
||||
=head1 NOTES
|
||||
|
||||
Uses the command "ssacli"
|
||||
|
||||
=head1 AUTHOR
|
||||
|
||||
Damien Broqua (https://framagit.org/dbroqua)
|
||||
|
||||
=head1 LICENSE
|
||||
|
||||
GPLv2
|
||||
|
||||
=head1 MAGIC MARKERS
|
||||
|
||||
#%# family=auto
|
||||
#%# capabilities=autoconf
|
||||
|
||||
=cut
|
||||
|
||||
IFS=$'\n'
|
||||
|
||||
# Function to list all slots
|
||||
getSlots () {
|
||||
list=`ssacli ctrl all show config|grep "Slot"|awk -F'Slot ' '{print $2}'|cut -d' ' -f1`
|
||||
|
||||
return $list
|
||||
}
|
||||
|
||||
# Function to get disk of one specified slot
|
||||
getDisks () {
|
||||
slot=$1
|
||||
|
||||
list=`ssacli ctrl slot=${slot} pd all show status|grep "physicaldrive"|awk -F 'physicaldrive' '{print $2}'|cut -d ' ' -f2`
|
||||
for disk in ${list[@]} ; do
|
||||
if [ "${2}" = "config" ]; then
|
||||
diskName=`ssacli ctrl slot=${slot} pd ${disk} show detail|grep "Model"|cut -d':' -f2`
|
||||
|
||||
echo "${slot}${disk}CurrentTemperature(C).label (${disk}) ${diskName} "
|
||||
else
|
||||
diskDetails=`ssacli ctrl slot=${slot} pd ${disk} show detail|grep 'Current Temperature'`
|
||||
temps="${diskDetails}"
|
||||
|
||||
for temp in ${temps[@]}; do
|
||||
line="$(echo -e "${temp}" | tr -d '[:space:]'|sed -e "s/:/.value /g")"
|
||||
echo ${slot}${disk}${line}
|
||||
done
|
||||
fi
|
||||
done
|
||||
}
|
||||
|
||||
# Config, set graph title
|
||||
if [ "${1}" = "config" ]; then
|
||||
echo "graph_title SMART Array disk temperature"
|
||||
echo "graph_vlabel Degrees celcius"
|
||||
echo "graph_category sensors"
|
||||
fi
|
||||
|
||||
# Start script by getting list of slots
|
||||
getSlots
|
||||
slots=$?
|
||||
|
||||
# For each slot, get disks
|
||||
for i in ${list[@]} ; do
|
||||
getDisks $i $1
|
||||
done
|
16
smart_array_system_temperature
Normal file
16
smart_array_system_temperature
Normal file
|
@ -0,0 +1,16 @@
|
|||
|
||||
|
||||
# Auteur: Damien Broqua <contact@darkou.fr
|
||||
# Licence:
|
||||
|
||||
# Process for get disk informations:
|
||||
# show config
|
||||
# => extract slot(s)
|
||||
# => for each slot
|
||||
# => get disk Model (ATA ST4000DM004-2CV1)
|
||||
# => get disk temperature (Current Temperature (C):)
|
||||
|
||||
# Process for get temperatures:
|
||||
# get list of slot (hpacucli ctrl all show)
|
||||
# => for each slot
|
||||
# => temperatures (hpacucli ctrl slot=1 show)
|
Loading…
Reference in a new issue