ArnesSI / netbox-inventory

Manage your hardware inventory in NetBox
MIT License
191 stars 16 forks source link

Assigning inventory kind assets to devices #153

Open Azmodeszer opened 3 months ago

Azmodeszer commented 3 months ago

Okay, just so I understand this correctly, an asset object can be one of four "kinds":

Inventory Item (plugin) Inventory Item (native) Device (native) Module (native)

My issue in particular is that I have observed that I cannot assign a native device object to an asset if that asset is not of kind Device Type. To be more precise, I can specify the relationship with the Edit Assignment page, hit 'Save' and there are no errors, but the assignment is simply not being written to the database and no activity is shown in the changelog.

So this seems more like a bug to me? Or is this intentional? You could change the asset's kind to Device Type, BUT then the asset does not show up for any Inventory Item Groups (unsurprising, because it is not of kind Inventory Item anymore) and thus not in handy things like 'Asset count by status' which seems to me like defeating the point of the plugin. I tried setting both an inventory item type and a device type for an asset, but only one is allowed (this can be pushed through directly in the database, however then you can't edit the asset anymore ... :> ).

What is the intended way of doing things here? I have an asset object and want to link it to a hardware entry in the native database, but retain inventory-related overviews pertaining to status and group. I guess the thinking was that inventory items and full-blown NB devices are fundamentally different, but surely it makes sense for a lot of hardware to be relevant to native documentation in NB as devices while at the same time also being useful to keep track of as inventory.

matejv commented 3 months ago

When you have an asset that represents a device - such as a switch or outer, you create that asset by assigning it a device type, not an inventory item type.

When you do that you can then either:

When you do that, you have linked device and asset. So throughout netbox you have easy access from device to asset and associated asset data such as purchase, warranty info and so on.

Also take a look at this excelent explenation by @alehaa

Azmodeszer commented 2 months ago

Okay, so basically I can't have it both ways: Link an asset to a device and associate it with an Inventory Item Group. It's intentionally either/or?

matejv commented 2 months ago

Inventory item groups are grouping Inventory item types. (I suppose they should be called Inventory item type groups, but that seems a bit too verbose).

An equivalent function for devices would be to be able to group device types I suppose.

What is your use-case exactly? It might help to understand how to approach solving this.

Azmodeszer commented 2 months ago

Well, suppose there are a couple of desktops that are documented in NetBox natively since they are also relevant for network documentation. At the same time, it'd of course also be useful to track them as assets (ex. in terms of their status; in use, stored, repair, defective, etc.) as part of an inventory item group "Desktop". As it is now, I cannot do that; at best I could create separate device types and inventory item types for the same thing, but with no hard link between them.

I'm aware NetBox is not strictly an asset management system, but it would be a nice bonus to be able to extend the functionality with this plugin.