Added script for card controller
This commit is contained in:
parent
1f520da78c
commit
c5d9ab0f89
1 changed files with 77 additions and 12 deletions
|
@ -1,16 +1,81 @@
|
|||
#! /bin/bash
|
||||
: << =cut
|
||||
|
||||
=head1 NAME
|
||||
|
||||
# Auteur: Damien Broqua <contact@darkou.fr
|
||||
# Licence:
|
||||
smart_array_system_temperature - Plugin to monitor temperature of HP Smart array.
|
||||
|
||||
# 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):)
|
||||
=head1 APPLICABLE SYSTEMS
|
||||
|
||||
# Process for get temperatures:
|
||||
# get list of slot (hpacucli ctrl all show)
|
||||
# => for each slot
|
||||
# => temperatures (hpacucli ctrl slot=1 show)
|
||||
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_system_temperature]
|
||||
user root
|
||||
|
||||
=head1 NOTES
|
||||
|
||||
Uses the command "hpacucli" (http://hwraid.le-vert.net/wiki/DebianPackages)
|
||||
|
||||
=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=`hpacucli ctrl all show|grep "Slot"|awk -F'Slot ' '{print $2}'|cut -d' ' -f1`
|
||||
|
||||
return $list
|
||||
}
|
||||
|
||||
# Function to get temperatures of one specified slot
|
||||
getTemperatures () {
|
||||
slot=$1
|
||||
|
||||
temps=`hpacucli ctrl slot=${slot} show|grep "Temperature"`
|
||||
for temp in ${temps[@]}; do
|
||||
id=`echo ${temp}|cut -d':' -f1| tr -d '[:space:]'`
|
||||
value=`echo ${temp}|cut -d':' -f2| tr -d '[:space:]'`
|
||||
label=`echo ${temp}|cut -d':' -f1`
|
||||
|
||||
if [ "${2}" = "config" ]; then
|
||||
echo "${slot}${id}.label (slot ${slot}) ${label} "
|
||||
else
|
||||
echo ${slot}${id}.value ${value}
|
||||
fi
|
||||
done
|
||||
}
|
||||
|
||||
# Config, set graph title
|
||||
if [ "${1}" = "config" ]; then
|
||||
echo "graph_title SMART Array temperatures"
|
||||
echo "graph_vlabel Degrees celcius"
|
||||
echo "graph_category sensors"
|
||||
fi
|
||||
|
||||
# Start script by getting list of slots
|
||||
getSlots
|
||||
slots=$?
|
||||
|
||||
# For each slot, get temperatures
|
||||
for i in ${list[@]} ; do
|
||||
getTemperatures $i $1
|
||||
done
|
Loading…
Reference in a new issue