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?
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?
Comment