I've written the first version of this script
Merge https://github.com/GGabriele/network_inventory