--- zabbix-2.5.0/frontends/php/include/classes/items/CHelpItems.php.orig 2015-06-21 23:37:45.000000000 +0000
+++ zabbix-2.5.0/frontends/php/include/classes/items/CHelpItems.php 2015-07-19 10:15:02.286312222 +0000
@@ -892,7 +892,7 @@
],
[
'key' => 'zabbix[items_unsupported]',
- 'description' => _('Number of unsupported items in Zabbix database.')
+ 'description' => _('Number of unsupported items in Zabbix database. Optionally add ,host to only count the items of this host.')
],
[
'key' => 'zabbix[java,,]',
--- a/src/libs/zbxdbcache/dbconfig.c 2015-02-23 13:28:13.000000000 +0100
+++ b/src/libs/zbxdbcache/dbconfig.c 2015-04-08 12:57:58.818671429 +0200
@@ -6325,7 +6325,7 @@
* Return value: the number of active unsupported items *
* *
******************************************************************************/
-int DCget_item_unsupported_count()
+int DCget_item_unsupported_count(zbx_uint64_t hostid)
{
int count = 0;
zbx_hashset_iter_t iter;
@@ -6339,6 +6339,9 @@
{
const ZBX_DC_HOST *dc_host;
+ if (hostid != 0 && hostid != dc_item->hostid)
+ continue;
+
if (ITEM_STATUS_ACTIVE != dc_item->status || ITEM_STATE_NOTSUPPORTED != dc_item->state)
continue;
--- zabbix-2.5.0/src/zabbix_server/poller/checks_internal.c.orig 2015-04-24 07:53:31.000000000 +0000
+++ zabbix-2.5.0/src/zabbix_server/poller/checks_internal.c 2015-07-19 10:21:03.494643528 +0000
@@ -97,15 +97,32 @@
SET_UI64_RESULT(result, DCget_item_count());
}
- else if (0 == strcmp(tmp, "items_unsupported")) /* zabbix["items_unsupported"] */
+ else if (0 == strcmp(tmp, "items_unsupported")) /* zabbix[items_unsupported,] */
{
- if (1 != nparams)
+ zbx_uint64_t hostid = 0;
+
+ if (1 > nparams || 2 < nparams)
{
error = zbx_strdup(error, "Invalid number of parameters.");
goto out;
}
- SET_UI64_RESULT(result, DCget_item_unsupported_count());
+ if ( 2 == nparams )
+ {
+ get_param(params, 2, tmp, sizeof(tmp));
+
+ if (0 != strcmp(tmp, "host"))
+ {
+ error = zbx_strdup(error, "Invalid second parameter.");
+ goto notsupported;
+ }
+ else
+ {
+ hostid = item->host.hostid;
+ }
+ }
+
+ SET_UI64_RESULT(result, DCget_item_unsupported_count(hostid));
}
else if (0 == strcmp(tmp, "hosts")) /* zabbix["hosts"] */
{