Ad Widget

Collapse

Passing variables to alertscript

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • dimebag
    Junior Member
    • Dec 2015
    • 8

    #1

    Passing variables to alertscript

    Hello
    I wanted to create simple alert script which when cpu load is over 10% gets executed and send top result to email
    I got everything up and running but i can not find why zabbix does not pass argvs to my script so i do not have access to needed arguments when zabbix launch my script i created action , And added media type and created user media




    No matter what i do zabbix does not send any arguments to my script when executing it any idea what to do ?
    Script is simple mail script :
    Code:
    #!/bin/bash
    zabbix_get -s $2 -p 10050 -k cpu.tasks | mail -s "Task List from $2"
    Last edited by dimebag; 02-06-2016, 20:31.
  • Atsushi
    Senior Member
    • Aug 2013
    • 2028

    #2
    Please try add script parameters at Media type setting.

    ex.
    {ALERT.SENDTO}
    {ALERT.SUBJECT}
    {ALERT.MESSAGE}

    Comment

    • dimebag
      Junior Member
      • Dec 2015
      • 8

      #3
      Thank you.
      Though it was strange i just removed the media type and created exactly the same one again and it all started working nicely .

      Comment

      Working...