Thrive in what all you do... Okay i'm not writing any spiritual article here ;)
Actually i was tired of running manual commands on array to check the status on daily basis, which encouraged me to write a small health check script. I believe that's why man made the machine :-D
Anyways.. below is the script which does couple of tasks:
- Check the overall status of the cluster
- Mail the output to my e-mail id
In case you have a large setup then you can schedule it via cron or autosys as well...
Script::
#####################################################
#
# Script: To perform the health check on Isilon Array
#
#
# Script: To perform the health check on Isilon Array
#
# DATE: 2015-03-15
#
# Version Update: 1.0 Piyush Chawla
#
#####################################################
# Version Update: 1.0 Piyush Chawla
#
#####################################################
TODAY=$(date)
HOST=$(hostname)
sleep 15
#Move yesterday’s backups to an archive
location
mv /ifs/pc1611/*.txt
/ifs/pc1611/archive/
echo “-----------------------------”
>> /ifs/pc1611/"isilon_status-`date '+%Y-%m-%d'`.txt"
echo “Date: $TODAY Host: $HOST” >>
/ifs/pc1611/"isilon_status-`date '+%Y-%m-%d'`.txt"
echo “-----------------------------”
>> /ifs/pc1611/"isilon_status-`date '+%Y-%m-%d'`.txt"
# To check the Isilon array health
status
/usr/bin/isi status -q >>
/ifs/pc1611/"isilon_status-`date '+%Y-%m-%d'`.txt"
echo “-----------------------------”
>> /ifs/pc1611/"isilon_status-`date '+%Y-%m-%d'`.txt"
echo "Event List"
/usr/bin/isi event list | tail -10
>> /ifs/pc1611/"isilon_status-`date '+%Y-%m-%d'`.txt"
echo “-----------------------------”
>> /ifs/pc1611/"isilon_status-`date '+%Y-%m-%d'`.txt"
echo “SyncIQ Report” >>
/ifs/pc1611/"isilon_status-`date '+%Y-%m-%d'`.txt"
echo “-----------------------------”
>> /ifs/pc1611/"isilon_status-`date '+%Y-%m-%d'`.txt"
# To check the SyncIQ status
/usr/bin/isi sync reports list
>> /ifs/pc1611/"isilon_status-`date '+%Y-%m-%d'`.txt"
echo “-----------------------------”
>> /ifs/pc1611/"isilon_status-`date '+%Y-%m-%d'`.txt"
echo “File System Utilization”
>> /ifs/pc1611/"isilon_status-`date '+%Y-%m-%d'`.txt"
echo “-----------------------------”
>> /ifs/pc1611/"isilon_status-`date '+%Y-%m-%d'`.txt"
# To check the file system utilization
df -kh -a /ifs >>
/ifs/pc1611/"isilon_status-`date '+%Y-%m-%d'`.txt"
echo ”-----------------------------”
>> /ifs/pc1611/"isilon_status-`date '+%Y-%m-%d'`.txt"
/usr/bin/isi storagepool list >>
/ifs/pc1611/"isilon_status-`date '+%Y-%m-%d'`.txt"
echo “-----------------------------”
>> /ifs/pc1611/"isilon_status-`date '+%Y-%m-%d'`.txt"
echo “Deduplication status” >>
/ifs/pc1611/"isilon_status-`date '+%Y-%m-%d'`.txt"
echo “-----------------------------”
>> /ifs/pc1611/"isilon_status-`date '+%Y-%m-%d'`.txt"
# To check the deduplication status
/usr/bin/isi dedupe stats >>
/ifs/pc1611/"isilon_status-`date '+%Y-%m-%d'`.txt"
echo “-----------------------------”
>> /ifs/pc1611/"isilon_status-`date '+%Y-%m-%d'`.txt"
# To check the performance status
echo “Performance stats” >>
/ifs/pc1611/"isilon_status-`date '+%Y-%m-%d'`.txt"
echo “-----------------------------”
>> /ifs/pc1611/"isilon_status-`date '+%Y-%m-%d'`.txt"
sleep 1
echo ”
” >> /ifs/pc1611/"isilon_status-`date '+%Y-%m-%d'`.txt"
echo “–System Stats–” >>
/ifs/pc1611/"isilon_status-`date '+%Y-%m-%d'`.txt"
echo ”
” >> /ifs/pc1611/"isilon_status-`date '+%Y-%m-%d'`.txt"
/usr/bin/isi statistics system >>
/ifs/pc1611/"isilon_status-`date '+%Y-%m-%d'`.txt"
sleep 1
echo ”
” >> /ifs/pc1611/"isilon_status-`date '+%Y-%m-%d'`.txt"
echo “–Client Stats–” >>
/ifs/pc1611/"isilon_status-`date '+%Y-%m-%d'`.txt"
echo ”
” >> /ifs/pc1611/"isilon_status-`date '+%Y-%m-%d'`.txt"
/usr/bin/isi statistics client >> /ifs/pc1611/"isilon_status-`date
'+%Y-%m-%d'`.txt"
sleep 1
echo ”
” >> /ifs/pc1611/"isilon_status-`date '+%Y-%m-%d'`.txt"
echo “–Protocol Stats–” >>
/ifs/pc1611/"isilon_status-`date '+%Y-%m-%d'`.txt"
echo ”
” >> /ifs/pc1611/"isilon_status-`date '+%Y-%m-%d'`.txt"
/usr/bin/isi statistics protocol >>
/ifs/pc1611/"isilon_status-`date '+%Y-%m-%d'`.txt"
sleep 1
echo ”
” >> /ifs/pc1611/"isilon_status-`date '+%Y-%m-%d'`.txt"
echo “–Protocol Data–” >>
/ifs/pc1611/"isilon_status-`date '+%Y-%m-%d'`.txt"
echo ”
” >> /ifs/pc1611/"isilon_status-`date '+%Y-%m-%d'`.txt"
/usr/bin/isi statistics pstat >>
/ifs/pc1611/"isilon_status-`date '+%Y-%m-%d'`.txt"
sleep 1
echo ”
” >> /ifs/pc1611/"isilon_status-`date '+%Y-%m-%d'`.txt"
echo “–Drive Stats–” >>
/ifs/pc1611/"isilon_status-`date '+%Y-%m-%d'`.txt"
echo ”
” >> /ifs/pc1611/"isilon_status-`date '+%Y-%m-%d'`.txt"
/usr/bin/isi statistics drive >>
/ifs/pc1611/"isilon_status-`date '+%Y-%m-%d'`.txt"
# Mail the required output
cat /ifs/pc1611/isilon_status* | mail
-s "$TODAY Report" piyush.chawla@xyz.com
#End of Script
Happy Learning!
No comments:
Post a Comment