SNMP Use Case

Prev Next

A Discovery extension supplements the information collected during a discovery job. It retrieves values through the Protocol used by the job and uses the results to:

  • Create Custom Attributes that are not part of the standard inventory.

  • Replace a standard inventory value with a value returned by an extension command.

  • Populate a standard inventory value only when normal discovery does not return that value.

This example explains how to configure an SNMP Command set for network devices. The command set collects the system name as a Custom attribute and updates standard operating system and FQDN fields with values returned by SNMP OIDs.

Protocol: Run an SNMP discovery job to execute an SNMP command set.

Example scenario

An infrastructure administrator manages network devices discovered through SNMP. Standard discovery collects the device inventory, but the administrator also wants to:

  1. Store the device system name as a custom attribute named System Name.

  2. Replace the standard node.os inventory field with the operating system information returned by the SNMP agent.

  3. Replace the standard node.fqdn inventory field with the fully qualified device name returned by the SNMP agent.

  4. Run the added commands only on devices that match the selected OS Filter.

To meet these requirements, the administrator creates an SNMP command set, selects the applicable OS filter, adds the commands, and runs an SNMP discovery job against the target devices.

How the configuration works

The command set contains the following example commands:

Command

Trigger

SNMP OID

Output parser

Inventory result

Custom new field

New Field

1.3.6.1.2.1.1.5.0 (sysName.0)

First Line

Creates a custom attribute with the key System Name.

Override OS

Override

1.3.6.1.2.1.1.1.0 (sysDescr.0)

Regex: ^([^,]+)

Replaces the standard node.os value with the first part of the system description.

FQDN Override

Override

1.3.6.1.2.1.1.5.0 (sysName.0)

First Line

Replaces the standard node.fqdn value with the system name, if the SNMP agent reports a fully qualified domain name in sysName.0.

sysName.0 and sysDescr.0 are standard system-group OIDs. The regex shown is an example for extracting text before the first comma in a system description; confirm that this format matches the target devices.

Important

The screenshot uses OID 1.3.6.1.2.1.1.2.0 for the FQDN command. This is sysObjectID.0, which identifies the device type and does not return an FQDN. The example above uses sysName.0 instead. Confirm that the SNMP agent returns a fully qualified name in sysName.0 before mapping it to node.fqdn. You can get SNMP OID from any AI Agent.

Figure: SNMP Command Set

Figure: SNMP Command Set

SNMP discovery flow

  1. The SNMP discovery job connects to the target device using the configured SNMP account.

  2. Standard SNMP discovery identifies the device and collects the normal inventory.

  3. The extension checks whether the discovered operating system matches the command-set OS filter.

  4. If the filter matches, the extension sends each enabled SNMP GET request in the command set.

  5. The SNMP agent returns a value for each supported OID.

  6. The configured output parser processes each returned value.

  7. Discovery saves the parsed value as a custom attribute or standard inventory field, based on the selected trigger.

  8. The updated values appear on the Discovered Device Details page after the job completes.

Trigger options

Each command uses a trigger to determine how Discovery stores the parsed SNMP value.

New Field

Use New Field to create a custom attribute without changing a standard inventory field.

Configure the command with:

  • Command Name: Custom new field

  • Trigger: New Field - add as custom attribute

  • Custom Attribute Key: System Name

  • SNMP OID: 1.3.6.1.2.1.1.5.0 (sysName.0)

  • Output Parser: First Line

Result: The Custom Attributes tab displays the value returned for System Name.

Figure: Custom Attributes - SNMP

Figure: Custom Attributes - SNMP

Override the OS field

Use Override to replace a selected standard inventory field whenever the SNMP agent returns a usable value.

Configure the command with:

  • Command Name: Override OS

  • Trigger: Override - always overwrite standard field

  • Standard Field to Set: node.os

  • SNMP OID: 1.3.6.1.2.1.1.1.0 (sysDescr.0)

  • Output Parser: Regex

  • Regex (capture group 1): ^([^,]+)

Result: Discovery replaces the standard node.os value with the text before the first comma in the system description. Verify that the returned description uses this format on target devices before applying the regex broadly.

Override the FQDN field

Use a separate Override command to replace the standard FQDN field with a value returned by the SNMP agent.

Configure the command with:

  • Command Name: FQDN Override

  • Trigger: Override - always overwrite standard field

  • Standard Field to Set: node.fqdn

  • SNMP OID: 1.3.6.1.2.1.1.5.0 (sysName.0)

  • Output Parser: First Line

Result: Discovery replaces the standard node.fqdn value with the value returned by sysName.0.

Caution: sysName.0 commonly returns a hostname, not necessarily a fully qualified domain name. Use it for node.fqdn only when the target device’s SNMP agent returns the complete FQDN. Otherwise, select an OID that returns an FQDN for that device and verify its output before enabling the override.

Override replaces the existing standard value. Use it only when the OID and parser return a value appropriate for the selected field and more reliable or better formatted than the value collected through standard discovery.

In the following example, the SNMP extension is not applied, or the administrator disables the extension before running the SNMP job. You do not see custom attributes, and the FQDN value does not change as defined in the extension.

Figure: Discovery Extension job not applied

Figure: Discovery Extension job not applied

Now, the SNMP extension is active, and the SNMP job runs. You can see Custom Attributes on the Discovered Devices page and the FQDN change.

Figure: Discovery Extension job applied

Figure: Discovery Extension job applied