#!/bin/bash

show_config() {
  hpacucli ctrl all show config | grep logicaldrive | sed "s/^ *//"
}
ret="`show_config | grep -v 'B, RAID .*, OK'`"

if [ -z "$ret" ]; then
  echo "OK - `show_config`"
  exit 0
fi

echo "CRITICAL - $ret" | tr -d "\n"
exit 2
