Search code examples
zabbix

how to fix this Zabbix alert template to work?


Zabbix Version: 4.0 LTS

# template

Alert: {EVENT.NAME}
Severity: {EVENT.SEVERITY}

Top cpu:
{HOST.NAME:sys.process.top.cpu.last()}

Top mem:
{HOST.NAME:sys.process.top.mem.last()}

Problem started at {EVENT.TIME} on {EVENT.DATE}

Render result:

Alert: test top usage
Severity: Disaster

Top cpu:
*UNKNOWN*

Top mem:
*UNKNOWN*

Problem started at 03:35:00 on 2020.05.29

How to fix it to normal? I hope it could get the value of the current host.


Solution

  • It should use the {{HOST.HOST}:sys.process.top.cpu.last()} to work.

    More information could refer to this online document.

    https://books.google.com.hk/books?id=xgjVDQAAQBAJ&pg=PA333&lpg=PA333&dq=zabbix+%7B%7BHOST.NAME%7D%7D:key.last()%7D&source=bl&ots=zQHgguJ0hm&sig=ACfU3U3-FOGUIJjtJSvpoC_l5YXpx6l7fQ&hl=zh-CN&sa=X&redir_esc=y&sourceid=cndr#v=onepage&q=zabbix%20%7B%7BHOST.NAME%7D%7D%3Akey.last()%7D&f=false