#!/bin/bash
BASEDIR=$(dirname "$0")
export PATH=/usr/sbin:/usr/local/bin:/usr/bin:/bin:/usr/local/games:/usr/games
export OUTPUT_PATH=${BASEDIR}
{
	echo  "------------`hostname`-------[`date '+%Y/%m/%d %H:%M:%S'`]"
	echo  "smartctl -d sat -a /dev/sda | awk '/SMART Attributes Data Structure revision number:/,/SMART Error Log Version:/ { print }' | sed '/SMART Error Log Version:/q'"
	smartctl -d sat -a /dev/sda | awk '/SMART Attributes Data Structure revision number:/,/SMART Error Log Version:/ { print }' | sed '/SMART Error Log Version:/q'
	echo  "smartctl -d sat -a /dev/sdb | awk '/SMART Attributes Data Structure revision number:/,/SMART Error Log Version:/ { print }' | sed '/SMART Error Log Version:/q'"
	smartctl -d sat -a /dev/sdb | awk '/SMART Attributes Data Structure revision number:/,/SMART Error Log Version:/ { print }' | sed '/SMART Error Log Version:/q'

} >> "${OUTPUT_PATH}/`hostname`_smartctl_disk_status.txt"

