IMC
cancel
Showing results for 
Search instead for 
Did you mean: 

Getting all switches name and their Vlan from Database

 
SOLVED
Go to solution
Snelhard
Occasional Visitor

Getting all switches name and their Vlan from Database

Hello !

I am developping a software for a company, and i might need some help to exploit the IMC database.

Am loocking to list every switches with their Vlan and some other info. The database is enourmous and i don't know where to begin my research.

So if anyone know where is located the names, IP maybe, and which Vlan they are using it would be very nice.

Thank you !

3 REPLIES 3
Snelhard
Occasional Visitor

Re: Getting all switches name and their Vlan from Database

i think i've got it :

is it vlan.tbl_vlan_name : to get every Vlan that exists

and then check the dev_id with imc_inventory.tbl_inventory_dev to get the name of the device (switch).

 

Is that right ?

jguse
HPE Pro
Solution

Re: Getting all switches name and their Vlan from Database

Hello,

Generally speaking, we don't support using the database as a direct source for third-party application integration. Though I'm sure you could do it, and you seem to be looking at the right tables there, keep in mind that DB tables in IMC are not guaranteed to remain the same across updates. These probably will work - but in general it's a reason why DB should not be accessed directly. There's also the other caveat that using your own script to change things in the IMC DB is not supported (it will be really risky at best, and break the DB at worst).

To integrate third-party applications, the eAPI should be used. It supports JSON and XML and can be used to read and write information in a safe and supported way from/to IMC. There is plenty of documentation and tutorials:

Official Guide: https://support.hpe.com/hpsc/doc/public/display?docId=emr_na-c03382045

Tutorials:

Becoming a Guru with eAPIs: https://blogs.arubanetworks.com/industries/become-a-guru-with-imc-eapis/

Sample Python Project for IMC: https://pypi.org/project/pyhpeimc/

Deploying CLI Commands: https://abouthpnetworking.com/2014/04/28/hp-imc-eapi-deploying-cli-commands-part-1/

Video Tutorials:

Getting Started with eAPI: https://www.youtube.com/watch?v=gShXT4-2sSM

Working with Operators: https://www.youtube.com/watch?v=81Ivad5Hizw

Hope that helps.

Best regards,
Justin Guse

Working @ HPE
Snelhard
Occasional Visitor

Re: Getting all switches name and their Vlan from Database

Thank you for the reply HPE Employee.

The only things that i need is to read data that is in the database, I do not modify them.

I'll use the database directly for the moment, then i'll search about the API and learn how to use it in the future.

Thanks about for the advice and the information !