smeserver-raidstatus/root/etc/cron.weekly/mail_raid_status

15 lines
418 B
Plaintext
Raw Normal View History

#!/usr/bin/perl -w
use strict;
use warnings;
use esmith::ConfigDB;
my $DB = esmith::ConfigDB->open_ro;
my $Domainname = $DB->get_value('DomainName');
my $mail = $DB->get_prop('raidstatus','mailto') || '';
my $systemname = $DB->get_value('SystemName');
$mail = $mail . ' admin@'.$Domainname;
my $MailStatus = `/sbin/mdadm --detail \$(/bin/ls /dev/md?)|/bin/mail -s "RAID status of $systemname.$Domainname" $mail`;