Sample complex discovery queries
You can use queries similar to these examples to identify devices that meet certain criteria, for example, devices that have been found by particular discovery agents.
Identifying devices that have been sent to a specific agent
The following example query identifies devices that have been sent to the IpRoutingTable agent.
select m_Name, m_ObjectId, m_Description
from IpRoutingTable.despatch;
go
.................................
{
m_Name='10.10.63.193';
m_ObjectId='1.3.6.1.4.1.9.1.108';
m_Description='Cisco Internetwork Operating System Software
IOS (tm) 7200 Software (C7200-JS-M), Version 12.0(4)T, RELEASE SOFTWARE (fc1)
Copyright (c) 1986-1999 by Cisco Systems, Inc.
Compiled Thu 29-Apr-99 06:27 by kpma';
}
.....
.....
{
m_Name='10.10.71.248';
m_ObjectId='1.3.6.1.4.1.9.1.258';
m_Description='Cisco Internetwork Operating System Software
IOS (tm) MSFC Software (C6MSFC-IS-M), Version 12.0(7)XE1, EARLY DEPLOYMENT
RELEASE SOFTWARE (fc1)
TAC:Home:SW:IOS:Specials b-ayo k-az-eem for info
Copyright (c) 1986-2000 by Cisco Systems, Inc.
Compiled Fri 04-Feb-00 00:';
}
Identifying devices that have been returned by a specific agent
The following example query identifies devices returned by the IpRoutingTable discovery agent.
select m_Name from IpRoutingTable.returns;
go
.................................
{
m_Name='10.10.71.248';
}
.....
.....
{
m_Name='10.10.71.248';
}
{
m_Name='10.10.71.248';
}
Identifying additional devices that have been discovered by a specific agent
An agent can discover additional devices
by interrogating a device. In this situation, the additional device
would be in the returns
table of that agent, but
not the despatch
table. You can identify which devices
are present in the IpRoutingTable.returns
table,
but not in the IpRoutingTable.despatch
table, by
performing a join between the IpRoutingTable.despatch
and IpRoutingTable.returns
tables,
as in the following example.
select IpRoutingTable.returns.m_Name from
IpRoutingTable.returns, IpRoutingTable.despatch
where
IpRoutingTable.returns.m_Name <>
IpRoutingTable.despatch.m_Name;
go
..........................................
{
m_Name='10.10.71.237';
}
.....
.....
{
m_Name='10.10.71.55';
}
{
m_Name='10.10.71.51';
}
Identifying the devices that an agent has enqueued
The following example returns those devices in the despatch table that have not yet been returned.
select * from <agent>.despatch
where
(
m_UniqueAddress NOT IN
(( select m_UniqueAddress from <agent>.returns where m_LastRecord = 1 ))
);