update the example shell-script of alerts

This commit is contained in:
Jordi Sanfeliu 2013-01-23 11:24:05 +01:00
parent e6c2562e63
commit 8e177c6d3f
1 changed files with 5 additions and 6 deletions

View File

@ -2,12 +2,11 @@
# #
# Example script used to execute an alert action. # Example script used to execute an alert action.
# #
# - in CPU alerts the current value is the last 15min load average
# - in FS alerts the current value is the root filesystem usage (%) MAILTO="root@localhost"
#
if [ $# != 3 ] ; then if [ $# != 3 ] ; then
echo "$0: Wrong number of parameters." echo "$0: Wrong number of arguments."
exit 1 exit 1
fi fi
@ -19,11 +18,11 @@ current_value=$3
cat << EOF cat << EOF
Message from hostname '$HOSTNAME' Message from hostname '$HOSTNAME'
This system is reaching/exceeding the defined $ALERT_THRESHOLD threshold during the last $ALERT_TIMEINTVL seconds. This system is reaching/exceeding the defined '$ALERT_THRESHOLD' threshold value during the last '$ALERT_TIMEINTVL' seconds.
The current value is: $current_value The current value is: $current_value
Please take proper actions to correct this situation. Please take proper actions to correct this situation.
EOF EOF
) | mail -s "WARNING: Monitorix alert!" root ) | mail -s "WARNING: Monitorix alert!" $MAILTO