1.install mailx
wget http://mirror.centos.org/centos/5/os/i386/CentOS/mailx-8.1.1-44.2.2.i386.rpm2.config ssmtpd.conf
rpm -ivh mailx-8.1.1-44.2.2.i386.rpm
ps.you might need glibc
http://mirror.centos.org/centos/5/updates/i386/RPMS/glibc-2.5-123.el5_11.1.i386.rpm
vi /etc/ssmtp/ssmtp.conf3.create shell script to send mail (from http://idolinux.blogspot.tw)
mailhub=mail.yourdomain.com:25
AuthUser=username
AuthPass=password
rewriteDomain=server1.yourdomain.com
hostname=server1.yourdomain.com
# vi /usr/local/bin/om-alert.sh
#!/bin/sh
HOST=`hostname`
EMAIL="my_admin@my_network.net"
echo "There has been an OpenManage ALERT detected on $HOST. Please login to the web interface to see details." | mail $EMAIL -s "OM ALERT $HOST : $1"
4. now you can add ation via web gui or cmd line below
# chmod 755 /usr/local/bin/om-alert.sh
chmod +x /usr/local/bin/om-alert.shor
omconfig system alertaction
omconfig system alertaction -?
omconfig system alertaction event=powersupply execappath=/usr/local/bin/om-alert.sh
omconfig system alertaction event=storagesyswarn alert=true broadcast=true execappath=/usr/local/bin/om-alert.sh
omreport system alertaction
for I in `omconfig system alertaction | sed 's/ *(.*)//; s/>.*//; s/.*[:<] *// ; s/|/ /g;'`; do
echo $I;
omconfig system alertaction event=$I alert=true broadcast=true execappath="/usr/local/bin/om-alert.sh $I"
done
Reference
Quick Dell OpenManage Email Alerts
Enable email on Xenserver using SMTP
For Windows 2008 (Windows)
1.Get blat
http://sourceforge.net/projects/blat/
Extract blat.exe, blat.dll, blat.lib into C:\windows\system32
2.Replace the mail server and mail sender.
blat -install your.mailserver.com admin@your.mailserver.com
3.save the script into C:\DellAlert.bat and run it
C:\DellAlert.bat /setup
*you can get the script from here
Reference
Setup Email Notifications for Dell Server Hardware Alerts
沒有留言:
張貼留言