]> arthur.barton.de Git - netdata.git/blobdiff - plugins.d/alarm-email.sh
added units and info to alarms and templates - now all alarm badges are a log more...
[netdata.git] / plugins.d / alarm-email.sh
index 16286f376932eb53ea99749b1c9881df7ee8831e..25ed6f77796b1c4c9194f988386a2a060be1bab5 100755 (executable)
@@ -31,6 +31,10 @@ old_value="${7}"  # the previous value
 src="${8}"        # the line number and file the alarm has been configured
 duration="${9}"   # the duration in seconds the previous state took
 non_clear_duration="${10}" # the total duration in seconds this is non-clear
+units="${11}"     # the units of the value
+info="${12}"      # a short description of the alarm
+
+[ ! -z "${info}" ] && info=" <br/>${info}"
 
 # get the system hostname
 hostname="${NETDATA_HOSTNAME}"
@@ -93,7 +97,7 @@ severity="${status}"
 raised_for="<br/>(was ${old_status,,} for $(duration4human ${duration}))"
 status_message="status unknown"
 color="grey"
-alarm="${name} = ${value}"
+alarm="${name} = ${value} ${units}"
 
 # prepare the title based on status
 case "${status}" in
@@ -200,7 +204,7 @@ Content-Type: text/html
                                     <tr style="margin:0;padding:0">
                                         <td style="font-size:18px;vertical-align:top;margin:0;padding:0 0 20px"
                                             align="left" valign="top">
-                                            <span>${alarm}</span>
+                                            <span>${alarm}${info}</span>
                                             <span style="display:block;color:#666666;font-size:12px;font-weight:300;line-height:1;text-transform:uppercase">Alarm</span>
                                         </td>
                                     </tr>