Journal / Log for Devices (or maybe other Models as well) #114

Closed
opened 2025-12-29 15:33:31 +01:00 by adam · 18 comments
Owner

Originally created by @peelman on GitHub (Jun 30, 2016).

Originally assigned to: @jeremystretch on GitHub.

#122 made me think of a situation I ran into when working on an Asset Management system that never got the green light to go open source at a previous gig.

It was requested (and eventually halfway implemented) that I add a Log/Journal/Comments section to each [Item]. This allowed for Human-stamped and Time-Stamped entries to denote maintenance, firmware/software updates, part replacements, or other changes, without having to edit a notes field continuously with something like:

6/30/2016 NP Updated Firmware to version R15.3

The intention was to ease use, enforce consistency (at least in where to make the comment), and safeguard any existing note data that might get wiped out by a select-all-start-typing-without-noticing mishap. The roadmap was to enable those log/journal/comment entires to be created by users of varying roles, whereas somebody might not have permissions to edit the object itself, but could add a note saying what they did to it.

Originally created by @peelman on GitHub (Jun 30, 2016). Originally assigned to: @jeremystretch on GitHub. #122 made me think of a situation I ran into when working on an Asset Management system that never got the green light to go open source at a previous gig. It was requested (and eventually halfway implemented) that I add a Log/Journal/Comments section to each [Item]. This allowed for Human-stamped and Time-Stamped entries to denote maintenance, firmware/software updates, part replacements, or other changes, without having to edit a notes field continuously with something like: > 6/30/2016 NP Updated Firmware to version R15.3 The intention was to ease use, enforce consistency (at least in where to make the comment), and safeguard any existing note data that might get wiped out by a select-all-start-typing-without-noticing mishap. The roadmap was to enable those log/journal/comment entires to be created by users of varying roles, whereas somebody might not have permissions to edit the object itself, but could add a note saying what they did to it.
adam added the status: acceptedtype: feature labels 2025-12-29 15:33:31 +01:00
adam closed this issue 2025-12-29 15:33:31 +01:00
Author
Owner

@ryanmerolle commented on GitHub (Jun 30, 2016):

That would be interesting! Depending on your workflow, it would be very useful escpcially via the API. Given the change workflows I have seen, I could see the following use case dealing with changes pushed or scheduled:

  • change management tool posting links to changes for more info.
  • automation workflow posting a Config description / commit message with timestamp to a netbox device record once a change is complete
  • Ops teams creating scripts or manually updating said journal to link to outside tickets like TAC that may not be linked to an internal change ticket yet or ever.
@ryanmerolle commented on GitHub (Jun 30, 2016): That would be interesting! Depending on your workflow, it would be very useful escpcially via the API. Given the change workflows I have seen, I could see the following use case dealing with changes pushed or scheduled: - change management tool posting links to changes for more info. - automation workflow posting a Config description / commit message with timestamp to a netbox device record once a change is complete - Ops teams creating scripts or manually updating said journal to link to outside tickets like TAC that may not be linked to an internal change ticket yet or ever.
Author
Owner

@eronlloyd commented on GitHub (Sep 18, 2016):

We are using another IPAM for the space serving our subscribers, and it does a great job actually logging the history of IP assignments, which I can see being helpful to troubleshoot if/when the network gets changed around. I would definitely support this, and would like to even get involved with contributing to netbox.

@eronlloyd commented on GitHub (Sep 18, 2016): We are using another IPAM for the space serving our subscribers, and it does a great job actually logging the history of IP assignments, which I can see being helpful to troubleshoot if/when the network gets changed around. I would definitely support this, and would like to even get involved with contributing to netbox.
Author
Owner

@puck commented on GitHub (Aug 3, 2017):

Hmmm, something to consider is a journal brings Netbox closer to Asset Management. My plan is to use the Asset module in Request Tracker for the asset side of things, and have Netbox link to RT.

@puck commented on GitHub (Aug 3, 2017): Hmmm, something to consider is a journal brings Netbox closer to Asset Management. My plan is to use the Asset module in Request Tracker for the asset side of things, and have Netbox link to RT.
Author
Owner

@a31amit commented on GitHub (Aug 8, 2018):

+1 This feature would be extremely useful track changes on assets some one made.

@a31amit commented on GitHub (Aug 8, 2018): +1 This feature would be extremely useful track changes on assets some one made.
Author
Owner

@mikili commented on GitHub (Aug 14, 2018):

will this feature be added in the next update of netbox tools? our company is very interested in using netbox and this feature is very important for us.
thanks in advance

@mikili commented on GitHub (Aug 14, 2018): will this feature be added in the next update of netbox tools? our company is very interested in using netbox and this feature is very important for us. thanks in advance
Author
Owner

@bdlamprecht commented on GitHub (Nov 5, 2018):

Perhaps FR #2511 would solve this type of request without getting too far into the asset management realm.

@bdlamprecht commented on GitHub (Nov 5, 2018): Perhaps FR #2511 would solve this type of request without getting too far into the asset management realm.
Author
Owner

@a31amit commented on GitHub (Dec 5, 2018):

#2511 would be only useful when someone wanted to do an audit of existing objects but not helpful for the direct users of Web UI whose just wanted to learn information associated with particular objects.

this would really help when someone wanted to track ChangeRequestsID or add services history for sites/Racks/Devices.
I believe something like free fall multiple comments similar to many social media or Atlassian confluence documents allow would be useful here.

I believe django.contrib.comments module can be used here.

@jeremystretch Can you please review it and add some timeline for it? It would be really useful when someone can add multiple comments or text log to objects.

@a31amit commented on GitHub (Dec 5, 2018): #2511 would be only useful when someone wanted to do an audit of existing objects but not helpful for the direct users of Web UI whose just wanted to learn information associated with particular objects. this would really help when someone wanted to track ChangeRequestsID or add services history for sites/Racks/Devices. I believe something like free fall multiple comments similar to many social media or Atlassian confluence documents allow would be useful here. I believe django.contrib.comments module can be used here. @jeremystretch Can you please review it and add some timeline for it? It would be really useful when someone can add multiple comments or text log to objects.
Author
Owner

@jeremystretch commented on GitHub (Dec 6, 2018):

@a31amit I review all issues, but I don't provide timelines for any features.

@jeremystretch commented on GitHub (Dec 6, 2018): @a31amit I review all issues, but I don't provide timelines for any features.
Author
Owner

@apollo13 commented on GitHub (Jan 7, 2019):

@jeremystretch We'd like to see something like this in netbox too and might be able to offer the code for it. Could you outline if this is:

  • Something you'd accept at all
  • A rough overview of what you'd expect
@apollo13 commented on GitHub (Jan 7, 2019): @jeremystretch We'd like to see something like this in netbox too and might be able to offer the code for it. Could you outline if this is: * Something you'd accept at all * A rough overview of what you'd expect
Author
Owner

@brammeleman commented on GitHub (Sep 13, 2019):

Mmm it doesn't look like haminhcong's service-user-panel implements the request discussed here.

@brammeleman commented on GitHub (Sep 13, 2019): Mmm it doesn't look like haminhcong's service-user-panel implements the request discussed here.
Author
Owner

@DanSheps commented on GitHub (Sep 14, 2019):

No, it looks like they are modifying netbox for openstack.

@DanSheps commented on GitHub (Sep 14, 2019): No, it looks like they are modifying netbox for openstack.
Author
Owner

@rainerduffner commented on GitHub (Feb 6, 2020):

I know that Netbox is primarily an IPAM - but it would be so nice to replace our in-house inventory-management app with this. Except Netbox is missing this one feature that is absolutely critical.

I would be curious to know how others tackle this?

@rainerduffner commented on GitHub (Feb 6, 2020): I know that Netbox is primarily an IPAM - but it would be so nice to replace our in-house inventory-management app with this. Except Netbox is missing this one feature that is absolutely critical. I would be curious to know how others tackle this?
Author
Owner

@raddessi commented on GitHub (Aug 28, 2020):

@rainerduffner we have a <!-- start managed --><!-- end managed --> block in the Comments field for each of our devices. This block is maintained by an external script that updates links to support issues/monitoring links/other items where that device was mentioned for each device that we have, and the area outside that block can be edited by users still like the Comments field was initially meant for.

Having a dedicated section that would have some sort of distinct entry system would be fantastic for us, we would move the contents of the managed section out to a entry that we could in theory keep updated and users would not have to work around our big blob of text when they try to enter notes.

There are some cases we have created custom fields for that this may help with.. for example we have a previous_device_fqdns custom field. It would be a great help if the notes would be parseable or filterable in some way.. but it would probably be easier than trying to parse all of the Comments area which we abandoned in favor of using a custom field for that item.

EDIT: Of course with the new plugins system we could easily split this out on our own, which we may just do in the future.

@raddessi commented on GitHub (Aug 28, 2020): @rainerduffner we have a `<!-- start managed --><!-- end managed -->` block in the Comments field for each of our devices. This block is maintained by an external script that updates links to support issues/monitoring links/other items where that device was mentioned for each device that we have, and the area outside that block can be edited by users still like the Comments field was initially meant for. Having a dedicated section that would have some sort of distinct entry system would be fantastic for us, we would move the contents of the managed section out to a entry that we could in theory keep updated and users would not have to work around our big blob of text when they try to enter notes. There are some cases we have created custom fields for that this may help with.. for example we have a previous_device_fqdns custom field. It would be a great help if the notes would be parseable or filterable in some way.. but it would probably be easier than trying to parse all of the Comments area which we abandoned in favor of using a custom field for that item. EDIT: Of course with the new plugins system we could easily split this out on our own, which we may just do in the future.
Author
Owner

@jeremystretch commented on GitHub (Dec 21, 2020):

This is one of our oldest open issues. While I agree that it would be very well-suited as a plugin, it's also a very common use case and worthy of inclusion in core. I'm envisioning a single new model, named JournalEntry. (I'm using the term "journal" here to imply a record created by a human, as opposed to "log" which in our industry tends to imply machine generation.)

class JournalEntry(models.Model):
    content_type = models.ForeignKey(
        to=ContentType,
        on_delete=models.CASCADE
    )
    object_id = models.PositiveIntegerField()
    parent = GenericForeignKey(
        ct_field='content_type',
        fk_field='object_id'
    )
    created = models.DateTimeField(
        auto_now_add=True,
        editable=False
    )
    created_by = models.ForeignKey(
        to=User,
        on_delete=models.SET_NULL,
        related_name='changes',
        blank=True,
        null=True
    )
    content = models.TextField()

We could embed a form directly on each object's primary view to allow the addition of new entries without modifying the object itself. The creation time and associated user would be set automatically. Content would support markdown rendering just as comments do today. A new REST API under /api/extras/ would be added as well.

I want to point out that this introduces two distinct streams of history: We have changes to the NetBox object, recorded in the change log, and now we'll have a journal for separate "real world" changes. The journal might include an entry like "Reassigning IPs using space from provider X", whereas the changelog would show the actual changes being made in NetBox. I think this is tremendously convenient, so long as its clear to users the function of each feature.

@jeremystretch commented on GitHub (Dec 21, 2020): This is one of our oldest open issues. While I agree that it would be very well-suited as a plugin, it's also a very common use case and worthy of inclusion in core. I'm envisioning a single new model, named `JournalEntry`. (I'm using the term "journal" here to imply a record created by a human, as opposed to "log" which in our industry tends to imply machine generation.) ``` class JournalEntry(models.Model): content_type = models.ForeignKey( to=ContentType, on_delete=models.CASCADE ) object_id = models.PositiveIntegerField() parent = GenericForeignKey( ct_field='content_type', fk_field='object_id' ) created = models.DateTimeField( auto_now_add=True, editable=False ) created_by = models.ForeignKey( to=User, on_delete=models.SET_NULL, related_name='changes', blank=True, null=True ) content = models.TextField() ``` We could embed a form directly on each object's primary view to allow the addition of new entries without modifying the object itself. The creation time and associated user would be set automatically. Content would support markdown rendering just as comments do today. A new REST API under `/api/extras/` would be added as well. I want to point out that this introduces two distinct streams of history: We have changes to the NetBox object, recorded in the change log, and now we'll have a journal for separate "real world" changes. The journal might include an entry like "Reassigning IPs using space from provider X", whereas the changelog would show the actual changes being made in NetBox. I think this is tremendously convenient, so long as its clear to users the function of each feature.
Author
Owner

@ktims commented on GitHub (Dec 21, 2020):

@jeremystretch I really like the sound of this model. It would be especially useful if the Journal Entry could (optionally) link to the ChangeLog, perhaps providing a 'reason' field or similar in the edit dialog?

@ktims commented on GitHub (Dec 21, 2020): @jeremystretch I really like the sound of this model. It would be especially useful if the Journal Entry could (optionally) link to the ChangeLog, perhaps providing a 'reason' field or similar in the edit dialog?
Author
Owner

@xkilian commented on GitHub (Dec 22, 2020):

If desired, I would see what ktims suggests as more of a UI function. When displaying journal entries, there could be a method(some type of quick toggle) to display "change log" entries related to the current journal filter. And not polluting the journal with links back to the change log.

@xkilian commented on GitHub (Dec 22, 2020): If desired, I would see what ktims suggests as more of a UI function. When displaying journal entries, there could be a method(some type of quick toggle) to display "change log" entries related to the current journal filter. And not polluting the journal with links back to the change log.
Author
Owner

@a31amit commented on GitHub (Jan 7, 2021):

Can this also be include or be a part of bulk changes as well. so that more than 1 device can be updated with the journal log entry.

@a31amit commented on GitHub (Jan 7, 2021): Can this also be include or be a part of bulk changes as well. so that more than 1 device can be updated with the journal log entry.
Author
Owner

@darcynz commented on GitHub (Mar 15, 2021):

This could be super handy for Rack management as well. Eg a use case for us is recording an entry in the journal when ever permission has been given to a user to access the rack.

@darcynz commented on GitHub (Mar 15, 2021): This could be super handy for Rack management as well. Eg a use case for us is recording an entry in the journal when ever permission has been given to a user to access the rack.
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: starred/netbox#114