模板1
<html>
<head><meta http-equiv="Content-Type" content="text/html; charset=utf-8"> </haed>
<body>
<style>table{font-size:14px;}</style>
<div align="center">
<font color="#525252">
<table border="0" style="border:5px solid #F2F2F2;" cellspacing="2" cellpadding="2" width="900" style="table-layout:fixed">
<tr bgcolor="#D1D1D1">
<th align="left" style="font-size:23px;">告警信息</marquee></th>
</tr> <tr><td align="left" style="font-family:微软雅黑; size=5" style="WORD-WRAP:break-word">告警项名: {ITEM.NAME1}
</td> </tr>
<tr><td align="left" style="font-family:微软雅黑; size=5" style="WORD-WRAP:break-word"><b>告警主机:</b>{HOST.NAME1}
</td> </tr>
<tr><td align="left" style="font-family:微软雅黑; size=5" style="WORD-WRAP:break-word">告警IP: {HOST.IP1}
</td> </tr>
<tr><td align="left" style="font-family:微软雅黑; size=5" style="WORD-WRAP:break-word">告警项Key值: {ITEM.KEY1}
</td> </tr>
<tr><td align="left" style="font-family:微软雅黑; size=5" style="WORD-WRAP:break-word">告警触发规则:{TRIGGER.EXPRESSION}
</td> </tr>
<tr><td align="left" style="font-family:微软雅黑; size=5" style="WORD-WRAP:break-word">告警时间:{EVENT.DATE} {EVENT.TIME}
</td> </tr>
<tr><td align="left" style="font-family:微软雅黑; size=5" style="WORD-WRAP:break-word">告警等级:{TRIGGER.SEVERITY}
</td> </tr>
<tr><td align="left" style="font-family:微软雅黑; size=5" style="WORD-WRAP:break-word">告警值: {ITEM.VALUE1}
</td> </tr>
<tr><td align="left" style="font-family:微软雅黑; size=5" style="WORD-WRAP:break-word">最新采集值: {{HOSTNAME}:{TRIGGER.KEY}.last(0)}
</td> </tr>
<tr><td align="left" style="font-family:微软雅黑; size=5" style="WORD-WRAP:break-word">问题描述:{TRIGGER.DESCRIPTION}
</td> </tr>
</table>
<p>此邮件为监控平台自动发送,请勿回复!</p>
</body>
</html>
模板2
<table border="1" bordercolor="black" cellspacing="0px" cellpadding="4px">
<tr >
<td>告警主机</td>
<td bgcolor="#FF3333">{HOSTNAME1}</td>
</tr>
<tr>
<td>告警时间</td>
<td>{EVENT.DATE} {EVENT.TIME}</td>
</tr>
<tr>
<td>告警等级</td>
<td>{TRIGGER.SEVERITY}</td>
</tr>
<tr>
<td>告警信息</td>
<td>{TRIGGER.NAME}</td>
</tr>
<tr>
<td>告警项目</td>
<td>{TRIGGER.KEY1}</td>
</tr>
<tr >
<td>问题详情</td>
<td bgcolor="#FF3333">{ITEM.NAME}: {ITEM.VALUE}</td>
</tr>
<tr>
<td>当前状态</td>
<td>{TRIGGER.STATUS}: {ITEM.VALUE1}</td>
</tr>
<tr>
<td>事件ID</td>
<td>{EVENT.ID}</td>
</tr>
</table>
当传参的时候可能需要将HTML转换成一行,可直接在线转换:
http://tool.oschina.net/jscompress?type=2
网友评论