Skip to content

NMS-17006: Write sysName to node-label in requisition to match database#8413

Open
Torchtopher wants to merge 4 commits intoOpenNMS:developfrom
Torchtopher:develop
Open

NMS-17006: Write sysName to node-label in requisition to match database#8413
Torchtopher wants to merge 4 commits intoOpenNMS:developfrom
Torchtopher:develop

Conversation

@Torchtopher
Copy link
Copy Markdown

This fixes nms-17006, where a node would get assigned a name based on the value of sysName from SNMP, but this node label would not be reflected in the requisition, so a rescan would overwrite sysName with the IP and set it to user defined (line 192 of OnmsNodeRequisition.java). Now when updating the node name to sysName, it also updates the requisition.

Below is a video showing this behavior (previously node-label in the requisition xml would be set to the IP)

Video

I can change whatever, just wanted to see if overall I made the patch in the right code.

All Contributors

Contribution Checklist

  • Please make an issue in the OpenNMS issue tracker if there isn't one already.
    Once there is an issue, please:
    1. update the title of this PR to be in the format: ${JIRA-ISSUE-NUMBER}: subject of pull request - yes
    2. update the Jira link at the bottom of this comment to refer to the real issue number - yes
    3. prefix your commit messages with the issue number, if possible - can rewrite them
    4. once you've created this PR, please link to it in a comment in the Jira issue - ok

External References

@dino2gnt
Copy link
Copy Markdown
Contributor

dino2gnt commented Apr 1, 2026

Conceptually, nothing in OpenNMS should be modifying the content of the requisition dynamically. Requisitions are not guaranteed to be local to OpenNMS or even be managed locally. They exist as a source of truth which is frequently built from an external data source and pushed to OpenNMS, which would still overwrite these local changes.

Realistically, nodelabel changes such as you're describing are a relic of the days of automated discovery as the primary means of building an OpenNMS inventory and really shouldn't touch requisitioned nodes in the first place. If the administrator wants a friendly label on the node, it should go into the requisition :)

@cgorantla
Copy link
Copy Markdown
Contributor

cgorantla commented Apr 2, 2026

As Dino said, if this is only relevant for auto discovered nodes. The ideal location for this workflow should beNewSuspectScan and after NodeScan.

Copy link
Copy Markdown
Contributor

@cgorantla cgorantla left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Need updates.

@Torchtopher
Copy link
Copy Markdown
Author

I moved that logic to NewSuspectScan and wrote a function that wraps createUpdateRequistion which already does what we want. From testing it sometimes takes a minute to get to fixing the label (so the requisitions label is "wrong" for that time). Sorry for the delay.


/** {@inheritDoc} */
public boolean updateRequisitionForNewSuspect(final String addrString, final OnmsNode node) {
return createUpdateRequistion(addrString, node, MonitoringLocationUtils.getLocationNameOrNullIfDefault(node), node.getForeignSource());
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

we should only update node label on the requisition with the new label if they differ.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants