Ad Widget

Collapse

Steps to exec script on trigger

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • RandySpinaGE
    Member
    • Jun 2006
    • 57

    #1

    Steps to exec script on trigger

    Im missing some basic understanding on alarms that execute a script.
    This is really 2 questions 1)why I am doing and 2) HOW
    Quick background
    I am trying to give an item value on repeat interval of an ON alarm
    Since built-in email repeat only gives the same value that triggered the alarm over and over.

    My thought was to repeat schedule a script to:
    1) VARIABLE=`zabbix_get -s zabbix_server -k testparam`
    (even tho Item is type "ZABBIX Agent" not type "ZABBIX Trapper" ...)
    2) echo $VARIABLE | mail -s "testparam is alarm ON" [email protected]
    2B) I was also going to echo dollar1=$1 dollar2=$2 etc... to a file to see whats useful. (self training)
    3) This should run at every repeat interval until OFF of trigger state

    BUT I DO NOT EVEN UNDERSTAND HOW TO SCHEDULE THE SCRIPT
    1) use basic Item of type "ZABBIX agent" (updated every 60 sec)
    2) create a standard trigger
    3) go to create media type -> give descript...select "script" type and in "Script name" field give full path to script which is /etc/zabbix/bin/alarmscripts/testparamalert.sh

    4) go to create ACTION select type "Remote command" -> source the correct trigger -> and in "remote command big fill in section I tried the full path again and / or just the decription given in the "create media type"

    Either way I get [ ERROR: Cannot add action]

    I Am missing something..
    In my search on forum I found: http://www.zabbix.com/forum/showthread.php?t=230
    Which talks about "add that media type to your user account. Set up a trigger that uses that script to alert you." Is the paradigm that the script is executed? You add some keywords like "myscript {HOSTNAME} {blabla}" to the "Remote command" fill-in field and Zabbix automatically emails the scripts standard out?

    Please help.....I tried forum search AND wiki
    I am running 1.1.3

    Happily for 9 months now
  • RandySpinaGE
    Member
    • Jun 2006
    • 57

    #2
    zabbix_server.conf file has the
    AlertScriptsPath=/home/zabbix/bin entry and my script is there
    Last edited by RandySpinaGE; 04-04-2007, 23:28.

    Comment

    • RandySpinaGE
      Member
      • Jun 2006
      • 57

      #3
      In case I was hitting 44 char limit

      AlertScriptsPath=/zab
      and my scriptname to A01.sh

      with FQ hostname + dir + script = 36

      Please help

      Comment

      Working...