Skip to main content

Overview

NMIS provides comprehensive network discovery capabilities to automatically find and add devices to your monitoring environment. The discovery engine uses multiple methods including SNMP polling, subnet scanning, and neighbor detection protocols like CDP and LLDP.

SNMP Discovery

Query devices using SNMP to gather system information and identify device types

Subnet Scanning

Scan IP ranges to find active devices and automatically add them to monitoring

CDP/LLDP Detection

Discover network topology by collecting neighbor information from Layer 2 protocols

Auto-Classification

Automatically classify discovered devices based on SNMP sysObjectID and vendor information

Discovery Methods

SNMP-Based Discovery

NMIS uses SNMP to query devices and gather identifying information including:
  • sysObjectID: Unique identifier for device type and vendor
  • sysDescr: System description containing hardware and software details
  • sysName: Configured hostname
  • sysLocation and sysContact: Device metadata
The discovery process attempts multiple SNMP versions (v1, v2c, v3) with configured community strings or credentials.
# From Node.pm:75-89
sub new {
    my ( $class, %args ) = @_;    
    return if ( !$args{nmisng} );
    return if ( !$args{uuid} );
    
    my $self = {
        _nmisng            => $args{nmisng},
        _id                => $args{_id} // $args{id} // undef,
        uuid               => $args{uuid},
        collection         => $args{nmisng}->nodes_collection(),
        encryption_enabled => NMISNG::Util::getbool($args{nmisng}->config->{'global_enable_password_encryption'})
    };
    bless( $self, $class );
}

Subnet Scanning

Define IP ranges or subnets to scan for active devices:
# Discover devices in a subnet
nmis-cli act=discover subnet=192.168.1.0/24

# Discover with specific SNMP community
nmis-cli act=discover subnet=10.0.0.0/16 community=public
Discovery operations can be scheduled to run automatically using the NMIS scheduler. This ensures your device inventory stays up-to-date as network changes occur.

CDP and LLDP Neighbor Discovery

NMIS collects neighbor information from Cisco Discovery Protocol (CDP) and Link Layer Discovery Protocol (LLDP) to:
  • Map network topology automatically
  • Discover connected devices that may not be in configured subnets
  • Build neighbor relationships for visualization
CDP Information Collected:
  • Neighbor device ID
  • Neighbor IP address
  • Platform and capabilities
  • Interface connections
LLDP Information Collected:
  • System name and description
  • Management addresses
  • Port descriptions
  • System capabilities

Discovery Configuration

Default Configuration

NMIS uses sensible defaults for discovery that can be customized:
# From Node.pm:195-207
sub _defaults {
    my ( $self, $configuration ) = @_;    
    $configuration->{port} //= 161;
    $configuration->{max_msg_size} //= $self->nmisng->config->{snmp_max_msg_size};
    $configuration->{max_repetitions} //= 0;
    # Set default polling policy
    $configuration->{polling_policy} ||= "default";
    
    return $configuration;
}

Discovery Parameters

subnet
string
IP subnet to scan in CIDR notation (e.g., 192.168.1.0/24)
community
string
SNMP community string for SNMPv1/v2c authentication
version
string
SNMP version to use: snmpv1, snmpv2c, or snmpv3
port
number
default:"161"
SNMP port to query
timeout
number
default:"3"
SNMP timeout in seconds
retries
number
default:"2"
Number of SNMP retry attempts

CLI Discovery Commands

Basic Discovery

# Discover all devices in configuration
nmis-cli act=discover

# Discover specific subnet
nmis-cli act=discover subnet=192.168.1.0/24

# Discover with custom community
nmis-cli act=discover subnet=10.0.0.0/24 community=mycommunity

Advanced Discovery Options

# SNMPv3 discovery
nmis-cli act=discover host=192.168.1.1 \
  version=snmpv3 \
  username=nmis \
  authprotocol=sha \
  authpassword=authpass123 \
  privprotocol=aes \
  privpassword=privpass456

# Discover and auto-add to group
nmis-cli act=discover subnet=10.0.0.0/24 group=Branch-Office

# Test discovery without saving
nmis-cli act=discover-test host=192.168.1.1
Discovery operations can generate significant SNMP traffic. For large networks, consider:
  • Running discovery during maintenance windows
  • Using rate limiting or smaller subnet ranges
  • Testing with discover-test before committing changes

Node Properties Set During Discovery

When devices are discovered, NMIS automatically configures:
PropertySourceDescription
namesysName or IPDevice identifier
hostIP addressManagement IP
groupConfigurationLogical grouping
nodeModelsysObjectID lookupDevice model template
nodeTypeModel classificationrouter, switch, server, etc.
nodeVendorsysDescr/sysObjectIDCisco, Juniper, etc.
sysDescrSNMPSystem description
sysObjectIDSNMPVendor OID
sysLocationSNMPPhysical location
sysContactSNMPContact information

Integration with Models

Discovered devices are automatically matched to model files based on their sysObjectID. NMIS includes pre-built models for hundreds of device types:
  • Cisco routers and switches
  • Juniper devices
  • HP/Aruba equipment
  • Net-SNMP servers
  • Generic SNMP devices

Related: Device Management

Learn how to manage discovered nodes, create custom groups, and configure device properties

Discovery Best Practices

  1. Start Small: Test discovery on a small subnet before scanning large ranges
  2. Use SNMPv3: Whenever possible, use SNMPv3 for secure authentication
  3. Schedule Regular Discovery: Automate discovery to keep inventory current
  4. Validate Models: Ensure discovered devices are matched to appropriate model files
  5. Document Community Strings: Maintain a secure inventory of SNMP credentials by subnet
  6. Monitor Discovery Logs: Review logs to identify failed discovery attempts

Troubleshooting Discovery

Common Issues

No devices discovered:
  • Verify SNMP is enabled on target devices
  • Check firewall rules allow UDP port 161
  • Confirm community string or SNMPv3 credentials are correct
  • Test connectivity with snmpwalk command
Devices discovered but wrong model:
  • Check sysObjectID mapping in model files
  • Review discovery logs for classification details
  • Manually set nodeModel if auto-classification fails
Slow discovery:
  • Reduce subnet size or increase timeout
  • Check network latency to target devices
  • Consider parallel discovery for large networks
# Enable debug logging for discovery
nmis-cli act=discover subnet=192.168.1.0/24 debug=9

# Test SNMP connectivity
snmpwalk -v2c -c public 192.168.1.1 sysDescr

Next Steps

SNMP Monitoring

Configure SNMP polling and data collection for discovered devices

Device Management

Manage node properties, groups, and custom attributes

Build docs developers (and LLMs) love