netbox-maintenance-device 1.2.1__tar.gz

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (42) hide show
  1. netbox_maintenance_device-1.2.1/CHANGELOG.md +64 -0
  2. netbox_maintenance_device-1.2.1/LICENSE +198 -0
  3. netbox_maintenance_device-1.2.1/MANIFEST.in +13 -0
  4. netbox_maintenance_device-1.2.1/PKG-INFO +309 -0
  5. netbox_maintenance_device-1.2.1/README.md +272 -0
  6. netbox_maintenance_device-1.2.1/netbox_maintenance_device/__init__.py +40 -0
  7. netbox_maintenance_device-1.2.1/netbox_maintenance_device/admin.py +16 -0
  8. netbox_maintenance_device-1.2.1/netbox_maintenance_device/api/__init__.py +1 -0
  9. netbox_maintenance_device-1.2.1/netbox_maintenance_device/api/permissions.py +65 -0
  10. netbox_maintenance_device-1.2.1/netbox_maintenance_device/api/serializers.py +217 -0
  11. netbox_maintenance_device-1.2.1/netbox_maintenance_device/api/urls.py +60 -0
  12. netbox_maintenance_device-1.2.1/netbox_maintenance_device/api/views.py +461 -0
  13. netbox_maintenance_device-1.2.1/netbox_maintenance_device/database_healer.py +126 -0
  14. netbox_maintenance_device-1.2.1/netbox_maintenance_device/forms.py +68 -0
  15. netbox_maintenance_device-1.2.1/netbox_maintenance_device/locale/pt_BR/LC_MESSAGES/django.mo +0 -0
  16. netbox_maintenance_device-1.2.1/netbox_maintenance_device/locale/pt_BR/LC_MESSAGES/django.po +251 -0
  17. netbox_maintenance_device-1.2.1/netbox_maintenance_device/migrations/0001_initial.py +56 -0
  18. netbox_maintenance_device-1.2.1/netbox_maintenance_device/migrations/0002_cleanup_notifications.py +137 -0
  19. netbox_maintenance_device-1.2.1/netbox_maintenance_device/migrations/__init__.py +1 -0
  20. netbox_maintenance_device-1.2.1/netbox_maintenance_device/models.py +126 -0
  21. netbox_maintenance_device-1.2.1/netbox_maintenance_device/navigation.py +43 -0
  22. netbox_maintenance_device-1.2.1/netbox_maintenance_device/static/netbox_maintenance_device/css/maintenance.css +318 -0
  23. netbox_maintenance_device-1.2.1/netbox_maintenance_device/tables.py +132 -0
  24. netbox_maintenance_device-1.2.1/netbox_maintenance_device/template_content.py +50 -0
  25. netbox_maintenance_device-1.2.1/netbox_maintenance_device/templates/netbox_maintenance_device/device_maintenance_buttons.html +24 -0
  26. netbox_maintenance_device-1.2.1/netbox_maintenance_device/templates/netbox_maintenance_device/device_maintenance_section.html +266 -0
  27. netbox_maintenance_device-1.2.1/netbox_maintenance_device/templates/netbox_maintenance_device/device_maintenance_tab.html +290 -0
  28. netbox_maintenance_device-1.2.1/netbox_maintenance_device/templates/netbox_maintenance_device/maintenanceexecution.html +57 -0
  29. netbox_maintenance_device-1.2.1/netbox_maintenance_device/templates/netbox_maintenance_device/maintenanceplan.html +94 -0
  30. netbox_maintenance_device-1.2.1/netbox_maintenance_device/templates/netbox_maintenance_device/upcoming_maintenance.html +218 -0
  31. netbox_maintenance_device-1.2.1/netbox_maintenance_device/templatetags/__init__.py +1 -0
  32. netbox_maintenance_device-1.2.1/netbox_maintenance_device/templatetags/maintenance_extras.py +27 -0
  33. netbox_maintenance_device-1.2.1/netbox_maintenance_device/urls.py +32 -0
  34. netbox_maintenance_device-1.2.1/netbox_maintenance_device/views.py +219 -0
  35. netbox_maintenance_device-1.2.1/netbox_maintenance_device.egg-info/PKG-INFO +309 -0
  36. netbox_maintenance_device-1.2.1/netbox_maintenance_device.egg-info/SOURCES.txt +40 -0
  37. netbox_maintenance_device-1.2.1/netbox_maintenance_device.egg-info/dependency_links.txt +1 -0
  38. netbox_maintenance_device-1.2.1/netbox_maintenance_device.egg-info/requires.txt +7 -0
  39. netbox_maintenance_device-1.2.1/netbox_maintenance_device.egg-info/top_level.txt +3 -0
  40. netbox_maintenance_device-1.2.1/pyproject.toml +109 -0
  41. netbox_maintenance_device-1.2.1/setup.cfg +4 -0
  42. netbox_maintenance_device-1.2.1/setup.py +5 -0
@@ -0,0 +1,64 @@
1
+ # Changelog
2
+
3
+ All notable changes to this project will be documented in this file.
4
+
5
+ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),
6
+ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).
7
+
8
+ ## [1.2.1] - 2025-09-29
9
+
10
+ ### Added
11
+ - **Complete REST API**: Full CRUD API implementation for external integrations
12
+ - 17 API endpoints for maintenance plans and executions
13
+ - Advanced filtering, pagination, and ordering
14
+ - Custom actions: schedule, complete, cancel maintenance
15
+ - Statistics and reporting endpoints
16
+ - Comprehensive permission system
17
+ - Token and session authentication support
18
+ - **NetBox 4.4.x Compatibility**: Full compatibility with NetBox 4.4.1
19
+ - **Enhanced Database Healing**: Plugin automatically detects and resolves orphaned table issues
20
+ - **Production Deployment Ready**: Cleaned project structure for production use
21
+ - **GitHub Actions Integration**: Automated testing and PyPI publishing workflows
22
+
23
+ ### Fixed
24
+ - **[CRÍTICO] NetBox 4.4.x Compatibility**: Resolved all compatibility issues with NetBox 4.4.1
25
+ - Fixed `ModuleNotFoundError: No module named 'utilities.utils'`
26
+ - Fixed `ImportError: cannot import name 'NestedDeviceSerializer'`
27
+ - Updated permission system to use `rest_framework.permissions.BasePermission`
28
+ - Created custom `DeviceNestedSerializer` for NetBox 4.4.x compatibility
29
+ - **[CRÍTICO] IntegrityError Resolution**: Automatically resolves foreign key constraint violations
30
+ - **[CRÍTICO] Internationalization**: Fixed menu labels appearing in Portuguese when NetBox is set to English
31
+ - **Docker Deployment**: Plugin now starts correctly in NetBox 4.4.1 containers
32
+
33
+ ### Changed
34
+ - **Permission System**: Completely rewritten for NetBox 4.4.x compatibility
35
+ - **API Serializers**: Updated to use NetBox 4.4.x compatible imports
36
+ - **Project Structure**: Cleaned for production deployment (removed unnecessary documentation files)
37
+ - **Package Naming**: Standardized to `netbox-maintenance-device` for PyPI
38
+ - **License Format**: Updated to standard `Apache-2.0` format
39
+
40
+ ## [1.2.0] - 2025-09-16
41
+
42
+ ### Added
43
+ - Enhanced visual indicators for maintenance status
44
+ - Portuguese-BR localization support
45
+ - Improved navigation and menu structure
46
+ - Device maintenance integration tabs
47
+
48
+ ### Fixed
49
+ - Various UI improvements
50
+ - Better error handling in views
51
+
52
+ ## [1.1.0] - 2025-09-15
53
+
54
+ ### Added
55
+ - Initial release with basic maintenance planning
56
+ - Device maintenance plan management
57
+ - Maintenance execution tracking
58
+ - Basic reporting and dashboard
59
+
60
+ ### Features
61
+ - Create maintenance plans for devices
62
+ - Track maintenance executions
63
+ - Monitor upcoming and overdue maintenance
64
+ - Device integration with maintenance history
@@ -0,0 +1,198 @@
1
+ Apache License
2
+ Version 2.0, January 2004
3
+ http://www.apache.org/licenses/
4
+
5
+ TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION
6
+
7
+ 1. Definitions.
8
+
9
+ "License" shall mean the terms and conditions for use, reproduction,
10
+ and distribution as defined by Sections 1 through 9 of this document.
11
+
12
+ "Licensor" shall mean the copyright owner or entity granting the License.
13
+
14
+ "Legal Entity" shall mean the union of the acting entity and all
15
+ other entities that control, are controlled by, or are under common
16
+ control with that entity. For the purposes of this definition,
17
+ "control" means (i) the power, direct or indirect, to cause the
18
+ direction or management of such entity, whether by contract or
19
+ otherwise, or (ii) ownership of fifty percent (50%) or more of the
20
+ outstanding shares, or (iii) beneficial ownership of such entity.
21
+
22
+ "You" (or "Your") shall mean an individual or Legal Entity
23
+ exercising permissions granted by this License.
24
+
25
+ "Source" shall mean the preferred form for making modifications,
26
+ including but not limited to software source code, documentation
27
+ source, and configuration files.
28
+
29
+ "Object" shall mean any form resulting from mechanical
30
+ transformation or translation of a Source form, including but
31
+ not limited to compiled object code, generated documentation,
32
+ and conversions to other media types.
33
+
34
+ "Work" shall mean the work of authorship covered by this License,
35
+ whether in Source or Object form, made available under the License,
36
+ as indicated by a copyright notice that is included in or attached
37
+ to the work. (Preferably at the beginning of this file.)
38
+
39
+ "Derivative Works" shall mean any work, whether in Source or Object
40
+ form, that is based upon (or derived from) the Work and for which the
41
+ editorial revisions, annotations, elaborations, or other modifications
42
+ represent, as a whole, an original work of authorship. For the purposes
43
+ of this License, Derivative Works shall not include works that remain
44
+ separable from, or merely link (or bind by name) to the interfaces of,
45
+ the Work and derivative works thereof.
46
+
47
+ "Contribution" shall mean any work of authorship, including
48
+ the original version of the Work and any modifications or additions
49
+ to that Work or Derivative Works thereof, that is intentionally
50
+ submitted to Licensor for inclusion in the Work by the copyright owner
51
+ or by an individual or Legal Entity authorized to submit on behalf of
52
+ the copyright owner. For the purposes of this definition, "submitted"
53
+ means any form of electronic, verbal, or written communication sent
54
+ to the Licensor or its representatives, including but not limited to
55
+ communication on electronic mailing lists, source code control
56
+ systems, and issue tracking systems that are managed by, or on behalf
57
+ of, the Licensor for the purpose of discussing and improving the Work,
58
+ but excluding communication that is conspicuously marked or otherwise
59
+ designated in writing by the copyright owner as "Not a Contribution."
60
+
61
+ "Contributor" shall mean Licensor and any individual or Legal Entity
62
+ on behalf of whom a Contribution has been received by Licensor and
63
+ subsequently incorporated within the Work.
64
+
65
+ 2. Grant of Copyright License. Subject to the terms and conditions of
66
+ this License, each Contributor hereby grants to You a perpetual,
67
+ worldwide, non-exclusive, no-charge, royalty-free, irrevocable
68
+ copyright license to use, reproduce, modify, distribute, and prepare
69
+ Derivative Works of, publicly display, publicly perform, sublicense,
70
+ and distribute the Work and such Derivative Works in Source or Object
71
+ form.
72
+
73
+ 3. Grant of Patent License. Subject to the terms and conditions of
74
+ this License, each Contributor hereby grants to You a perpetual,
75
+ worldwide, non-exclusive, no-charge, royalty-free, irrevocable
76
+ (except as stated in this section) patent license to make, have made,
77
+ use, offer to sell, sell, import, and otherwise transfer the Work,
78
+ where such license applies only to those patent claims licensable
79
+ by such Contributor that are necessarily infringed by their
80
+ Contribution(s) alone or by combination of their Contribution(s)
81
+ with the Work to which such Contribution(s) was submitted. If You
82
+ institute patent litigation against any entity (including a
83
+ cross-claim or counterclaim in a lawsuit) alleging that the Work
84
+ or a Contribution incorporated within the Work constitutes direct
85
+ or contributory patent infringement, then any patent licenses
86
+ granted to You under this License for that Work shall terminate
87
+ as of the date such litigation is filed.
88
+
89
+ 4. Redistribution. You may reproduce and distribute copies of the
90
+ Work or Derivative Works thereof in any medium, with or without
91
+ modifications, and in Source or Object form, provided that You
92
+ meet the following conditions:
93
+
94
+ (a) You must give any other recipients of the Work or
95
+ Derivative Works a copy of this License; and
96
+
97
+ (b) You must cause any modified files to carry prominent notices
98
+ stating that You changed the files; and
99
+
100
+ (c) You must retain, in the Source form of any Derivative Works
101
+ that You distribute, all copyright, trademark, and
102
+ attribution notices from the Source form of the Work,
103
+ excluding those notices that do not pertain to any part of
104
+ the Derivative Works; and
105
+
106
+ (d) If the Work includes a "NOTICE" text file as part of its
107
+ distribution, then any Derivative Works that You distribute must
108
+ include a readable copy of the attribution notices contained
109
+ within such NOTICE file, excluding those notices that do not
110
+ pertain to any part of the Derivative Works, in at least one
111
+ of the following places: within a NOTICE text file distributed
112
+ as part of the Derivative Works; within the Source form or
113
+ documentation, if provided along with the Derivative Works; or,
114
+ within a display generated by the Derivative Works, if and
115
+ wherever such third-party notices normally appear. The contents
116
+ of the NOTICE file are for informational purposes only and
117
+ do not modify the License. You may add Your own attribution
118
+ notices within Derivative Works that You distribute, alongside
119
+ or as an addendum to the NOTICE text from the Work, provided
120
+ that such additional attribution notices cannot be construed
121
+ as modifying the License.
122
+
123
+ You may add Your own copyright notice to Your modifications and
124
+ may provide additional or different license terms and conditions
125
+ for use, reproduction, or distribution of Your modifications, or
126
+ for any such Derivative Works as a whole, provided Your use,
127
+ reproduction, and distribution of the Work otherwise complies with
128
+ the conditions stated in this License.
129
+
130
+ 5. Submission of Contributions. Unless You explicitly state otherwise,
131
+ any Contribution intentionally submitted for inclusion in the Work
132
+ by You to the Licensor shall be under the terms and conditions of
133
+ this License, without any additional terms or conditions.
134
+ Notwithstanding the above, nothing herein shall supersede or modify
135
+ the terms of any separate license agreement you may have executed
136
+ with Licensor regarding such Contributions.
137
+
138
+ 6. Trademarks. This License does not grant permission to use the trade
139
+ names, trademarks, service marks, or product names of the Licensor,
140
+ except as required for reasonable and customary use in describing the
141
+ origin of the Work and reproducing the content of the NOTICE file.
142
+
143
+ 7. Disclaimer of Warranty. Unless required by applicable law or
144
+ agreed to in writing, Licensor provides the Work (and each
145
+ Contributor provides its Contributions) on an "AS IS" BASIS,
146
+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
147
+ implied, including, without limitation, any warranties or conditions
148
+ of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A
149
+ PARTICULAR PURPOSE. You are solely responsible for determining the
150
+ appropriateness of using or redistributing the Work and assume any
151
+ risks associated with Your exercise of permissions under this License.
152
+
153
+ 8. Limitation of Liability. In no event and under no legal theory,
154
+ whether in tort (including negligence), contract, or otherwise,
155
+ unless required by applicable law (such as deliberate and grossly
156
+ negligent acts) or agreed to in writing, shall any Contributor be
157
+ liable to You for damages, including any direct, indirect, special,
158
+ incidental, or consequential damages of any character arising as a
159
+ result of this License or out of the use or inability to use the
160
+ Work (including but not limited to damages for loss of goodwill,
161
+ work stoppage, computer failure or malfunction, or any and all
162
+ other commercial damages or losses), even if such Contributor
163
+ has been advised of the possibility of such damages.
164
+
165
+ 9. Accepting Warranty or Support. You are not required to accept
166
+ warranty or support for the Work from any Contributor. However,
167
+ if You accept support, warranty, or indemnity obligations to or
168
+ for any recipient of the Work, You hereby agree to indemnify,
169
+ defend, and hold each Contributor harmless for any liability
170
+ incurred by, or claims asserted against, such Contributor by reason
171
+ of your accepting any such warranty or support.
172
+
173
+ END OF TERMS AND CONDITIONS
174
+
175
+ APPENDIX: How to apply the Apache License to your work.
176
+
177
+ To apply the Apache License to your work, attach the following
178
+ boilerplate notice, with the fields enclosed by brackets "[]"
179
+ replaced with your own identifying information. (Don't include
180
+ the brackets!) The text should be enclosed in the appropriate
181
+ comment syntax for the file format. We also recommend that a
182
+ file or class name and description of purpose be included on the
183
+ same page as the copyright notice for easier identification within
184
+ third-party archives.
185
+
186
+ Copyright 2025 Diego Godoy
187
+
188
+ Licensed under the Apache License, Version 2.0 (the "License");
189
+ you may not use this file except in compliance with the License.
190
+ You may obtain a copy of the License at
191
+
192
+ http://www.apache.org/licenses/LICENSE-2.0
193
+
194
+ Unless required by applicable law or agreed to in writing, software
195
+ distributed under the License is distributed on an "AS IS" BASIS,
196
+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
197
+ See the License for the specific language governing permissions and
198
+ limitations under the License.
@@ -0,0 +1,13 @@
1
+ include README.md
2
+ include CHANGELOG.md
3
+ include LICENSE
4
+ recursive-include netbox_maintenance_device/templates *
5
+ recursive-include netbox_maintenance_device/static *
6
+ recursive-include netbox_maintenance_device/locale *
7
+ recursive-include netbox_maintenance_device/migrations *
8
+ global-exclude *.pyc
9
+ global-exclude __pycache__
10
+ global-exclude *.py[co]
11
+ global-exclude *.DS_Store
12
+ global-exclude .pytest_cache
13
+ global-exclude tests
@@ -0,0 +1,309 @@
1
+ Metadata-Version: 2.4
2
+ Name: netbox-maintenance-device
3
+ Version: 1.2.1
4
+ Summary: NetBox plugin for device maintenance management with comprehensive REST API and Portuguese-BR support
5
+ Author-email: Diego Godoy <diegoalex-gdy@outlook.com>
6
+ Maintainer-email: Diego Godoy <diegoalex-gdy@outlook.com>
7
+ License: Apache-2.0
8
+ Project-URL: Homepage, https://github.com/diegogodoy06/netbox-maintenance-device
9
+ Project-URL: Bug Reports, https://github.com/diegogodoy06/netbox-maintenance-device/issues
10
+ Project-URL: Source, https://github.com/diegogodoy06/netbox-maintenance-device
11
+ Project-URL: Documentation, https://github.com/diegogodoy06/netbox-maintenance-device/blob/main/README.md
12
+ Project-URL: Changelog, https://github.com/diegogodoy06/netbox-maintenance-device/releases
13
+ Keywords: netbox,plugin,maintenance,device,preventive,corrective,api,rest,automation,infrastructure,django
14
+ Classifier: Development Status :: 5 - Production/Stable
15
+ Classifier: Intended Audience :: System Administrators
16
+ Classifier: Intended Audience :: Telecommunications Industry
17
+ Classifier: Operating System :: OS Independent
18
+ Classifier: Programming Language :: Python :: 3
19
+ Classifier: Programming Language :: Python :: 3.8
20
+ Classifier: Programming Language :: Python :: 3.9
21
+ Classifier: Programming Language :: Python :: 3.10
22
+ Classifier: Programming Language :: Python :: 3.11
23
+ Classifier: Programming Language :: Python :: 3.12
24
+ Classifier: Framework :: Django
25
+ Classifier: Topic :: System :: Networking
26
+ Classifier: Topic :: System :: Systems Administration
27
+ Requires-Python: >=3.8
28
+ Description-Content-Type: text/markdown
29
+ License-File: LICENSE
30
+ Provides-Extra: dev
31
+ Requires-Dist: black>=22.0.0; extra == "dev"
32
+ Requires-Dist: flake8>=4.0.0; extra == "dev"
33
+ Requires-Dist: pytest>=7.0.0; extra == "dev"
34
+ Requires-Dist: pytest-django>=4.5.0; extra == "dev"
35
+ Requires-Dist: pre-commit>=2.20.0; extra == "dev"
36
+ Dynamic: license-file
37
+
38
+ # NetBox Maintenance Device Plugin
39
+
40
+ [![Python](https://img.shields.io/badge/Python-3.8%2B-blue)](https://www.python.org/)
41
+ [![NetBox](https://img.shields.io/badge/NetBox-4.0%2B-orange)](https://netbox.dev/)
42
+ [![Language](https://img.shields.io/badge/Language-EN%20%7C%20PT--BR-brightgreen)](README.md)
43
+
44
+ A comprehensive NetBox plugin for managing device preventive and corrective maintenance with enhanced visual indicators, scheduling capabilities, and multi-language support.
45
+
46
+ ![Upcoming & Overdue Maintenance](https://github.com/diegogodoy06/netbox-maintenance-device/blob/main/docs/img/Upcoming.png?raw=true)
47
+
48
+ ## Features
49
+
50
+ - **Maintenance Plans**: Create and manage maintenance plans for devices with configurable frequency
51
+ - **Maintenance Executions**: Record and track maintenance executions with status monitoring
52
+ - **Device Integration**: View maintenance history directly on device pages with dedicated tabs
53
+ - **Quick Actions**: Schedule and complete maintenance directly from the interface
54
+ - **🆕 REST API**: Complete REST API for external integrations and automation
55
+ - **Advanced Filtering**: Powerful filtering and search capabilities
56
+ - **Custom Actions**: Schedule, complete, and cancel maintenance via API
57
+ - **Statistics**: Get maintenance statistics and overdue/upcoming reports
58
+
59
+
60
+ ## Compatibility
61
+
62
+ | NetBox Version | Plugin Support | Notes |
63
+ |----------------|----------------|-------|
64
+ | 4.4.x | ✅ **Tested & Supported** | Current target version |
65
+ | 4.3.x | ⚠️ **Likely Compatible** | Not officially tested |
66
+ | 4.2.x | ⚠️ **Likely Compatible** | Not officially tested |
67
+ | 4.1.x | ⚠️ **Likely Compatible** | Not officially tested |
68
+ | 4.0.x | ⚠️ **Likely Compatible** | Not officially tested |
69
+ | 3.x | ❌ **Not Supported** | Breaking changes |
70
+
71
+ > **Note**: This version (v1.2.1) is specifically tested and certified for NetBox 4.4.x. While it may work with other 4.x versions, we recommend testing in a development environment first.
72
+
73
+
74
+
75
+ ## Installation
76
+
77
+ ### Method 1: PyPI Installation
78
+ This plugin is not published on PyPI yet.
79
+ To install directly from GitHub, use:
80
+
81
+ ### Method 2: GitHub Installation
82
+
83
+ ```bash
84
+ pip install git+https://github.com/diegogodoy06/netbox-maintenance-device.git
85
+ ```
86
+ Note: You may see a warning about setup.py being deprecated.
87
+ The installation still works fine, and a pyproject.toml will be added soon to remove this warning.
88
+
89
+ ### Method 3: Docker Installation
90
+
91
+ For Docker-based NetBox installations using [netbox-docker](https://github.com/netbox-community/netbox-docker):
92
+
93
+ > **📋 For detailed Docker installation instructions in English and Portuguese, see [DOCKER_INSTALL.md](DOCKER_INSTALL.md)**
94
+
95
+ #### Quick Docker Setup
96
+
97
+ ## Installation
98
+
99
+ ### Method 1: PyPI (Recommended)
100
+
101
+ ```bash
102
+ # Install via pip
103
+ pip install netbox-maintenance-device
104
+ ```
105
+
106
+ **For Docker deployments**, add to your `plugin_requirements.txt`:
107
+ ```bash
108
+ echo "netbox-maintenance-device>=1.2.1" >> plugin_requirements.txt
109
+ ```
110
+
111
+ ### Method 2: From Source
112
+
113
+ 1. Add to `plugin_requirements.txt`:
114
+ ```bash
115
+ echo "https://github.com/diegogodoy06/netbox-maintenance-device/archive/main.tar.gz" >> plugin_requirements.txt
116
+ ```
117
+
118
+ 2. Configure in `configuration/plugins.py`:
119
+ ```python
120
+ PLUGINS = ['netbox_maintenance_device']
121
+ ```
122
+
123
+ 3. Rebuild and restart:
124
+ ```bash
125
+ docker compose down
126
+ docker compose build --no-cache
127
+ docker compose up -d
128
+ docker compose exec netbox python manage.py migrate
129
+ ```
130
+
131
+ ## Configuration
132
+
133
+ ### Basic Configuration
134
+
135
+ Add the plugin to your NetBox `configuration.py`:
136
+
137
+ ```python
138
+ # configuration.py
139
+
140
+ PLUGINS = [
141
+ 'netbox_maintenance_device',
142
+ # ... other plugins
143
+ ]
144
+
145
+ # Optional: Plugin-specific settings
146
+ PLUGINS_CONFIG = {
147
+ 'netbox_maintenance_device': {
148
+ # Future configuration options will be added here
149
+ # Currently, the plugin uses default settings
150
+ }
151
+ }
152
+ ```
153
+
154
+ ### Language Configuration (Optional)
155
+
156
+ To enable Portuguese-BR by default:
157
+
158
+ ```python
159
+ # configuration.py
160
+
161
+ # Enable internationalization
162
+ USE_I18N = True
163
+ USE_L10N = True
164
+
165
+ # Set default language
166
+ LANGUAGE_CODE = 'pt-br'
167
+ TIME_ZONE = 'America/Sao_Paulo'
168
+
169
+ # Available languages
170
+ LANGUAGES = [
171
+ ('en', 'English'),
172
+ ('pt-br', 'Português (Brasil)'),
173
+ ]
174
+ ```
175
+
176
+ ### Database Migration
177
+
178
+ After configuration, run migrations:
179
+
180
+ ```bash
181
+ python manage.py migrate
182
+ ```
183
+
184
+ ### Restart Services
185
+
186
+ Restart your NetBox services:
187
+
188
+ ```bash
189
+ # For systemd
190
+ sudo systemctl restart netbox netbox-rq
191
+
192
+ # For Docker
193
+ docker compose restart netbox netbox-worker
194
+ ```
195
+
196
+ ## Screenshots
197
+
198
+ ### Device Maintenance Section
199
+ *View maintenance plans and status directly on device pages*
200
+
201
+ ![Device Maintenance](https://github.com/diegogodoy06/netbox-maintenance-device/blob/main/docs/img/device.png?raw=true)
202
+
203
+ ### Upcoming Maintenance Dashboard
204
+ *Monitor all upcoming and overdue maintenance across your infrastructure*
205
+
206
+ ![Upcoming Maintenance](https://github.com/diegogodoy06/netbox-maintenance-device/blob/main/docs/img/Upcoming.png?raw=true)
207
+
208
+ ### Maintenance Plan Management
209
+ *Create and manage maintenance plans with flexible scheduling*
210
+
211
+ ![Maintenance Plans](https://github.com/diegogodoy06/netbox-maintenance-device/blob/main/docs/img/Plans.png?raw=true)
212
+
213
+
214
+ ## Usage
215
+
216
+ ### Creating Maintenance Plans
217
+
218
+ 1. Navigate to **Plugins > Manutenção de Dispositivos > Planos de Manutenção**
219
+ 2. Click **Add** to create a new maintenance plan
220
+ 3. Select a device, provide a name, and set the frequency in days
221
+ 4. Choose between preventive or corrective maintenance type
222
+ 5. Save and activate the plan
223
+
224
+ ### Scheduling Maintenance
225
+
226
+ #### From Device Page:
227
+ 1. Go to any device detail page
228
+ 2. View the **Maintenance** section
229
+ 3. Click the **📅 Schedule** button next to any plan
230
+ 4. Set date, technician, and notes
231
+ 5. Confirm to create a scheduled execution
232
+
233
+ #### From Upcoming Maintenance:
234
+ 1. Navigate to **Plugins > Upcoming Maintenance**
235
+ 2. Find the maintenance plan in the table
236
+ 3. Click **📅 Schedule** in the Actions column
237
+ 4. Complete the scheduling form
238
+
239
+ ### Completing Maintenance
240
+
241
+ #### Quick Complete:
242
+ 1. From the **Upcoming Maintenance** page or device section
243
+ 2. Click the **✅ Complete** button for overdue/due maintenance
244
+ 3. Add technician notes and confirm
245
+ 4. The system creates and marks the execution as completed
246
+
247
+ #### Manual Recording:
248
+ 1. Navigate to **Plugins > Maintenance Executions**
249
+ 2. Click **Add** to record a new execution
250
+ 3. Select the plan, set dates, and update status
251
+ 4. Add detailed notes and technician information
252
+
253
+ ### Monitoring Maintenance
254
+
255
+ #### Device-Level Monitoring:
256
+ - **Maintenance Section**: Shows active plans with status badges
257
+ - **Visual Indicators**: Red (overdue), yellow (due soon), green (on track)
258
+ - **Quick Actions**: Schedule and complete buttons for urgent items
259
+
260
+ #### Dashboard Monitoring:
261
+ - **Upcoming Maintenance**: Centralized view of all maintenance
262
+ - **Status Filters**: Filter by overdue, due soon, or scheduled
263
+ - **Bulk Actions**: Manage multiple maintenance items efficiently
264
+
265
+ ## Models
266
+
267
+ ### MaintenancePlan
268
+ - **Device**: Links to a specific NetBox device
269
+ - **Name**: Descriptive name for the maintenance type
270
+ - **Type**: Preventive or corrective maintenance
271
+ - **Frequency**: Maintenance interval in days
272
+ - **Status**: Active/inactive flag
273
+
274
+ ### MaintenanceExecution
275
+ - **Plan**: Links to the maintenance plan
276
+ - **Scheduled Date**: When maintenance is scheduled
277
+ - **Completed Date**: When maintenance was completed
278
+ - **Status**: scheduled, in_progress, completed, cancelled
279
+ - **Technician**: Person responsible for maintenance
280
+ - **Notes**: Detailed maintenance notes
281
+
282
+
283
+ ### Available Endpoints
284
+
285
+ | Endpoint | Operations | Description |
286
+ |----------|------------|-------------|
287
+ | `/maintenance-plans/` | CRUD + Custom Actions | Manage maintenance plans |
288
+ | `/maintenance-executions/` | CRUD + Custom Actions | Manage maintenance executions |
289
+ | `/maintenance-plans/overdue/` | GET | Get overdue plans |
290
+ | `/maintenance-plans/upcoming/` | GET | Get upcoming plans |
291
+ | `/maintenance-plans/statistics/` | GET | Get plan statistics |
292
+ | `/maintenance-executions/pending/` | GET | Get pending executions |
293
+
294
+
295
+ ---
296
+
297
+
298
+ ## 🤝 Contributing
299
+
300
+ Contributions are welcome! Please feel free to submit a Pull Request.
301
+
302
+ ## 📄 License
303
+
304
+ This project is licensed under the Apache 2.0 License - see the [LICENSE](LICENSE) file for details.
305
+
306
+ ## 🙏 Acknowledgments
307
+
308
+ - NetBox community for the excellent platform
309
+ - Contributors and users providing feedback