Thứ Năm, 14 tháng 4, 2011

Quick Dell OpenManage Email Alerts

Dell OpenManage does not provide a simple way to set a catch-all email alert for platform and storage events. With these few steps, we can configure OpenManage to send an email on any alert.

First, we must create a simple shell script to send the email.

/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"



We can set individual alerts:

# chmod +x /usr/local/bin/om-alert.sh
# 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



Or we can set console, broadcast and email for all alerts.

# 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"
done