diff -Nur zabbix-2.0.5/include/forms.inc.php zabbix_filter_disco/include/forms.inc.php
--- zabbix-2.0.5/include/forms.inc.php	2013-02-14 22:58:27.975731867 +0100
+++ zabbix_filter_disco/include/forms.inc.php	2013-02-28 10:28:23.314424248 +0100
@@ -339,6 +339,7 @@
 		$filter_status				= $_REQUEST['filter_status'];
 		$filter_templated_items		= $_REQUEST['filter_templated_items'];
 		$filter_with_triggers		= $_REQUEST['filter_with_triggers'];
+		$filter_discovery			= $_REQUEST['filter_discovery'];
 		$subfilter_hosts			= $_REQUEST['subfilter_hosts'];
 		$subfilter_apps				= $_REQUEST['subfilter_apps'];
 		$subfilter_types			= $_REQUEST['subfilter_types'];
@@ -346,6 +347,7 @@
 		$subfilter_status			= $_REQUEST['subfilter_status'];
 		$subfilter_templated_items	= $_REQUEST['subfilter_templated_items'];
 		$subfilter_with_triggers	= $_REQUEST['subfilter_with_triggers'];
+		$subfilter_discovery		= $_REQUEST['subfilter_discovery'];
 		$subfilter_history			= $_REQUEST['subfilter_history'];
 		$subfilter_trends			= $_REQUEST['subfilter_trends'];
 		$subfilter_interval			= $_REQUEST['subfilter_interval'];
@@ -361,6 +363,7 @@
 		$form->addVar('subfilter_status', $subfilter_status);
 		$form->addVar('subfilter_templated_items', $subfilter_templated_items);
 		$form->addVar('subfilter_with_triggers', $subfilter_with_triggers);
+		$form->addVar('subfilter_discovery', $subfilter_discovery);
 		$form->addVar('subfilter_history', $subfilter_history);
 		$form->addVar('subfilter_trends', $subfilter_trends);
 		$form->addVar('subfilter_interval', $subfilter_interval);
@@ -553,8 +556,12 @@
 			new CCol($snmpOidField),
 			new CCol(array(bold(_('Keep trends')), SPACE._('(in days)').': '), 'label'),
 			new CCol(new CNumericBox('filter_trends', $filter_trends, 8, null, true)),
-			new CCol(null, 'label'),
-			new CCol(),
+			new CCol(bold(_('Discovery').': '), 'label'),
+			new CCol(new CComboBox('filter_discovery', $filter_discovery, null, array(
+				-1 => _('all'),
+				0 => _('Discovered items'),
+				1 => _('Not Discovered items')
+			))),
 		));
 		// row 5
 		$table->addRow(array(
@@ -594,6 +601,7 @@
 			'status' => array(),
 			'templated_items' => array(),
 			'with_triggers' => array(),
+			'discovery' => array(),
 			'history' => array(),
 			'trends' => array(),
 			'interval' => array()
@@ -760,6 +768,31 @@
 				}
 			}
 
+			// discovery
+			if ($filter_discovery == -1) {
+				if ($item['flags'] == ZBX_FLAG_DISCOVERY_NORMAL && !isset($item_params['discovery'][0])) {
+					$item_params['discovery'][0] = array('name' => _('Not discovered'), 'count' => 0);
+				}
+				elseif ($item['flags'] == ZBX_FLAG_DISCOVERY_CREATED && !isset($item_params['discovery'][1])) {
+					$item_params['discovery'][1] = array('name' => _('Discovered'), 'count' => 0);
+				}
+				$show_item = true;
+				foreach ($item['subfilters'] as $name => $value) {
+					if ($name == 'subfilter_discovery') {
+						continue;
+					}
+					$show_item &= $value;
+				}
+				if ($show_item) {
+					if ($item['flags'] == 0) {
+						$item_params['discovery'][0]['count']++;
+					}
+					else {
+						$item_params['discovery'][1]['count']++;
+					}
+				}
+			}
+
 			// trends
 			if (zbx_empty($filter_trends)) {
 				if (!isset($item_params['trends'][$item['trends']])) {
@@ -848,6 +881,11 @@
 			$table_subfilter->addRow(array(_('With triggers'), $with_triggers_output));
 		}
 
+		if ($filter_discovery == -1 && count($item_params['discovery']) > 1) {
+			$discovery_output = prepare_subfilter_output($item_params['discovery'], $subfilter_discovery, 'subfilter_discovery');
+			$table_subfilter->addRow(array(_('Discovery'), $discovery_output));
+		}
+
 		if (zbx_empty($filter_history) && count($item_params['history']) > 1) {
 			$history_output = prepare_subfilter_output($item_params['history'], $subfilter_history, 'subfilter_history');
 			$table_subfilter->addRow(array(_('History'), $history_output));
diff -Nur zabbix-2.0.5/items.php zabbix_filter_disco/items.php
--- zabbix-2.0.5/items.php	2013-02-14 22:58:27.935750536 +0100
+++ zabbix_filter_disco/items.php	2013-02-28 10:11:16.371506389 +0100
@@ -175,6 +175,7 @@
 	'filter_trends' => array(T_ZBX_INT, O_OPT, P_UNSET_EMPTY, BETWEEN(0, 65535), null, _('Keep trends (in days)')),
 	'filter_status' =>			array(T_ZBX_INT, O_OPT, null,	IN('-1,0,1,3'), null),
 	'filter_templated_items' => array(T_ZBX_INT, O_OPT, null,	IN('-1,0,1'), null),
+	'filter_discovery' =>		array(T_ZBX_INT, O_OPT, null,	IN('-1,0,1'), null),
 	'filter_with_triggers' =>	array(T_ZBX_INT, O_OPT, null,	IN('-1,0,1'), null),
 	'filter_ipmi_sensor' =>		array(T_ZBX_STR, O_OPT, null,	null,		null),
 	// subfilters
@@ -182,6 +183,7 @@
 	'subfilter_types' =>		array(T_ZBX_INT, O_OPT, null,	null,		null),
 	'subfilter_value_types' =>	array(T_ZBX_INT, O_OPT, null,	null,		null),
 	'subfilter_status' =>		array(T_ZBX_INT, O_OPT, null,	null,		null),
+	'subfilter_discovery' =>	array(T_ZBX_INT, O_OPT, null,	null,		null),
 	'subfilter_templated_items' => array(T_ZBX_INT, O_OPT, null, null,		null),
 	'subfilter_with_triggers' => array(T_ZBX_INT, O_OPT, null,	null,		null),
 	'subfilter_hosts' =>		array(T_ZBX_INT, O_OPT, null,	null,		null),
@@ -261,6 +263,7 @@
 	$_REQUEST['filter_trends'] = get_request('filter_trends');
 	$_REQUEST['filter_status'] = get_request('filter_status', -1);
 	$_REQUEST['filter_templated_items'] = get_request('filter_templated_items', -1);
+	$_REQUEST['filter_discovery'] = get_request('filter_discovery', -1);
 	$_REQUEST['filter_with_triggers'] = get_request('filter_with_triggers', -1);
 	$_REQUEST['filter_ipmi_sensor'] = get_request('filter_ipmi_sensor');
 
@@ -282,6 +285,7 @@
 	CProfile::update('web.items.filter_trends', $_REQUEST['filter_trends'], PROFILE_TYPE_STR);
 	CProfile::update('web.items.filter_status', $_REQUEST['filter_status'], PROFILE_TYPE_INT);
 	CProfile::update('web.items.filter_templated_items', $_REQUEST['filter_templated_items'], PROFILE_TYPE_INT);
+	CProfile::update('web.items.filter_discovery', $_REQUEST['filter_discovery'], PROFILE_TYPE_INT);
 	CProfile::update('web.items.filter_with_triggers', $_REQUEST['filter_with_triggers'], PROFILE_TYPE_INT);
 	CProfile::update('web.items.filter_ipmi_sensor', $_REQUEST['filter_ipmi_sensor'], PROFILE_TYPE_STR);
 }
@@ -304,6 +308,7 @@
 	$_REQUEST['filter_trends'] = CProfile::get('web.items.filter_trends');
 	$_REQUEST['filter_status'] = CProfile::get('web.items.filter_status');
 	$_REQUEST['filter_templated_items'] = CProfile::get('web.items.filter_templated_items', -1);
+	$_REQUEST['filter_discovery'] = CProfile::get('web.items.filter_discovery', -1);
 	$_REQUEST['filter_with_triggers'] = CProfile::get('web.items.filter_with_triggers', -1);
 	$_REQUEST['filter_ipmi_sensor'] = CProfile::get('web.items.filter_ipmi_sensor');
 }
@@ -319,7 +324,8 @@
 
 // subfilters
 foreach (array('subfilter_apps', 'subfilter_types', 'subfilter_value_types', 'subfilter_status', 'subfilter_templated_items',
-	'subfilter_with_triggers', 'subfilter_hosts', 'subfilter_interval', 'subfilter_history', 'subfilter_trends') as $name) {
+	'subfilter_with_triggers', 'subfilter_hosts', 'subfilter_interval', 'subfilter_history', 'subfilter_trends',
+	'subfilter_discovery') as $name) {
 	$_REQUEST[$name] = isset($_REQUEST['filter_set']) ? array() : get_request($name, array());
 }
 
@@ -880,6 +886,10 @@
 			&& $_REQUEST['filter_templated_items'] != -1) {
 		$options['inherited'] = $_REQUEST['filter_templated_items'];
 	}
+	if (isset($_REQUEST['filter_discovery']) && !zbx_empty($_REQUEST['filter_discovery'])
+			&& $_REQUEST['filter_discovery'] != -1) {
+		$options['inherited'] = $_REQUEST['filter_discovery'];
+	}
 	if (isset($_REQUEST['filter_with_triggers']) && !zbx_empty($_REQUEST['filter_with_triggers'])
 			&& $_REQUEST['filter_with_triggers'] != -1) {
 		$options['with_triggers'] = $_REQUEST['filter_with_triggers'];
@@ -934,6 +944,9 @@
 				'subfilter_templated_items' => empty($_REQUEST['subfilter_templated_items'])
 					|| ($item['templateid'] == 0 && uint_in_array(0, $_REQUEST['subfilter_templated_items'])
 					|| ($item['templateid'] > 0 && uint_in_array(1, $_REQUEST['subfilter_templated_items']))),
+				'subfilter_discovery' => empty($_REQUEST['subfilter_discovery'])
+					|| ($item['flags'] == 0 && uint_in_array(0, $_REQUEST['subfilter_discovery'])
+					|| ($item['flags'] == 4 && uint_in_array(1, $_REQUEST['subfilter_discovery']))),
 				'subfilter_with_triggers' => empty($_REQUEST['subfilter_with_triggers'])
 					|| (count($item['triggers']) == 0 && uint_in_array(0, $_REQUEST['subfilter_with_triggers']))
 					|| (count($item['triggers']) > 0 && uint_in_array(1, $_REQUEST['subfilter_with_triggers'])),
