Loading

×Sorry to interrupt
This page has an error. You might just need to refresh it.
[NoErrorObjectAvailable] Uncaught ReferenceError: addCTracking is not defined
Failing descriptor: {markup://c:KM_ArticleThemeLayout}

Refresh

Cookie Preference Center

General Information on cookies

When you visit our website, we use cookies to ensure that we give you the best experience. This information does not usually directly identify you, but it can give you a more personalized web experience. Because we respect your right to privacy, you can choose not to allow some types of cookies by clicking on the different category headings to find out more and change your settings. However, blocking some types of cookies may impact your experience on the site and the services we are able to offer. Further information can be found in our

Cookie Policy.

Strictly Necessary

Strictly Necessary

Always Active

Strictly Necessary

Strictly necessary cookies are always enabled since they are essential for our website to function. They enable core functionality such as security, network management, and website accessibility. You can set your browser to block or alert you about these cookies, but this may affect how the website functions. For more information please visit www.aboutcookies.org or www.allaboutcookies.org.

Cookie Details‎

Performance

Performance

Performance

Performance cookies are used to analyze the user experience to improve our website by collecting and reporting information on how you use it. They allow us to know which pages are the most and least popular, see how visitors move around the site, optimize our website and make it easier to navigate.

Cookie Details‎

Please confirm your settings by refreshing the page.

Functional

Functional

Functional

Functional cookies help us keep track of your past browsing choices so we can improve usability and customize your experience. These cookies enable the website to remember your preferred settings, language preferences, location and other customizable elements such as font or text size. If you do not allow these cookies, then some or all of these services may not function properly.

Cookie Details‎

Advertising

Advertising

Advertising

Advertising cookies are used to send you relevant advertising and promotional information. They may be set through our site by third parties to build a profile of your interests and show you relevant advertisements on other sites. These cookies do not directly store personal information, but their function is based on uniquely identifying your browser and internet device.

Cookie Details‎

Advertising Cookies

Consent Leg.Interest

Select All Vendors

Select All Vendors

Select All Hosts

Select All

Clear Filters

Information storage and access

Apply

Confirm My Choices Reject All Allow All

My Subscriptions

Loading

Knowledge Base

Smarts NCM: Can the API be queried for chassis serial numbers of devices in a stack (503273)

Last Updated: 5/29/2020Categories: How toTotal Views: 2510Language:
English

Subscribe to get an email
newsletter with new updates

Please provide article feedback:

Resolution

The NCM API gives remote access to a broad subset of functions and data that is ordinarily available to end users of the NCM Client UI. However, formatting and display based views of that data as presented in the Client UI are not always available. Serial numbers of device chassis for devices that participate in a stack under the same management IP address are an example of one instance where the data is not readily available through the API in the same, simple, list format that you can see in the Client UI. Stack sub component device chassis are currently only visible through the API as content encapsulated in configuration files pulled form the stack. Since stack component devices can change, it is considered subject to revision and those changes may be possible to track through the revision history for that device. If API access to that information is desired, it is currently necessary to parse the output of device configuration files to extract the data.

To obtain a list of stack sub component device chassis serial numbers for the latest revision of a given device from the NCM PostgreSQL Control Database for use in comparing to the Client UI data or data produced by external code that parses configuration file content for that data, you can do as follows:

Log into a command line shell on the NCM PostgreSQL Control Database (controldb) host as 'root' (Linux) or as a user with full local administrator privileges (Windows).

Run the following command to log into the controldb:

Linux:

su - pgdba -c 'psql voyencedb voyence'

Windows:

%VOYENCE_HOME%\db\controldb\bin\psql -p 5435 -h 127.0.0.1 --username=voyence -d voyencedb

Run the following commands to pepare a query that can be run against any device based on the Client UI visibile Device ID value for the device that outputs the list of known component device chassis serial numbers:

PREPARE current_stack_chassis_sn_list(int) AS
SELECT
h.element_name,
h.description,
h.serialnumber AS serial_number
FROM cm_device d
JOIN (
SELECT
device_id,
revision_id,
max(revision_number)
FROM cm_config_unit_revision
GROUP BY
device_id,
revision_id
) AS r
ON d.device_id = r.device_id
JOIN dm_hw_element_view h
ON r.revision_id = h.revision_id
WHERE
d.device_status = 'enum.deviceStatus.operational' AND
d.is_operational_device IS TRUE AND
element_name = 'Chassis' AND
device_idx = $1;

To execute the query, simply use the PostgreSQL EXECUTE command with the name of the query followed by the Device ID for the device as shown in the NCM Client UI for the device. This query will remain accessible to the Execute function until the end of your current database shell session, so you can run it repeatedly using different Device ID values as needed. For example:

voyencedb=# EXECUTE current_stack_chassis_sn_list(1003);
element_name | description | serial_number
--------------+---------------------------------------------------+---------------
Chassis | Cisco Catalyst 3750 (1 Slot) Chassis | CYS14190265
Chassis | Cisco EtherSwitch Service Module (2 Slot) Chassis | ESM00190266
Chassis | Cisco EtherSwitch Service Module (3 Slot) Chassis | ESM00190267
(3 rows)
voyencedb=#

Detectable by VMware SkylineTM

Actions

Copy

link to clipboard
copied!

Print

Language:
English

Attachments

Additional Resources

No results for undefined

Ask The Community

Get answers quickly from VMware experts in the community

Post Subject

CONTINUE IN COMMUNITIES

Related Products:

Related Versions:

VMware Smart Assurance - NCM

Take Our Survey

Support Assistant