Ad Widget

Collapse

Complex Action

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • cozancin
    Junior Member
    • Nov 2012
    • 10

    #1

    Complex Action

    I am in the process of adding a number (over 100) checks for our application to zabbix. Each check will be two split into two items. The first will be a simple count of issues (0 means no issues). The second item will be populated with details of issues found (or empty if no issues are found).

    I have a test setup for this configuration. I have created a custom bash script that gets the count data and details of issues from the application. The script uses zabbix_sender to populate the detailed item and then returns the count. So far everything is working great. The item keys are as follows:

    test.count[]
    test.count.details[]

    Now for the problem. There are going to be a large number of these combinations. We want to create actions that will send details of issues found, including the detailed. I had hoped that there would be a way for the action to take the key root "test.count" and calculate the detailed item and pull the last entry to be included in the notification. If I could do that, I only have to create one action that will work with all combinations as long as I strictly follow the key naming.

    Unfortunately, zabbix actions do not seem to come close to allowing this type of dynamic data inclusion on the notification. The only alternative is to actually create 100+ actions (one for each trigger). This is not maintained or scalable. Has anyone done anything similar before. Ideally, it would be nice if there was a macro call {ITEM.KEYROOT<1-9>} that would give the root of the key. For example, if I had a key:

    test.count[*]

    {ITEM.KEYROOT} would expand to:

    test.count

    I could then use that to calculate the key I wanted as:

    {{HOST.HOST}:{ITEM.KEYROOT}.detail.last(0)}

    Beyond hacking zabbix and creating a patch to add KEYROOT, and maybe KEYPARM,1-9>, is there any way to get the keyroot?
  • cozancin
    Junior Member
    • Nov 2012
    • 10

    #2
    I should also note that test.count[] and test.count.detail[] will expand to test.count[test vector] and test.count.detail[testvector] when I move to the actual implementation phase.

    Comment

    • steveboyson
      Senior Member
      • Jul 2013
      • 582

      #3
      Why are you not using LLD rules?

      Comment

      • cozancin
        Junior Member
        • Nov 2012
        • 10

        #4
        When I deploy our solution, it will be via Low Level Discovery (LLD). However, unless I am missing something, LLD only allows for the dynamical creation of items, triggers, and graphs. It has nothing to do with actions, which still must be created manually.

        I have discovered a kludge that will allow me to work around my issue.

        My triggers can look for a count greater than 0 and also do a strlen on the detailed information and trigger if > -1. This is somewhat of a no-op that does waste some CPU resources, but it does now allow me to access the data as {ITEM.KEY2).
        Last edited by cozancin; 24-02-2014, 17:48.

        Comment

        Working...