GV

GeezerVison

The World Wide Web, restored to 800 pixels of glory.

Home|About|Gaming cabinet|Archives|How it works|Starter sites

On this site

  • Sign in
  • ActionsCI/CD and automation
  • CodespacesCloud development environments
  • All Features
  • Documentation
  • Training
  • Certifications
  • Build with Copilot
  • Customize Copilot
  • Integrations
  • Trending repos
  • GitHub Sponsors
  • Developer articles
  • Enterprises

This view

  • Original page
  • New address

GeezerVison is showing github.com — python_code_samples_network/apic-em_get_inventory_stats at master · CiscoDevNet/python_code_samples_network

Expand file tree

/

apic-em_get_inventory_stats

/
Copy path

Directory actions

More options

More options

Directory actions

More options

More options

Latest commit

 

History

History
History
/

apic-em_get_inventory_stats

/
Copy path

Folders and files

NameName
Last commit message
Last commit date

parent directory

..
README.md
README.md
 
 
apic-em_get_inventory_stats.py
apic-em_get_inventory_stats.py
 
 

README.md

Outline

APIC-EM: Print some inventory statistics from APIC-EM

This script uses the APIC-EM REST API to grab the list of devices, and then prints out the list of device families, total counts of devices per family, model names per family, and software versions per model.

For example:

```
$ ./apic-em_get_inventory_stats.py --hostname 10.1.1.2 --username admin --password Cisco123
Routers (total: 3)
 CISCO891W-AGN-A-K9 (total: 1)
  15.4(2)T1 (total: 1)
 CSR1000V (total: 1)
  16.4.1 (total: 1)
 CISCO1941/K9 (total: 1)
  15.6(2)T2 (total: 1)

Switches and Hubs (total: 1)
 WS-C3560V2-24TS-E (total: 1)
  15.0(2)SE10 (total: 1)
...
```

Setup

This script has been tested with Python 2.7, and requires the following non-default module(s):

  • ncclient (pip install ncclient)
You are visitor 01402520 — GeezerVison does not store the pages you look up.
Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required.