Skip to content

NetMRI Import Tool

NetMRI Import Tool: Automated Device Migration to rConfig V8

Section titled “NetMRI Import Tool: Automated Device Migration to rConfig V8”

The NetMRI Import Tool enables seamless migration of network devices from Infoblox NetMRI to rConfig V8. This command-line utility automates the process of connecting to NetMRI’s REST API, extracting device inventory with organizational metadata (sites, zones), applying filters, mapping device types, and importing devices with proper templates and credentials—eliminating manual data entry and ensuring consistency across your device inventory.

NetMRI

Available in rConfig V8.1.1 This tool significantly reduces migration time by automating NetMRI API integration, device type mapping, and bulk imports with site/zone tag mapping.

While NetMRI provides enterprise-grade network automation, rConfig V8 offers a modern, flexible configuration management platform with:

Modern architecture: Cloud-ready platform with RESTful API and modern web interface

Cost-effective: Open-source foundation with professional support options vs. expensive enterprise licensing

Template engine: Advanced configuration snippet deployment with variable substitution and bulk changes

Flexible scheduling: Cron-based task scheduling with dependency management and parallel execution

Enhanced reporting: Rich analytics, change tracking, and configuration comparison with export capabilities

Extensible integrations: Open API for custom integrations with monitoring, ticketing, and automation platforms

Active development: Regular updates and community-driven feature development

The NetMRI Import Tool makes this transition seamless with automated API-based device extraction and intelligent mapping.

The import process follows four steps:

  1. Setup NetMRI connection: Configure API endpoint, authentication, and device filters
  2. Create device type mappings: Define how NetMRI device types translate to rConfig templates, vendors, and credentials
  3. Load devices from NetMRI: Connect to NetMRI API, apply filters, and generate import-ready JSON
  4. Import devices to rConfig: Bulk import devices with validated configurations and immediate backup scheduling

The import tool uses the following file locations:

  • Connection file: storage/app/rconfig/netmri_connection.json
  • Connection stub: storage/app/rconfig/netmri_connection.stub.json
  • Mappings file: storage/app/rconfig/netmri_mappings.json
  • Temporary files: storage/app/rconfig/tempdir/
  • Import JSON files: storage/app/rconfig/tempdir/rconfig_import_YYYY-MM-DD_HH-mm-ss.json
  • Failure logs: storage/app/rconfig/tempdir/netmri_import_failures_YYYY-MM-DD_HH-mm-ss.txt

These directories are created automatically if they don’t exist.

Before importing devices, ensure you have:

  • Access to NetMRI instance with API enabled
  • NetMRI API credentials (username/password or API token)
  • Network connectivity from rConfig server to NetMRI API endpoint
  • Administrator access to rConfig V8
  • Device templates configured in rConfig matching your NetMRI device types
  • At least one credential set created in rConfig (required for device authentication)
  • SSH/command-line access to the rConfig server
Terminal window
php /var/www/html/rconfig8/current/artisan rconfig:netmri-connection
  • --setup - Configure NetMRI API connection interactively
  • --test - Test existing connection to NetMRI
  • --show - Display current connection configuration
  • --edit-filters - Configure device filters (sites, zones, types)
  • --set-url=URL - Update API URL only
  • --clear - Remove connection configuration
  • --info - Display command help and usage information
Terminal window
php /var/www/html/rconfig8/current/artisan rconfig:netmri-connection --setup

You’ll be prompted to provide:

NetMRI API URL: Full URL to your NetMRI instance (e.g., https://netmri.company.com)

API Version: NetMRI API version (default: 3.9, supports 3.x and higher)

Authentication type: Choose between:

  • Basic Auth: Username and password authentication
  • API Token: Token-based authentication (recommended for security)

Credentials:

  • For basic auth: Username and password (optional password storage)
  • For token auth: API token value

SSL Verification: Enable/disable SSL certificate verification (disable for self-signed certificates)

Password storage: Option to encrypt and store password in config file (not recommended for production)

The setup creates storage/app/rconfig/netmri_connection.json:

{
"api_url": "https://netmri.company.com",
"api_version": "3.9",
"auth_type": "basic",
"username": "api_user",
"password": null,
"password_encrypted": false,
"api_token": null,
"verify_ssl": true,
"timeout": 30,
"created_at": "2025-01-25T14:30:00Z",
"last_tested": "2025-01-25T14:35:00Z",
"connection_status": "success",
"netmri_version": "7.6.1",
"device_count": 1247,
"filters": {
"include_sites": [],
"exclude_sites": [],
"include_zones": [],
"exclude_zones": [],
"include_device_types": [],
"exclude_device_types": [],
"only_managed": true
}
}

Basic Authentication (username/password):

  • Standard HTTP basic auth to NetMRI API
  • Password can be stored (encrypted) or prompted for each use
  • Best for: Testing and development environments

API Token (recommended):

  • Token-based authentication for enhanced security
  • Token stored encrypted in configuration file
  • Best for: Production environments
  • Generate token in NetMRI: Admin > API Tokens

Verify NetMRI connectivity:

Terminal window
php /var/www/html/rconfig8/current/artisan rconfig:netmri-connection --test

Output on success:

Testing connection to: https://netmri.company.com
✓ Connection successful!
NetMRI version: 7.6.1
Total devices: 1247
Terminal window
php /var/www/html/rconfig8/current/artisan rconfig:netmri-connection --show

Output displays:

Current NetMRI Connection Configuration:
API URL: https://netmri.company.com
API Version: 3.9
Auth Type: basic
Username: api_user
Password: not stored (will prompt)
Verify SSL: yes
Timeout: 30s
Connection Status: success
Last Tested: 2025-01-25T14:35:00Z
NetMRI Version: 7.6.1
Total Devices: 1247
Active Filters:
Include Sites: DC-East, DC-West
Exclude Zones: Lab, Testing
Only Managed Devices: yes

NetMRI organizes devices by sites, zones, and device types. Configure filters to selectively import devices:

Terminal window
php /var/www/html/rconfig8/current/artisan rconfig:netmri-connection --edit-filters

The tool will:

  1. Connect to NetMRI API: Authenticate using stored credentials
  2. Fetch metadata: Retrieve available sites, zones, and device types with device counts
  3. Configure site filters: Choose to include all, include specific, or exclude specific sites
  4. Configure zone filters: Choose to include all, include specific, or exclude specific zones
  5. Configure device type filters: Choose to include all, include specific, or exclude specific types
  6. Set managed filter: Option to import only managed devices (recommended)

Example site filter configuration:

Available Sites in NetMRI:
- DC-East (523 devices)
- DC-West (487 devices)
- Branch-Offices (237 devices)
Filter by sites?
Import all sites
Include specific sites
Exclude specific sites

Example zone filter configuration:

Available Zones in NetMRI:
- Core (145 devices)
- Distribution (298 devices)
- Access (652 devices)
- DMZ (89 devices)
- Lab (63 devices)
Filter by zones?
Import all zones
Include specific zones
Exclude specific zones

Filter estimation:

After configuring filters, the tool estimates the device count:

Filters saved!
Estimated devices to import: 856 (391 filtered out)

NetMRI organizes devices hierarchically:

Sites (Data Centers, Campuses)
└── Zones (Core, Distribution, DMZ, Access)
└── Networks (Subnets)
└── Devices

Mapping to rConfig:

  • Sites → Device groups or tags (configured in mappings)
  • Zones → Tags (configured in mappings)
  • Device Types → Templates (configured in mappings)

BEST PRACTICE: Configure filters before loading devices to reduce processing time and focus on production devices only. Use “only managed devices” to exclude unmanaged or decommissioned equipment.

Terminal window
php /var/www/html/rconfig8/current/artisan rconfig:netmri-device-mappings
  • --list - Display all existing device type mappings
  • --add - Create a new device type mapping interactively
  • --edit=TYPE - Modify an existing mapping for specified device type
  • --delete=TYPE - Remove a device type mapping
  • --info - Display command help and usage information
Terminal window
php /var/www/html/rconfig8/current/artisan rconfig:netmri-device-mappings --add

You’ll be prompted to provide:

NetMRI device type: The device type from NetMRI (e.g., cisco-ios, juniper-junos, arista-eos)

rConfig device type: The internal device type name (e.g., cisco_ios)

Template ID: The device template ID to use for this device type

Vendor ID: The vendor ID associated with this device type

Category ID: The category ID for organizing devices

Credential ID: The pre-created credential set ID (devices will use this by default)

Default Group ID: Optional device group ID to assign devices to

Prompts: Device enable and main prompts (use {device_name} as placeholder)

Tags: Multi-select tags for device classification (use Space to select, Enter to confirm)

Site/Zone tag mapping: Map NetMRI sites/zones to additional tags (optional)

  • cisco-ios: Cisco IOS routers and switches
  • cisco-nxos: Cisco Nexus data center switches
  • cisco-asa: Cisco ASA firewalls
  • juniper-junos: Juniper JunOS devices
  • arista-eos: Arista Networks switches
  • hp-procurve: HP ProCurve switches
  • paloalto-panos: Palo Alto firewalls
  • fortinet-fortigate: Fortinet FortiGate firewalls
  • f5-big-ip: F5 BIG-IP load balancers

Map NetMRI organizational structure to rConfig tags:

Do you want to map NetMRI sites/zones to additional tags? (yes/no)
> yes
You can map NetMRI site or zone names to specific tag IDs.
Example: Map "DMZ" zone to a "DMZ" tag ID
Enter NetMRI site or zone name (e.g., "DMZ", "DC-East"):
> DMZ
Enter tag ID to assign to devices in this site/zone:
> 15
Add another site/zone mapping? (yes/no)
> yes
Enter NetMRI site or zone name (e.g., "DMZ", "DC-East"):
> DC-East
Enter tag ID to assign to devices in this site/zone:
> 10

This automatically assigns additional tags to devices based on their NetMRI site or zone during import.

Terminal window
php /var/www/html/rconfig8/current/artisan rconfig:netmri-device-mappings --list

Output displays all configured mappings:

=== CISCO-IOS ===
rConfig Type: cisco_ios
Template ID: 1
Vendor ID: 1
Category ID: 2
Credential ID: 5
Default Group ID: 1
Prompts:
- device_enable_prompt: {device_name}>
- device_main_prompt: {device_name}#
Tags: 5, 8
Site/Zone Tag Mapping:
- DMZ: Tag ID 15
- DC-East: Tag ID 10
Terminal window
# Edit existing mapping
php /var/www/html/rconfig8/current/artisan rconfig:netmri-device-mappings --edit=cisco-ios
# Delete mapping
php /var/www/html/rconfig8/current/artisan rconfig:netmri-device-mappings --delete=cisco-ios

The mappings are stored in storage/app/rconfig/netmri_mappings.json:

{
"cisco-ios": {
"template_id": 1,
"vendor_id": 1,
"category_id": 2,
"credential_id": 5,
"default_group_id": 1,
"prompts": {
"device_enable_prompt": "{device_name}>",
"device_main_prompt": "{device_name}#"
},
"tags": [5, 8],
"device_type": "cisco_ios",
"site_zone_tag_mapping": {
"DMZ": 15,
"DC-East": 10
}
}
}

CAUTION: Accurate mappings are critical for successful imports. Verify template, vendor, category, and credential IDs exist in rConfig before creating mappings. Credential sets must be created in rConfig before running mappings setup.

Terminal window
php /var/www/html/rconfig8/current/artisan rconfig:netmri-load-devices
  • --batch-size=N - Number of devices to fetch per API call (default: 100)
  • --max-devices=N - Maximum number of devices to import (for testing)
  • --info - Display command help and usage information
  1. Prerequisite checks: Validates connection and mappings exist
  2. Connection test: Verifies NetMRI API connectivity
  3. Filter display: Shows active filters for confirmation
  4. API pagination: Fetches devices in batches from NetMRI API
  5. Filter application: Applies site, zone, and device type filters
  6. Device processing: For each device:
    • Extracts name, IP, model, type, site, zone
    • Looks up device type mapping
    • Applies credential from mapping
    • Maps site/zone to additional tags
    • Validates data completeness
  7. JSON generation: Creates timestamped import file
  8. Failure logging: Records devices that failed processing

The tool queries these NetMRI API endpoints:

  • /api/3.x/about - NetMRI version and system info
  • /api/3.x/devices/index - Device inventory list
  • /api/3.x/device_sites/index - Available sites with device counts
  • /api/3.x/device_zones/index - Available zones with device counts
  • /api/3.x/device_types/index - Device types with device counts

If password was not stored during setup, you’ll be prompted:

Password for api_user: ********

For API token authentication, the token is retrieved from the connection file automatically.

Before processing, active filters are displayed:

Active filters:
Include Sites: DC-East, DC-West
Exclude Zones: Lab, Testing
Only Managed Devices: yes
Proceed with device loading? (yes/no)
Loading NetMRI connection info...
✓ Found connection to: https://netmri.company.com
Connecting to NetMRI...
✓ Connected successfully
Active filters:
Include Sites: DC-East, DC-West
Exclude Zones: Lab, Testing
Only Managed Devices: yes
Proceed with device loading? (yes/no)
> yes
Fetching devices from NetMRI...
Retrieved 856 devices from NetMRI
Processing devices ████████████████████ 100%
Device loading completed successfully!
Generated rConfig compatible data: rconfig_import_2025-01-25_14-45-30.json
Valid devices processed: 823
15 devices failed processing. See netmri_import_failures_2025-01-25_14-45-30.txt

Success file: storage/app/rconfig/tempdir/rconfig_import_2025-01-25_14-45-30.json

Failures file: storage/app/rconfig/tempdir/netmri_import_failures_2025-01-25_14-45-30.txt

All devices in a mapping use the same credential set specified in the mapping:

  • device_cred_id: Set from mapping’s credential_id field
  • No per-device credential extraction (unlike RANCID)
  • Credential must be pre-created in rConfig before mapping setup

Benefits:

  • Simplifies credential management
  • Forces credential consolidation (best practice)
  • More secure than storing credentials in JSON
  • User controls credential assignment via mappings

Advanced scenarios:

If different devices of the same type need different credentials:

  • Create multiple mappings with device type filters
  • Manually override credentials post-import
[
{
"device_name": "core-rtr-01",
"device_ip": "10.1.1.1",
"device_model": "Cisco 7606",
"template_id": 1,
"vendor_id": 1,
"device_category_id": 2,
"device_cred_id": 5,
"prompts": {
"device_enable_prompt": "core-rtr-01>",
"device_main_prompt": "core-rtr-01#"
},
"tags": [5, 8, 10],
"netmri_device_type": "cisco-ios",
"netmri_site": "DC-East",
"netmri_zone": "Core",
"group_id": 1,
"connection_type": "ssh",
"port": 22
},
{
"device_name": "fw-dmz-01",
"device_ip": "10.2.5.10",
"device_model": "ASA 5585",
"template_id": 3,
"vendor_id": 1,
"device_category_id": 4,
"device_cred_id": 7,
"prompts": {
"device_enable_prompt": "fw-dmz-01>",
"device_main_prompt": "fw-dmz-01#"
},
"tags": [5, 8, 15],
"netmri_device_type": "cisco-asa",
"netmri_site": "DC-East",
"netmri_zone": "DMZ",
"group_id": 1,
"connection_type": "ssh",
"port": 22
}
]

For large NetMRI deployments (1000+ devices):

Terminal window
# Increase batch size for faster loading
php /var/www/html/rconfig8/current/artisan rconfig:netmri-load-devices --batch-size=200
# Test with limited devices first
php /var/www/html/rconfig8/current/artisan rconfig:netmri-load-devices --max-devices=50

The tool automatically paginates through all devices in batches to handle large inventories efficiently.

After processing, view a summary breakdown:

Would you like to view a summary? (yes/no)
> yes
823 devices processed successfully
Device type breakdown:
- cisco_ios: 458 devices
- juniper_junos: 189 devices
- cisco_nxos: 97 devices
- arista_eos: 79 devices
Site breakdown:
- DC-East: 412 devices
- DC-West: 411 devices
Zone breakdown:
- Core: 145 devices
- Distribution: 298 devices
- Access: 380 devices

NOTE: The {device_name} placeholder in prompts is automatically replaced with the actual device hostname during the loading process.

Terminal window
php /var/www/html/rconfig8/current/artisan rconfig:netmri-import-devices /path/to/rconfig_import.json
  • --group=ID - Assign all imported devices to specified device group (default: 1)
  • --dry-run - Preview import without modifying database
  • --info - Display command help and usage information

When run without a file path, the command offers:

What would you like to do?
Show information about this command
Import devices from a JSON file
Import from the latest available JSON file
Select from all available import files
Exit

Latest file mode: Automatically finds and uses the most recent JSON file

Select file mode: Displays all available import files with:

  • Filename
  • Modification date
  • File size
  • Device count (parsed from file)
  1. JSON validation: Verifies file structure and required fields
  2. Device validation: Checks each device for:
    • Required fields present
    • Valid IP address format
    • Template exists in database
    • Vendor exists in database
    • Category exists in database
    • Credential set exists in database
    • Prompts structure is valid
    • No duplicate devices (by name or IP)
  3. Validation report: Shows failed devices with specific errors
  4. User confirmation: Prompts to continue with valid devices only
  5. Transaction-based import: All valid devices imported in single transaction
  6. Device creation: Creates device records with mapped configurations
  7. Relationship linking: Associates:
    • Tags (many-to-many)
    • Vendor (many-to-many, single vendor)
    • Category (many-to-many, single category)
    • Template (many-to-many, single template)
  8. Duplicate handling: Automatically skips devices that already exist
  9. Summary report: Displays import statistics

Required fields:

  • device_name
  • device_ip (must be valid IP format)
  • device_model
  • template_id (must exist in database)
  • vendor_id (must exist in database)
  • device_category_id (must exist in database)
  • device_cred_id (credential set must exist if > 0)
  • prompts.device_enable_prompt
  • prompts.device_main_prompt

Duplicate detection:

  • No existing device with same device_name
  • No existing device with same device_ip

Test the import without making changes:

Terminal window
php /var/www/html/rconfig8/current/artisan rconfig:netmri-import-devices \
--dry-run \
storage/app/rconfig/tempdir/rconfig_import_2025-01-25_14-45-30.json

Output preview:

Running in dry-run mode - no database changes will be made
Found 823 devices in the import file
Validating devices ████████████████████ 100%
8 devices failed validation:
Device: old-switch-01
- Template ID 99 not found
Device: test-device-02
- Invalid IP address: 999.999.999.999
Continue with 815 valid devices? (yes/no)
> yes
Dry run completed. 815 devices would be imported.

Execute the actual import:

Terminal window
php /var/www/html/rconfig8/current/artisan rconfig:netmri-import-devices \
--group=2 \
storage/app/rconfig/tempdir/rconfig_import_2025-01-25_14-45-30.json

Or use the interactive menu to select the latest file:

Terminal window
php /var/www/html/rconfig8/current/artisan rconfig:netmri-import-devices
# Select: "Import from the latest available JSON file"

Import results:

Found 823 devices in the import file
Validating devices ████████████████████ 100%
Importing devices ████████████████████ 100%
Import completed successfully!
Imported: 815 devices
Skipped: 8 devices (already exist)

NOTE: All imports use database transactions. If any error occurs during import, all changes are rolled back automatically.

Terminal window
# Step 0: Setup NetMRI connection
php /var/www/html/rconfig8/current/artisan rconfig:netmri-connection --setup
# Enter API details:
# - API URL: https://netmri.company.com
# - API Version: 3.9
# - Auth type: basic
# - Username: api_user
# - Password: ********
# - Verify SSL: yes
# Test the connection
php /var/www/html/rconfig8/current/artisan rconfig:netmri-connection --test
# Configure device filters
php /var/www/html/rconfig8/current/artisan rconfig:netmri-connection --edit-filters
# Select filters:
# - Include sites: DC-East, DC-West
# - Exclude zones: Lab, Testing
# - Only managed devices: yes
# View connection info
php /var/www/html/rconfig8/current/artisan rconfig:netmri-connection --show
# Step 1: Create device type mappings
php /var/www/html/rconfig8/current/artisan rconfig:netmri-device-mappings --add
# Add mappings for NetMRI types: cisco-ios, juniper-junos, cisco-nxos, etc.
# Include site/zone tag mappings for organizational structure
# Verify mappings
php /var/www/html/rconfig8/current/artisan rconfig:netmri-device-mappings --list
# Step 2: Load devices from NetMRI
php /var/www/html/rconfig8/current/artisan rconfig:netmri-load-devices
# The command will:
# - Connect to NetMRI API
# - Apply configured filters
# - Process devices in batches
# - Generate timestamped JSON file
# Review summary
# Would you like to view a summary? yes
# Review failures log if any
cat storage/app/rconfig/tempdir/netmri_import_failures_2025-01-25_14-45-30.txt
# Step 3: Preview import (dry run)
php /var/www/html/rconfig8/current/artisan rconfig:netmri-import-devices \
--dry-run \
storage/app/rconfig/tempdir/rconfig_import_2025-01-25_14-45-30.json
# Step 4: Execute production import
php /var/www/html/rconfig8/current/artisan rconfig:netmri-import-devices \
--group=1 \
storage/app/rconfig/tempdir/rconfig_import_2025-01-25_14-45-30.json
# Or use interactive mode to select latest file
php /var/www/html/rconfig8/current/artisan rconfig:netmri-import-devices
# Select: "Import from the latest available JSON file"

Symptoms:

  • Error: “Connection failed: HTTP 401”
  • Error: “Connection failed: Could not resolve host”

Resolution:

Verify NetMRI API accessibility:

Terminal window
# Test network connectivity
ping netmri.company.com
# Test HTTPS connectivity
curl -k https://netmri.company.com/api/3.9/about
# Verify credentials
php /var/www/html/rconfig8/current/artisan rconfig:netmri-connection --test

Check connection configuration:

Terminal window
php /var/www/html/rconfig8/current/artisan rconfig:netmri-connection --show

Update API URL if needed:

Terminal window
php /var/www/html/rconfig8/current/artisan rconfig:netmri-connection --set-url=https://correct.url.com

Symptoms:

  • Error: “SSL certificate problem: self signed certificate”
  • Connection fails with SSL errors

Resolution:

Disable SSL verification (not recommended for production):

Edit connection file or re-run setup:

Terminal window
php /var/www/html/rconfig8/current/artisan rconfig:netmri-connection --setup
# When prompted for "Verify SSL certificates?": select "no"

Or install NetMRI’s CA certificate on the rConfig server.

Symptoms:

  • Error: “HTTP 401: Unauthorized”
  • Error: “Invalid credentials”

Resolution:

Verify credentials in NetMRI:

  • Log in to NetMRI web interface
  • Check API user permissions
  • For token auth: regenerate API token

Update connection configuration:

Terminal window
php /var/www/html/rconfig8/current/artisan rconfig:netmri-connection --setup

Symptoms:

  • Error: “NetMRI connection not configured!”
  • Tool prompts to run setup

Resolution:

Setup connection first:

Terminal window
php /var/www/html/rconfig8/current/artisan rconfig:netmri-connection --setup

Symptoms:

  • Error: “No device type mappings configured!”
  • Error: “Device type mappings file not found!”

Resolution:

Create mappings:

Terminal window
php /var/www/html/rconfig8/current/artisan rconfig:netmri-device-mappings --add

Verify mappings exist:

Terminal window
php /var/www/html/rconfig8/current/artisan rconfig:netmri-device-mappings --list

Symptoms:

  • Devices logged to failures file with “Unknown device type ‘xyz’. No mapping found.”

Resolution:

Identify missing device types from failures log:

Terminal window
cat storage/app/rconfig/tempdir/netmri_import_failures_2025-01-25_14-45-30.txt

Create missing mappings:

Terminal window
php /var/www/html/rconfig8/current/artisan rconfig:netmri-device-mappings --add

Invalid template/vendor/category/credential ID

Section titled “Invalid template/vendor/category/credential ID”

Symptoms:

  • Import fails with “Template ID X does not exist”
  • Validation shows “Credential set ID X not found”

Resolution:

Verify IDs exist in rConfig:

  • Navigate to Settings > Templates (or Vendors/Categories/Credentials)
  • Note the correct ID numbers
  • Update mapping with