Using the RCA path tool

Use these examples to understand how the RCA path tool can be used to display paths between specified source and target entities on the network.

Example of usage

The RCA path tool uses the OQL Service Provider, ncp_oql, to execute queries.

The following example command queries the full path between a source device with an entityId field value of 6 and a target device with an entityId field value of 137.

ncp_oql -domain NCOMS -service Events -query "select * from atoz.full 
where a = 6 and z = 137;"
The result of the query might look like this:
{
   ENTITYID=6;
   ENTITYNAME='router4';
}

{
   ENTITYID=385;
   ENTITYNAME='VLAN_OBJECT_router4_VLAN_37';
}

{  ENTITYID=137;
   ENTITYNAME='router4[ Fa0/3/3 ]';
}

( 3 record(s) :   Transaction complete )

Examples of queries

You can trace paths from a specific source entity, or optionally, from anything contained within that source entity. In addition, RCA path tool queries must always specify two entities, a source entity referred to as "a" and a target entity, referred to as "z", and these two entities represent the source and destination of the path. The source and target entities can be supplied as any combination of the following:
  • Entity IDs
  • Entity names
  • IP addresses
Queries can additionally choose to allow a path to be traced from any entity contained by the source. This can be useful when dealing with VLANs, where a direct path from a containing chassis to an interface might not exist.
Note: Queries are logged in the trace file for the Event Gateway process, ncp_g_event, at debug level 1; for example, your query log file might be called ncp_g_event.NCOMS.trace.
The following queries provide examples of how you can use the RCA path tool.
  1. Show the full path from entityId 102 to entityId 105.
    ncp_oql -domain NCOMS -service Events -query "select * from atoz.full 
    where a = 102 and z = 105;"
  2. Show the full path from the entity named 'rod' to the entity named 'freddy'.
    ncp_oql -domain NCOMS -service Events -query "select * from atoz.full 
    where a = 'rod' and z = 'freddy';"
  3. Show the current path from entityId 102 to the entity with IP address 172.21.226.3.
    ncp_oql -domain NCOMS -service Events -query "select * from atoz.current 
    where a = 102 and z = '172.21.226.3';"
  4. Show the current path from the interface named 'rod[ 0 [ 1 ] ]' to entityId 105.
    ncp_oql -domain NCOMS -service Events -query "select * from atoz.current 
    where a = 'rod[ 0 [ 1 ] ]' and z = 105;"
  5. Show the full path from entityId 102 to the entity with IP address 172.21.226.3. If no path is found, try to find a path from anything contained by the container of entityId 102. In other words, go up one level in the container hierarchy to get the container identifier, and then try to construct the path using as source entity each one of the entities contained in that container.
    ncp_oql -domain NCOMS -service Events -query "select * from atoz.full 
    where a = 102 and z = '172.21.226.3' and fromContained = 1;"
  6. When there is no path, this will be clearly indicated by the output.
    ncp_oql -domain NCOMS -service Events -query "select * from atoz.full 
    where a = 6 and z = 97;"
    If there is no path, the output will look something like the following:
    {
        EntityId=0;
        EntityName='No path found from A to Z';
    }
    ( 1 record(s) : Transaction complete )