0

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} 
Eddy
  • 3,533
  • 13
  • 59
  • 89

1 Answers1

2

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.

Community
  • 1
  • 1
Jan Garaj
  • 25,598
  • 3
  • 38
  • 59
  • I'm thinking of creating an item for each value, and then set a trigger & notification if one value goes above threshold. In such a case, would I be able to pass the values of the other Items into the notification? Does this make sense? – Eddy Jul 20 '15 at 09:36
  • If your item is part of trigger condition, then you can use item value in notification. So you can add always true condition(s) for items, which you want to use only in notification. – Jan Garaj Jul 20 '15 at 12:34
  • Thanks, Jan. I edited the question with the generic example given by the Zabbix documentation for an Action. It seems like this can handle multiple values? Is my syntax for "Item values" correct for multiple items? – Eddy Jul 20 '15 at 14:05