Ad Widget

Collapse

Functions do not work in script in v6.0

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

    #1

    Functions do not work in script in v6.0

    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

    The reason I did this that when an alert is triggered an special application should get connected to our radius server and make some changes.
    Is there any way that make it work?
    Thanks in advance
  • ali136
    Junior Member
    • Oct 2018
    • 13

    #2
    This is what it prints out:
    avg(/Router1/AVG_CPUs,3m:now-10m)
    everything seems alright, it's just not been calculated

    Comment

    Working...