Ad Widget

Collapse

stuck in converting script from version 5 to 6

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • ali136
    Junior Member
    • Oct 2018
    • 13

    #1

    stuck in converting script from version 5 to 6

    Hello everyone
    I've been using Zabbix for years, an d I ad a special alert system that should be processed in bash. I had no problem with that system in versions 3 to 5.
    Since in version 6.0 I had to create script for alerts, I faced this problem. and here is my problem.
    This is my action that works in old versions:
    Code:
    bash /usr/lib/zabbix/alertscripts/alert "{EVENT.NAME}","Date : {DATE}","address : {HOST.IP}","Name : {HOST.NAME}","Old value : {{HOST.HOST}:{ITEM.KEY}.avg(10m,3m)}","current value: {ITEM.VALUE}","changed value : http://{$ZABBIX_IP}/zabbix/history.php?action=showgraph#itemids[]={ITEM.ID}","changed device : {TRIGGER.URL}"
    specially this part:
    Code:
    "Old value : {{HOST.HOST}:{ITEM.KEY}.avg(10m,3m)}"
    what I did was to change the format to the new version as below
    Code:
    "Old value : avg(/{HOST.HOST}/{ITEM.KEY},3m:now-10m)"
    Or
    Code:
    "Old value : {avg(/{HOST.HOST}/{ITEM.KEY},3m:now-10m)}"
    Or whatever came to my mind, but it didn't work

    Is there any way that make it work?
    Thanks in advance
Working...