2

I'm running Zabbix v2.4.6. How can I determine what item checks are responsible for storing the most data?

I have had an exponential increase in stored data over the last month. I have a suspicion that someone may have miss-configured the storage/collection properties on an item check and I would like to verify this.

1 Answer 1

2

The following queries would give you items that have the most entries in history table:

SELECT itemid, count(*) AS cnt
FROM history
GROUP BY itemid
ORDER BY cnt DESC;

SELECT h.itemid, i.key_, count(*) AS cnt
FROM history h, items i
WHERE h.itemid = i.itemid
GROUP BY h.itemid
ORDER BY cnt DESC;

SELECT p.host, h.itemid, i.key_, count(*) AS cnt
FROM history h, items i, hosts p
WHERE h.itemid = i.itemid AND i.hostid = p.hostid
GROUP BY h.itemid
ORDER BY cnt DESC;

They are ordered from most simple that gives less information to a bit more complicated that gives more information, but may or may not be a bit more expensive to perform.

Same query can be repeated for history_uint, history_str, history_text and history_log tables. Note that log items in particular can suddenly start collecting more information due to a problem or unusual activity in the monitored software, even without any changes to Zabbix configuration.

7
  • thank you very much for your response... could you perhaps elaborate as to what you mean by "suddenly start collecting more information due to a problem or unusual activity in the monitored software, even without any changes to Zabbix configuration".
    – user320176
    Jan 18, 2016 at 5:48
  • Suppose we are monitoring some application, which lost connectivity to its main server. This application then starts logging "ERROR! Cannot connect to server! Help!" every second and all of these lines get stored in Zabbix.
    – asaveljevs
    Jan 18, 2016 at 6:36
  • As another example, suppose we are monitoring Apache log files. We have recently launched an ad campaign and we now get 500% more traffic than we used to. This could have also increased the amount of data Zabbix stores.
    – asaveljevs
    Jan 18, 2016 at 6:38
  • So you are suggesting that Zabbix could be collecting unnecessary information? What would be the easiest way to check for this unnecessary information?
    – user320176
    Jan 18, 2016 at 7:25
  • Not really - I was just giving an example how an amount of data can increase without any changes to Zabbix. Some general advices are given at zabbix.com/documentation/2.4/manual/appendix/… .
    – asaveljevs
    Jan 18, 2016 at 11:17

You must log in to answer this question.