You can discover devices over a network by using the vRealize Network Insight Cloud 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

  1. Log in to the Collector CLI as a Support user.
    Provide your CLI login credentials using the Secure Socket Shell (SSH) client.
  2. Switch to a Ubuntu user.
    ub
  3. 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
  4. 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"
    
  5. 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_name for each entry.
    1. (Optional) Enter your API credentials if you are discovering F5 Big-IP load balancers. API credentials are not supported for other devices.
    2. Save the file.
  6. 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
    --deployment type The type of deployment on which you are performing this operation. Accepted values are onprem and saas.

    The default value is onprem.

    --api_token The API refresh token to authenticate your vRealize Network Insight Cloud credentials.
    --cloud_location

    The location of the data center. Location can be US, UK, JP, AU, or DE.

    The default value is US.

    --cloud_api_url The URL of vRealize Network Insight Cloud. This option overrides the value provided in the --cloud_location option.
    --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 true to 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 True or False.
    --wait_time_in_secs The maximum wait time (in seconds) to discover devices.
  7. 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 saas --api_token YourCSPAPIToken --cloud_location UK --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 saas --api_token YourCSPAPIToken --cloud_location UK --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.
  8. Review the information on the CLI to determine the status of the operation.
  9. 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"
    
  10. (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 saas --api_token YourCSPAPIToken --cloud_location UK --proxy_ips 10.xx.xxx.xx --clear_all true

What to do next

You can bulk add the discovered network devices as data sources to vRealize Network Insight Cloud by using the network-insight-sdk-python SDK. See Bulk Add Data Sources Using the Python SDK for more information.