NMS-17006: Write sysName to node-label in requisition to match database#8413
NMS-17006: Write sysName to node-label in requisition to match database#8413Torchtopher wants to merge 4 commits intoOpenNMS:developfrom
Conversation
|
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 :) |
|
As Dino said, if this is only relevant for auto discovered nodes. The ideal location for this workflow should be |
|
I moved that logic to |
|
|
||
| /** {@inheritDoc} */ | ||
| public boolean updateRequisitionForNewSuspect(final String addrString, final OnmsNode node) { | ||
| return createUpdateRequistion(addrString, node, MonitoringLocationUtils.getLocationNameOrNullIfDefault(node), node.getForeignSource()); |
There was a problem hiding this comment.
we should only update node label on the requisition with the new label if they differ.
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
Once there is an issue, please:
${JIRA-ISSUE-NUMBER}: subject of pull request- yesExternal References