You can discover devices over a network by using the vRealize Network Insight CLI and export the details of the discovered devices to a CSV file.
You can discover the following devices only:
- Cisco switches
- Arista switches
- Juniper switches
- Dell switches
- F5
- Brocade switches
- Palo Alto Networks
- Check Point Firewall
- Cisco ASA
Procedure
- Log in to the vRealize Network Insight Collector CLI as a Support user.
Provide your CLI login credentials using the Secure Socket Shell (SSH) client.
- Switch to a Ubuntu user.
ub
- Generate the Python script in your present working directory. You use this script to perform network discovery.
java -cp "/home/ubuntu/build-target/common-utils/tools-0.001-SNAPSHOT.jar" com.vnera.tools.DiscoveredDevicesTool -w script.py
- Generate the sample credentials file in your present working directory. You use this file to access the devices in your network.
java -cp "/home/ubuntu/build-target/common-utils/tools-0.001-SNAPSHOT.jar" com.vnera.tools.DiscoveredDevicesTool -s sample_creds.csv
The contents of the sample credentials file is as follows:
"credential_name","connection_type", "username", "password", "snmp_version", "community_string", "snmp_user", "snmp_context", "snmp_auth_type", "snmp_auth_password", "snmp_privacy_type", "snmp_privacy_password" "SSH1","SSH","admin","admin","","","","","","","","" "API1","API","admin","admin","","","","","","","","" "SNMP1","SNMP","","","v2c","community","","","","","","" "SNMP2","SNMP","","","v3","","user","context","authtype","authpass","privacytype","privacypass"
- Update the sample credentials file with your SSH, SNMP v2c, SNMPv3, or API credentials. You can enter multiple credentials in the CSV file by providing a unique
credential_namefor each entry.- (Optional) Enter your API credentials if you are discovering F5 Big-IP load balancers. API credentials are not supported for other devices.
- Save the file.
- Before you perform network discovery by using the Python script, run the help command on the Python script to list the possible options supported by the script.
python3 script.py --help
The supported options are as follows. Use these options to authenticate your credentials and perform network discovery.Option Description --host The IP address of the vRealize Network Insight platform. --deployment type The type of deployment on which you are performing this operation. Accepted values are onpremandsaas.The default value is
onprem.--username The user name of the platform user. --password The password of the platform user. --domain_type The type of domain for authentication. Accepted values are LOCALandLDAP.--domain_value If your domain type is LDAP, provide the LDAP domain name. --proxy_ips The list of proxy IP addresses on which you want to run network discovery. --credentials_file_path The credentials file which contains the SSH, SNMP, or API credentials. --network_ranges The range of IP addresses on which you want the network discovery to begin. You can specify the IP addresses in the network range format or the CIDR range format. --seeds The seed IP addresses or the seed FQDN of network devices on which you want the network discovery to begin. --seed_depth The depth of discovering network devices. The depth of the seed device is 0. The depth of the neighbors of the seed device neighbor is 1, and so on. --ignored_list The list of IP addresses on which you do not want to perform network discovery. You can specify the IP addresses in the following formats:
- Individual IP address
- FQDN details
- Network range
- CIDR range
--download_discovered_devices Enter trueto download the previously discovered devices.--out If the operation succeeds, the CSV file that contains the details of the discovered devices. The default name of the output file is auto_gen_discovered_devices.csv. --clear_all The option to erase all the details of the discovery such as discovery job, credential profile, job result, and discovered devices. Enter TrueorFalse.--wait_time_in_secs The maximum wait time (in seconds) to discover devices. - Run the Python script with the latest credentials file that you updated in Step 5.
While running the Python script to perform network discovery, you can:
Choice Example Provide the network range for discovery by using the --network_ranges option. python3 script.py --deployment_type onprem --username user --password pwd --domain_type LOCAL --proxy_ips 10.xx.196.xxx --out discovered_devices.csv --credentials_file_path sample_creds.csv --network_ranges 10.xxx.xx.158/24
Provide the seed address and the seed depth for network discovery by using --seeds and --seed_depth options. python3 script.py --deployment_type onprem --username user --password pwd --domain_type LDAP --domain_value vmware.com --proxy_ips 10.xx.196.xxx --out discovered_devices.csv --credentials_file_path sample_creds.csv --seeds 10.xxx.xx.xxx --seed_depth 2
Note: The python script only discovers devices that are within the reachability scope of the collector network. It does not discover devices that are available on the network, but not accessible from the collector network. - Review the information on the CLI to determine the status of the operation.
- If the operation completes, open the CSV file. An example of the CSV file is as follows:
"DataSourceType","IP","fqdn","Username","Password","CSPRefreshToken","NickName", "CentralCliEnabled","IPFixEnabled","SwitchType","ParentvCenter","IsVMC", "snmp_version","snmp_community_string","snmp_username","snmp_password", "snmp_auth_type","snmp_privacy_type","ProxyIP" "DataSource1","","Domain_name","username","<pwd>","", "nick_name_discovered_devices_1","","","","","","","","","","","","10.xx.xxx.xx" "DataSource2","10.1xx.xx.1x","","username","pwd","", " nick_name_discovered_devices_2","","","","","","","","","","","","10.xx.xx.xxx"
- (Optional) If the operation fails or has timed out, you can clear the details of the discovered devices and start a new network discover operation. Run the Python script with the --clear_all command. For example:
python3 script.py --deployment_type onprem --user_name user --password pwd --proxy_ips 10.xxx.xxx.xx --clear_all true
What to do next
You can bulk add the discovered network devices as data sources to vRealize Network Insight by using the network-insight-sdk-python SDK. See Bulk Add Data Sources Using the Python SDK for more information.