ALERT: Some images may not load properly within the Knowledge Base Article. If you see a broken image, please right-click and select 'Open image in a new tab'. We apologize for this inconvenience.

How to get a report/list containing the device name and main IP/chassis address for Spectrum devices

book

Article ID: 240718

calendar_today

Updated On:

Products

DX NetOps

Issue/Introduction

This article provides two possible solutions to get this required list/report.

Environment

Release : 21.2.x

Component : Spectrum Reporting

Resolution

Solution 1: 
------------

Using a rest query:

http://<OC_server>:port/spectrum/restful/devices?attr=0x1006e&attr=0x12d7f

Here is an example of the result:

----------------------
<model mh="0x3000300">
<attribute id="0x1006e">SWITCH-01</attribute>
<attribute id="0x12d7f">xxx.xxx.xxx.xxx</attribute>
</model>
<model mh="0x3000302">
<attribute id="0x1006e">ROUTER_TEST</attribute>
<attribute id="0x12d7f">xxx.xxx.xxx.xxx</attribute>
</model>
<model mh="0x3041307">
<attribute id="0x1006e">FIREWALL-24567</attribute>
<attribute id="0x12d7f">xxx.xxx.xxx.xxx</attribute>
----------------------



Solution 2:
-----------

Using MySQL queries to be executed in the SRM/Reporting Manager database.

Here is the query ("reporting" DB):

select model_name,network_address from model where model_class=x order by model_name;

Where 'x' must be replaced by the model_class ID desired.

OBS: To know what is/are the ID's model_classes you need, you can run the following additional query:

select * from modelclass order by model_class;

The 'modelclass' table contains the id of all model types in spectrum.

Here is an example. Let's suppose you want to run a report to get the ip adresses from Routers and switches and Workstation-servers.

According to the modelclass table contents, we have the following (i.e):

Router = ID 3
Switch = ID 2
Workstation-server = ID 9

The query should be the following:

select model_name,network_address from model where model_class=3 or model_class=2 or model_class=9 order by model_name;

Additional Information

https://knowledge.broadcom.com/external/article?articleId=235422