Search code examples
zabbix

Monitor multiple values within one Item in Zabbix


We need to monitor a database table for response time of an action within our system. If the response time is above a threshold, we need to send an alert with details of the action: action_type, action_name, and others.

Is this possible with Zabbix?

I tried creating a Database monitor item with the following sql:

select action_type, action_name, window_title, response_time from db.table order by action_timestamp desc limit 1;

I was hoping that Zabbix would be able to store and display all the fields in the select, but it just gets the first value (for action_type) and not all the fields.

Is there a way to do it with Zabbix? It's pretty much a must for us so if we can't do it we'd have to go with a different monitoring tool.

EDIT: here's the notification syntax from an Action that is created hoping to use multiple values - from multiple items - in a notification sent following a trigger. My question here is, is this the correct syntax? Is my attempt at using multiple items in Item values: below going to work?

Trigger: {TRIGGER.NAME}
Trigger status: {TRIGGER.STATUS}
Trigger severity: {TRIGGER.SEVERITY}
Trigger URL: {TRIGGER.URL}

Item values:

1. Action name: {"Item ##5 Name"} ("Zabbix_server"}:{ITEM.KEY1}): {ITEM.VALUE1}
2. Window type: {"Item ##2 Name"} ("Zabbix_server"}:{ITEM.KEY2}): {ITEM.VALUE2}

Original event ID: {EVENT.ID} 

Solution

  • If a query returns more than one column, only the first column is read.

    Reference: https://www.zabbix.com/documentation/2.4/manual/config/items/itemtypes/odbc_checks

    => You can't process more than one value per item out of the box, because Zabbix design. You can still create one item/query per field.

    You can use some workarounds (zabbix UserParameter return 2 or more values), but you will hit another limitations.