Skip to content

Conversation

kennethdsheridan
Copy link
Collaborator

Summary

  • Added new direct flake installation option (Option 3) for Nix users
  • Fixed Darwin (macOS) compatibility issues by making Linux-specific tools conditional
  • Updated Apple SDK framework references to resolve deprecation warnings

Changes Made

  • README.md: Added comprehensive flake installation section with examples
  • flake.nix: Made runtime dependencies platform-aware (Linux vs Darwin)
  • .envrc: Suppressed verbose direnv output for cleaner development experience

Benefits

  • Nix users can now install directly with nix profile install github:sfcompute/hardware_report
  • macOS development environment now works without Linux-specific tool errors
  • Cleaner development experience with reduced verbosity

Test Plan

  • Verified flake builds on Darwin (ARM64 macOS)
  • Confirmed direnv loads cleanly without errors
  • Validated platform-specific dependency handling

kennethdsheridan and others added 5 commits July 29, 2025 08:15
- Complete NetBox API client with authentication and error handling
- Device creation/update with proper field mapping and 4U rack height for Digital Ocean nodes
- Enhanced network interface detection with inband/out-of-band classification
- IP address management with automatic subnet detection and primary IP assignment
- Detailed hardware component inventory (CPU per-socket, memory modules, storage, GPUs)
- Automatic site/manufacturer/device-type creation in NetBox
- Command-line options for NetBox configuration and dry-run mode
- Support for updating existing devices by serial number lookup

All NetBox device fields properly populated including:
- System information (name, serial, device type, manufacturer)
- Network interfaces with speeds, types, and NUMA topology
- IP addresses with role classification (primary, secondary, management)
- Hardware components with detailed specifications and custom fields
- BIOS/firmware information in custom fields

Usage: hardware_report --netbox --netbox-url <URL> --netbox-token <TOKEN>
- Add dedicated BMC interface creation with IPMI IP and MAC addresses
- Implement Tailscale VPN interface detection (100.64.0.0/10 CGNAT range)
- Enhanced IP address collection using all detected interface IPs
- Prioritize Tailscale IPs for primary IP assignment
- Add BMC information to device custom fields (bmc_ip, bmc_mac)
- Set explicit 4U rack height in device custom fields
- Improved IP role classification (VIP for BMC, anycast for Tailscale)
- Better primary IP detection logic with interface prioritization

NetBox BMC fields now populated:
- BMC interface with management-only flag
- BMC IP address with VIP role and proper DNS naming
- BMC MAC address in interface configuration
- Device custom fields include BMC IP/MAC for easy reference

Tailscale integration:
- Automatic detection of Tailscale interfaces and IP ranges
- Proper /32 subnet assignment for Tailscale IPs
- Custom fields and comments identifying VPN addresses
- Priority assignment as device primary IP when available
- Add oob_ip field to NetBox device structure for BMC IP reference
- Store BMC IP ID during creation for proper device field assignment
- Improve device update logic to set both primary_ip4 and oob_ip fields
- Enhance error handling and debugging output for IP assignments
- Ensure BMC interface and IP creation is properly tracked

This should fix the blank BMC IP and Primary IPv4 fields in NetBox by:
- Creating BMC IP address and storing its ID
- Setting device.oob_ip to reference the BMC IP address object
- Setting device.primary_ip4 to reference the primary IP address object
- Using proper NetBox API field references instead of string values

The height issue (1U vs 4U) may require device type recreation or manual update.
- Remove incorrect oob_ip field (NetBox doesn't have this native field)
- Add detailed debugging output for IP creation and device updates
- Show which IPs are selected as primary with clear indicators
- Display full update payload being sent to NetBox
- Add error details when device updates fail
- Store BMC info in custom fields since NetBox lacks native BMC fields

This version will show exactly:
- Which IPs are created and their IDs
- Which IP is selected as primary and why
- The exact payload sent to update the device
- Any errors returned by NetBox API

Run with --netbox-dry-run first to see the debug output without making changes.
…bility

- Add new Option 3 for direct flake installation from GitHub
- Fix Darwin compatibility by making Linux-specific tools conditional
- Update flake.nix to use proper Apple SDK frameworks
- Improve development shell hook with platform-specific messaging
- Suppress verbose direnv output for cleaner development experience

🤖 Generated with [Claude Code](https://claude.ai/code)

Co-Authored-By: Claude <[email protected]>
Copy link

semanticdiff-com bot commented Sep 24, 2025

Review changes with  SemanticDiff

Changed Files
File Status
  src/lib.rs  29% smaller
  src/posting.rs  12% smaller
  .envrc Unsupported file format
  README.md Unsupported file format
  flake.nix Unsupported file format
  src/bin/hardware_report.rs  0% smaller
  src/netbox.rs  0% smaller

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.

1 participant