To start, the server needs to have either postfix or sendmail installed
Check
====
===========
if not installed
Check
====
ls /etc/init.d | grep postfix (defaults)ls /etc/init.d | grep sendmail ===========
if not installed
yum install postfix -y yum install sendmail -y======chkconfig postfix on chkconfig sendmail on======================Set cronjob for mail aleart
=========== cd /etc/cron.hourlyvi MegaRAIDcron#!/bin/bashcd /opt/MegaRAID/MegaCli./MegaCli64 -AdpAllInfo -aALL | grep "Degraded" > degraded.txt./MegaCli64 -AdpAllInfo -aALL | grep "Failed" >> degraded.txtcat degraded.txt | grep "1" > /dev/nullif [[ $? -eq 0 ]];thencat degraded.txt | mailx -s 'Degraded RAID on '$HOSTNAME <testgmla@gmail.com> fi ==============To test cron, we need to make one small change to the file. Change the following:
From
cat degraded.txt | grep "1" > /dev/null
To
cat degraded.txt | grep "0" > /dev/null
Save the changes and run the cron manually:
/etc/cron.hourly/MegaRAIDcron
If you have installed everything correctly, you should receive an email which shows the following:
Degraded : 0
Security Key Failed : No
Failed Disks : 0
Deny Force Failed : NoSree
No comments:
Post a Comment