Ad Widget

Collapse

Activate script by right click on trigger name

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • FabrizioA
    Member
    • Sep 2015
    • 33

    #1

    Activate script by right click on trigger name

    Hi,

    Is there a way to execute a custom script by right click on trigger name (for example in dashboard) and select the script name?
    If yes, Zabbix should pass the expanded trigger name and host group to this script.
    Any suggestion?

    I'm using Zabbix 2.2

    Thanks
    F.
  • kloczek
    Senior Member
    • Jun 2006
    • 1771

    #2
    Admnistration -> Scripts
    http://uk.linkedin.com/pub/tomasz-k%...zko/6/940/430/
    https://kloczek.wordpress.com/
    zapish - Zabbix API SHell binding https://github.com/kloczek/zapish
    My zabbix templates https://github.com/kloczek/zabbix-templates

    Comment

    • FabrizioA
      Member
      • Sep 2015
      • 33

      #3
      Thank youk loczek, but what is the correct macro to take the expanded trigger name of the host??

      Comment

      • FabrizioA
        Member
        • Sep 2015
        • 33

        #4
        Can I use some macro that returns the expanded trigger description?

        Comment

        • kloczek
          Senior Member
          • Jun 2006
          • 1771

          #5
          Probably not all byt yes you can.

          I wrote so far only one menu script which been using hostname of the host of the host wth active trigger. I found that I was not able to use macro wich holds hostname byt I was able to use macro which holds hostid ({HOST.ID}). In ths case it was ot a problem because using zabbix API I've managed to change hostid to hostname.
          I would be not suprised if only macro relater to trigger would be {TRIGGER.ID}.

          To be hones I think that interface to the zabbix scripts should be extended.
          Problem which I found is related to use zabbix API and user priviledges with which zabbix API functions are executed. IMO it would be nice to have passed automatically to executed script evn zabbix API authentication tocken of the user which is clicking on web interface to execute script. Without this is on use in menu script zabbix API is necesary to use arbitrary zabbix user. This user may have different set of permissions and any modification done over zabbix API will be logged in audit log as done by not this user which executed menu script but by this one which is hardcoded in backend script.
          http://uk.linkedin.com/pub/tomasz-k%...zko/6/940/430/
          https://kloczek.wordpress.com/
          zapish - Zabbix API SHell binding https://github.com/kloczek/zapish
          My zabbix templates https://github.com/kloczek/zabbix-templates

          Comment

          Working...