netbox icon indicating copy to clipboard operation
netbox copied to clipboard

Allow addition of custom fields for devices

Open jpwgarrison opened this issue 10 years ago • 11 comments

This will help those of us hoping to migrate from untenable spreadsheets. We have attributes for devices that only make sense to our engineers, but they are important.

jpwgarrison avatar Jun 29 '16 22:06 jpwgarrison

How are you thinking about showing these custom fields? Would they have options on whether they were mandatory or displayed in the list/table of a section?

For example, I may be an engineer that would want to add a custom field to sites to label the site as an office or data center. I may think that would be important enough to display on the main site list or even filter by.

ryanmerolle avatar Jul 01 '16 15:07 ryanmerolle

Possible Supported Data/Form types for custom fields:

  • date
  • timestamp
  • boolean
  • int
  • text (short single line vs multi line)
  • urls? (I know can be text, but maybe it makes sense?)

ryanmerolle avatar Jul 01 '16 16:07 ryanmerolle

I just noticed this state for devices, it would probably make sense to be allowed for all types of data in dcim and ipam sections.

ryanmerolle avatar Jul 01 '16 16:07 ryanmerolle

+1 for URL handling, having direct links to iDrac/iLo consoles would be awesome.

jpwgarrison avatar Jul 01 '16 17:07 jpwgarrison

i believe the way lansweeper does it is it uses pre-existing fields in the device info table. custom1, custom2, custom3, up to whatever their max is.

then, in the device page, you can add the custom fields and add a descriptive field label for the page. we use this to list things such as: patch window, patch admin, audit owner, app owner, DBA team, ILO IP, KVM IP, etc.

i believe you can arrange these fields in lansweeper, such that they appear where you want them to on the screen. i don't know that this functionality is actually required though. maybe allow for device information in two columns, second column being custom fields, if any are populated, labeled by the assigned custom label.

i think this should be a site-wide custom field setting, though, so we don't have to track per-device customizations.

ghost avatar Jul 22 '16 17:07 ghost

I agree that custom attributes are needed for all types of data withing ipam and dcim at least. I feel I could use some custom fields for prefixes for instance. Could AVPs be a solution for these data types? And display them as a list of tags? Maybe with custom colours per tag so that they make sense and not become just a blob of chars? It would of course be nice if they are also searchable.

malaiam avatar Jul 27 '16 13:07 malaiam

RequestTracker by Best Practical supported the concept of custom fields that were not hard coded into the database schema. It was a complicated affair but I would still feel this is the better approach that giving a hard number of fields. Recently they've also added Asset Management functionality, probably based on this custom field architecture.

Perhaps an alternative is to store this additional custom metadata separate to the main database, e.g. in a document oriented database such as MongoDB. That way we get maximum flexibility without over-complicating the main schema?

Not familiar with PostgreSQL perhaps it has a better way of handling this variable data internally than other RDBMS.

hdinthkld avatar Aug 21 '16 18:08 hdinthkld

Custom fields have been implemented in the develop branch and will be released in v1.6.

jeremystretch avatar Sep 12 '16 15:09 jeremystretch

With the custom field option- is it possible to add a custom field to the "IP Address Import Page" ?

I was hoping to add a "host name" field, and simply import a bunch of addresses including the "host name".

fone avatar Sep 20 '16 12:09 fone

Bulk import is not currently supported for custom fields. We'd need to revamp the import logic and replace it with something other than headless CSV for that to work.

jeremystretch avatar Sep 20 '16 19:09 jeremystretch

you can have a look at https://github.com/digitalocean/netbox/issues/568 for a possible approach...

AnythingOverIP avatar Aug 09 '17 19:08 AnythingOverIP