Add "Maintenance" Status to Device #3414

Closed
opened 2025-12-29 18:28:52 +01:00 by adam · 7 comments
Owner

Originally created by @dstarner on GitHub (Feb 26, 2020).

Environment

  • Python version: 3.7
  • NetBox version: 2.7.6

Proposed Functionality

Add a new choice to DeviceStatus of Maintenance to denote when a machine is undergoing maintenance.

Use Case

Denoted a device as in Maintenance means it is an active machine that had to come offline momentarily for some maintenance...either upgrade, hardware fix, or whatever reason.

We currently hack this in to easily communicate what machines have hardware issues between teams and automation tools

Database Changes

Technically none, unless you count changing a ChoiceSet, in which case it's adding an enumeration to the Device.status

External Dependencies

N/A


Note that this is a very small addition that I could create a PR for once approved.

Originally created by @dstarner on GitHub (Feb 26, 2020). <!-- NOTE: IF YOUR ISSUE DOES NOT FOLLOW THIS TEMPLATE, IT WILL BE CLOSED. This form is only for proposing specific new features or enhancements. If you have a general idea or question, please post to our mailing list instead of opening an issue: https://groups.google.com/forum/#!forum/netbox-discuss NOTE: Due to an excessive backlog of feature requests, we are not currently accepting any proposals which significantly extend NetBox's feature scope. Please describe the environment in which you are running NetBox. Be sure that you are running an unmodified instance of the latest stable release before submitting a bug report. --> ### Environment * Python version: 3.7 * NetBox version: 2.7.6 <!-- Describe in detail the new functionality you are proposing. Include any specific changes to work flows, data models, or the user interface. --> ### Proposed Functionality Add a new choice to `DeviceStatus` of `Maintenance` to denote when a machine is undergoing maintenance. <!-- Convey an example use case for your proposed feature. Write from the perspective of a NetBox user who would benefit from the proposed functionality and describe how. ---> ### Use Case Denoted a device as in `Maintenance` means it is an active machine that had to come offline momentarily for some maintenance...either upgrade, hardware fix, or whatever reason. We currently hack this in to easily communicate what machines have hardware issues between teams and automation tools <!-- Note any changes to the database schema necessary to support the new feature. For example, does the proposal require adding a new model or field? (Not all new features require database changes.) ---> ### Database Changes Technically none, unless you count changing a `ChoiceSet`, in which case it's adding an enumeration to the `Device.status` <!-- List any new dependencies on external libraries or services that this new feature would introduce. For example, does the proposal require the installation of a new Python package? (Not all new features introduce new dependencies.) --> ### External Dependencies N/A --- Note that this is a very small addition that I could create a PR for once approved.
adam closed this issue 2025-12-29 18:28:52 +01:00
Author
Owner

@bcavns01 commented on GitHub (Feb 26, 2020):

Would love to see this turned into a larger PR that provides some kind of maintenance tracking. We're currently looking to migrate to netbox while at the same time looking for some solid maintenance tracking solution with hooks to let us perform additional external tasks once a maintenance has been scheduled and once the maintenance window has begun.

@bcavns01 commented on GitHub (Feb 26, 2020): Would love to see this turned into a larger PR that provides some kind of maintenance tracking. We're currently looking to migrate to netbox while at the same time looking for some solid maintenance tracking solution with hooks to let us perform additional external tasks once a maintenance has been scheduled and once the maintenance window has begun.
Author
Owner

@tyler-8 commented on GitHub (Feb 26, 2020):

@bcavns01 The best way to show your support for an issue is to click the "add reaction" button (plus sign with a smiley face) at the top right of the original post and add a thumbs up.

@tyler-8 commented on GitHub (Feb 26, 2020): @bcavns01 The best way to show your support for an issue is to click the "add reaction" button (plus sign with a smiley face) at the top right of the original post and add a thumbs up.
Author
Owner

@bcavns01 commented on GitHub (Feb 26, 2020):

@tyler-8 Sure, will do.
I was trying to give context and not just +1 it since the issue proposes a similar but reduced version of what we're looking for.

Didn't want to distract things by opening a separate issue for what seemed like just an expansion on an existing issue.

@bcavns01 commented on GitHub (Feb 26, 2020): @tyler-8 Sure, will do. I was trying to give context and not just +1 it since the issue proposes a similar but reduced version of what we're looking for. Didn't want to distract things by opening a separate issue for what seemed like just an expansion on an existing issue.
Author
Owner

@jeremystretch commented on GitHub (Feb 26, 2020):

Would love to see this turned into a larger PR that provides some kind of maintenance tracking.

This is a request to add an additional status value, nothing more. Anything beyond that would need a separate FR, but I should tell you now that we're not currently accepting any requests for major new features.

@jeremystretch commented on GitHub (Feb 26, 2020): > Would love to see this turned into a larger PR that provides some kind of maintenance tracking. This is a request to add an additional status value, nothing more. Anything beyond that would need a separate FR, but I should tell you now that we're not currently accepting any requests for major new features.
Author
Owner

@sdktr commented on GitHub (Feb 27, 2020):

While tempted to up-vote this, I think it opens a whole set of additional 'small' FR's that will end up with a 'so-and-so' maintenance framework that should have been setup as a better designed solution.
E.g.: maintenance state on sites and circuits. But also discussions around whether this is supposed to be for preventive maintenance or 'known to be broken' as well. Until there is a wider thought through solution I would prefer tagging resources with your own labels for the moment.

@sdktr commented on GitHub (Feb 27, 2020): While tempted to up-vote this, I think it opens a whole set of additional 'small' FR's that will end up with a 'so-and-so' maintenance framework that should have been setup as a better designed solution. E.g.: maintenance state on sites and circuits. But also discussions around whether this is supposed to be for preventive maintenance or 'known to be broken' as well. Until there is a wider thought through solution I would prefer tagging resources with your own labels for the moment.
Author
Owner

@kobayashi commented on GitHub (Feb 28, 2020):

Maintenance is like sub state of offline or failed? the state might lead different usage by different people inside the same organization or department.

@kobayashi commented on GitHub (Feb 28, 2020): Maintenance is like sub state of offline or failed? the state might lead different usage by different people inside the same organization or department.
Author
Owner

@jeremystretch commented on GitHub (Feb 28, 2020):

IMO "under maintenance" is a short-lived status; typically measured in hours. I don't think it makes sense to use the status field to indicate this temporary condition, because you lose the original status when it's changed.

An example: There are 20 servers in a rack. 17 are active, two are staged, and one is failed. You select all, click edit, and set the status to "maintenance." After the maintenance window has been completed, you select the devices again and set the status to... what? You'll have to dig through the change log or some other notes to determine what the original status of each device was.

This is why I think @sdktr's suggestion to employ tags for this purpose is more practical. Apply the tag at the start of the maintenance, remove it at the end, and everything is right back to its original state with minimal fuss.

@jeremystretch commented on GitHub (Feb 28, 2020): IMO "under maintenance" is a short-lived status; typically measured in hours. I don't think it makes sense to use the `status` field to indicate this temporary condition, because you lose the original status when it's changed. An example: There are 20 servers in a rack. 17 are active, two are staged, and one is failed. You select all, click edit, and set the status to "maintenance." After the maintenance window has been completed, you select the devices again and set the status to... what? You'll have to dig through the change log or some other notes to determine what the original status of each device was. This is why I think @sdktr's suggestion to employ tags for this purpose is more practical. Apply the tag at the start of the maintenance, remove it at the end, and everything is right back to its original state with minimal fuss.
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: starred/netbox#3414