2012-10-22 15:26:37 +01:00
|
|
|
#!/bin/sh
|
|
|
|
#
|
|
|
|
# Example script used to execute an alert action.
|
|
|
|
#
|
2013-01-23 10:24:05 +00:00
|
|
|
|
|
|
|
MAILTO="root@localhost"
|
2012-10-22 15:26:37 +01:00
|
|
|
|
|
|
|
if [ $# != 3 ] ; then
|
2013-01-23 10:24:05 +00:00
|
|
|
echo "$0: Wrong number of arguments."
|
2012-10-22 15:26:37 +01:00
|
|
|
exit 1
|
|
|
|
fi
|
|
|
|
|
|
|
|
ALERT_TIMEINTVL=$1
|
|
|
|
ALERT_THRESHOLD=$2
|
|
|
|
current_value=$3
|
|
|
|
|
|
|
|
(
|
|
|
|
cat << EOF
|
|
|
|
Message from hostname '$HOSTNAME'
|
|
|
|
|
2013-01-23 10:24:05 +00:00
|
|
|
This system is reaching/exceeding the defined '$ALERT_THRESHOLD' threshold value during the last '$ALERT_TIMEINTVL' seconds.
|
2012-10-22 15:26:37 +01:00
|
|
|
|
|
|
|
The current value is: $current_value
|
|
|
|
|
|
|
|
Please take proper actions to correct this situation.
|
|
|
|
EOF
|
2013-01-23 10:24:05 +00:00
|
|
|
) | mail -s "WARNING: Monitorix alert!" $MAILTO
|
2012-10-22 15:26:37 +01:00
|
|
|
|