Repository navigation
Conversation
check_redfish reports the asset tag of the system and of the chassis, but the source did not sync it, so servers which are only known via their BMC never got an asset tag in NetBox. The new option 'collect_hardware_asset_tag' (default: False) sets the system asset tag, falling back to the chassis asset tag, as the device asset tag. Placeholder values like 'Unknown' are ignored. An asset tag which another device in NetBox already has is not set and a warning is logged, since NetBox would reject the whole device update. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Adds the check_redfish option
collect_hardware_asset_tag(defaultFalse, so existing setups behave as before). When it's enabled, the device gets the asset tag the BMC reports:system.asset_tag, falling back tochassis.asset_tag.check_redfish inventory files already carry the asset tag, but the source didn't sync it. Servers known only through their BMC (no vCenter source) therefore never got an asset tag in NetBox. The VMware source has an option with the same name for ESXi hosts.
Unknown,N/A,To be filled by O.E.M., ...) are ignored, so a placeholder on the system doesn't hide a real chassis asset tag.Changes:
module/sources/check_redfish/config.py: the new optionmodule/sources/check_redfish/import_inventory.py:get_asset_tag()and setting the tag inupdate_device()settings-example.ini: the new option, wrapped as-ggenerates it (the rest of the file is left as is)tests/test_check_redfish_asset_tag.py: option off, system tag, chassis fallback, stripping, placeholders, a tag used by another device, and a device keeping its own tagTested against NetBox 4.7.4 with 62 HPE/Lenovo inventory files and a vCenter 8.0.3 source: 56 devices got their asset tag, including servers known only through Redfish, and a second run planned no further asset tag changes.
pytest: 418 passed, 8 skipped (AWS tests not run, boto3 not installed).🤖 Generated with Claude Code