Ad Widget

Collapse

MySQL query to find items in "not supported" status

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • crlf
    Junior Member
    • Mar 2013
    • 13

    #1

    MySQL query to find items in "not supported" status

    Hi,

    I'm using this query to find hosts that have items in "not supported" status, so that I can check why that is (and not having items go "not supported" by some reason* and not knowing about it):

    Code:
    SELECT i.key_ as item,
           h.name as host
    FROM items i, hosts h
    WHERE i.hostid = h.hostid
      AND h.status=0
      AND i.status=3
      AND i.key_ not like 'zabbix[process,%'
    ORDER BY h.name;
    How can I distinguish items created by discovery from the other items?

    These get re-enabled by themselves upon rediscovery, so I don't care about them.

    BTW, where can I get this information for discovery rules? (To find out the ones that are also in "not supported" state).

    * This can happen, for example, if an active UserParameter takes more than the specified Timeout for the agent. I was seeing this right now because a check that usually takes less than a second was taking more than 3 seconds occasionally.
  • BDiE8VNy
    Senior Member
    • Apr 2010
    • 680

    #2
    Via the flags column of the items table.
    See:
    Code:
    # sed -n 66,69p zabbix-2.0.6/frontends/php/include/defines.inc.php
    define('ZBX_FLAG_DISCOVERY_NORMAL',             0x0); // a normal item
    define('ZBX_FLAG_DISCOVERY',                    0x1); // a low level discovery rule
    define('ZBX_FLAG_DISCOVERY_CHILD',              0x2); // an item prototype
    define('ZBX_FLAG_DISCOVERY_CREATED',    0x4); // an item created via a discovery rule

    Comment

    Working...