Add maintenance as device status #2662

Closed
opened 2025-12-29 18:21:00 +01:00 by adam · 2 comments
Owner

Originally created by @soer7022 on GitHub (Jun 11, 2019).

Environment

  • Python version: 3.7.3
  • NetBox version: 2.5.10

Proposed Functionality

We want to add a "Maintenance" status to the device status list. At the moment we are using tags to manage the status, which isn't ideal.

Use Case

When a technician is doing maintenance on a device, the device will be going online and offline multiple times. This will make a monitoring tool think that the device is down or has problems. If we add a maintenance status to netbox the device can be ignored by the monitoring tool, since the monitoring tool can see the status of the device.

Database Changes

Line 318-336 in /netbox/netbox/dcim/constants.py will be extended to:

# Device statuses
DEVICE_STATUS_OFFLINE = 0
DEVICE_STATUS_ACTIVE = 1
DEVICE_STATUS_PLANNED = 2
DEVICE_STATUS_STAGED = 3
DEVICE_STATUS_FAILED = 4
DEVICE_STATUS_INVENTORY = 5
DEVICE_STATUS_DECOMMISSIONING = 6
DEVICE_STATUS_MAINTENANCE = 7
DEVICE_STATUS_CHOICES = [
    [DEVICE_STATUS_ACTIVE, 'Active'],
    [DEVICE_STATUS_OFFLINE, 'Offline'],
    [DEVICE_STATUS_PLANNED, 'Planned'],
    [DEVICE_STATUS_STAGED, 'Staged'],
    [DEVICE_STATUS_FAILED, 'Failed'],
    [DEVICE_STATUS_INVENTORY, 'Inventory'],
    [DEVICE_STATUS_DECOMMISSIONING, 'Decommissioning'],
    [DEVICE_STATUS_MAINTENANCE, 'Maintenance']
]

External Dependencies

No external dependencies added.

Originally created by @soer7022 on GitHub (Jun 11, 2019). <!-- NOTE: 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.3 * NetBox version: 2.5.10 <!-- Describe in detail the new functionality you are proposing. Include any specific changes to work flows, data models, or the user interface. --> ### Proposed Functionality We want to add a "Maintenance" status to the device status list. At the moment we are using tags to manage the status, which isn't ideal. <!-- 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 When a technician is doing maintenance on a device, the device will be going online and offline multiple times. This will make a monitoring tool think that the device is down or has problems. If we add a maintenance status to netbox the device can be ignored by the monitoring tool, since the monitoring tool can see the status of the device. <!-- 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 Line 318-336 in `/netbox/netbox/dcim/constants.py` will be extended to: ``` # Device statuses DEVICE_STATUS_OFFLINE = 0 DEVICE_STATUS_ACTIVE = 1 DEVICE_STATUS_PLANNED = 2 DEVICE_STATUS_STAGED = 3 DEVICE_STATUS_FAILED = 4 DEVICE_STATUS_INVENTORY = 5 DEVICE_STATUS_DECOMMISSIONING = 6 DEVICE_STATUS_MAINTENANCE = 7 DEVICE_STATUS_CHOICES = [ [DEVICE_STATUS_ACTIVE, 'Active'], [DEVICE_STATUS_OFFLINE, 'Offline'], [DEVICE_STATUS_PLANNED, 'Planned'], [DEVICE_STATUS_STAGED, 'Staged'], [DEVICE_STATUS_FAILED, 'Failed'], [DEVICE_STATUS_INVENTORY, 'Inventory'], [DEVICE_STATUS_DECOMMISSIONING, 'Decommissioning'], [DEVICE_STATUS_MAINTENANCE, 'Maintenance'] ] ``` <!-- 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 No external dependencies added.
adam added the type: feature label 2025-12-29 18:21:00 +01:00
adam closed this issue 2025-12-29 18:21:00 +01:00
Author
Owner

@DanSheps commented on GitHub (Jun 11, 2019):

Netbox is meant to be a steady state of the current system.

Maintenance is a transient state and shouldn't be documented.

@DanSheps commented on GitHub (Jun 11, 2019): Netbox is meant to be a steady state of the current system. Maintenance is a transient state and shouldn't be documented.
Author
Owner

@lampwins commented on GitHub (Jun 11, 2019):

When a technician is doing maintenance on a device, the device will be going online and offline multiple times.

To clarify, the device would be offline in a maintenance window by this description.

I have also accomplished this in the past with a monitoring custom field.

@lampwins commented on GitHub (Jun 11, 2019): > When a technician is doing maintenance on a device, the device will be going online and offline multiple times. To clarify, the device would be `offline` in a maintenance window by this description. I have also accomplished this in the past with a `monitoring` custom field.
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: starred/netbox#2662