#!/bin/bash # # Program: Check the status of LSI RAID controllers # # Author: Matty < matty91 at gmail dot com > # # Current Version: 1.0 # # License: # This program is free software; you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by # the Free Software Foundation; either version 2 of the License, or # (at your option) any later version. # # This program is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the # GNU General Public License for more details. for volume in `raidctl -l | awk -F: '/Volume/ {print $NF}'` do if raidctl -l ${volume} | egrep "${volume}.*OPTIMAL" > /dev/null then : else logger -p daemon.notice "HARDWARE ERROR: The disk controller is no longer in an optimal state" logger -p daemon.notice "HARDWARE ERROR: Run raidctl to see if a disk failed" fi done