You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
This repository was archived by the owner on Mar 29, 2023. It is now read-only.
Copy file name to clipboardExpand all lines: README.md
+70-3Lines changed: 70 additions & 3 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -2,9 +2,14 @@
2
2
3
3
A plugin for [Netbox](https://github.com/netbox-community/netbox) to get power distribution unit Information.
4
4
5
-
`axians-netbox-plugin-pdu` is using [Easy SNMP](https://easysnmp.readthedocs.io/en/latest/), [Django-RQ](https://github.com/rq/django-rq) and [RQ-Scheduler](https://github.com/rq/rq-scheduler) to display PDU information within Netbox.
5
+
`axians-netbox-plugin-pdu` is using [Easy SNMP](https://easysnmp.readthedocs.io/en/latest/), [Django-RQ](https://github.com/rq/django-rq) and [RQ-Scheduler](https://github.com/rq/rq-scheduler) to display PDU information within Netbox.
6
6
7
7
## Installation
8
+
The plugin is available as a Python package in pypi and can be installed with pip
9
+
10
+
```
11
+
pip install axians-netbox-plugin-pdu
12
+
```
8
13
9
14
> The plugin is compatible with NetBox 2.8.1 and higher
There are a number of default settings that can be altered using the following list of settings:
29
+
30
+
*`schedule`: Boolean (default True). If True, this will enable automatic polling of your PDU Devices.
31
+
*`schedule_interval`: Integer (default 300 seconds). Length of time between each scheduled poll.
32
+
*`snmp_read`: String (default public) SNMP read value for your SNMP enabled PDU's.
33
+
*`snmp_write`: String (default private) SNMP write value for your SNMP enabled PDU's.
34
+
*`rack_view_pdu_devices`: Boolean (default True), if True, the power usage per PDU will be displayed on the rack page.
35
+
*`rack_view_usage_summary`: Boolean (default True), if True, the a summary information tile will appear within the rack page to show true power utilization within the rack.
36
+
*`rack_view_summary_unit`: String (default watts), option to display watts/kilowatts on the rack summary view. If "kilowatts" is used the power usage summary will display in Kilowatts.
37
+
38
+
## Usage
39
+
### Preparation
40
+
For this plugin to work there must be a new worker added to your Netbox installation. The new worker is a custom scheduler that will schedule the PDU Tasks to run on an interval and utilize the django-rq library.
41
+
42
+
> You can utilize this library without the automated tasks by feeding Netbox the power usage information via the `axians_netbox_pdu` API.
43
+
44
+
### Default Environment
45
+
For the standard install please use the included [netbox-pdu.service](contrib/netbox-pdu.service) and install using the standard [Netbox Documentation](https://netbox.readthedocs.io/en/stable/installation/migrating-to-systemd/).
46
+
47
+
### Docker Environment
48
+
To use within Docker make sure you have a container running that runs the following command: `python manage.py pduschedule`
49
+
50
+
### Adding a new PDU Configuration
51
+
Once installed and the `pduscheduler` is running you can attach a `PDUConfig` to a DeviceType. To do this you must have a DeviceType configured with PowerOutlets. You can specify the DeviceType, PDU SNMP OID and the Unit. This enables the plugin to know what SNMP OID to collect per DeviceType.
52
+
53
+
Now a PDUConfig has been created a device must be created with a management IP. Once this is done the plugin can poll the PDU via SNMP and save the power usage.
54
+
55
+
This can also be done via Bulk Import or via the API.
56
+
57
+
> If a a PDUConfig is not created for a DeviceType and the Device does not have a Primary IP no data will be collected.
58
+
59
+
### API
60
+
The plugin includes several endpoints to manage the PDUConfig and PDUStatus.
61
+
62
+
```
63
+
GET /api/plugins/pdu/pdu-config/ List PDUConfig
64
+
POST /api/plugins/pdu/pdu-config/ Create PDUConfig
65
+
PATCH/PUT /api/plugins/pdu/pdu-config/{id}/ Edit a specific PDUConfig
66
+
DELETE /api/plugins/pdu/pdu-config/{id}/ Delete a specific PDUConfig
67
+
68
+
GET /api/plugins/pdu/pdu-status/ List PDUStatus
69
+
POST /api/plugins/pdu/pdu-status/ Create PDUStatus
70
+
PATCH/PUT /api/plugins/pdu/pdu-status/{id}/ Edit a specific PDUStatus
71
+
DELETE /api/plugins/pdu/pdu-status/{id}/ Delete a specific PDUStatus
72
+
```
73
+
74
+
## Screen Shots
75
+
List of PDUConfig Instances
76
+

0 commit comments