mirror of
https://github.com/jokob-sk/NetAlertX.git
synced 2025-12-06 17:15:38 -08:00
UNIFI import plugin 0.2
This commit is contained in:
@@ -1,6 +1,6 @@
|
||||
## Overview
|
||||
|
||||
A plugin allowing for importing devices from an UniFi controller.
|
||||
A plugin allowing for importing devices from a UniFi controller.
|
||||
|
||||
### Usage
|
||||
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
#!/usr/bin/env python
|
||||
# Based on the work of https://github.com/stevehoek/Pi.Alert
|
||||
# Inspired by https://github.com/stevehoek/Pi.Alert
|
||||
|
||||
# Example call
|
||||
# python3 /home/pi/pialert/front/plugins/unifi_import/script.py username=pialert password=passw0rd host=192.168.1.1 site=default protocol=https:// port=8443
|
||||
@@ -19,7 +19,6 @@ import sys
|
||||
from requests.packages.urllib3.exceptions import InsecureRequestWarning
|
||||
import pwd
|
||||
import os
|
||||
from unificontrol import UnifiClient
|
||||
from pyunifi.controller import Controller
|
||||
|
||||
|
||||
@@ -110,7 +109,7 @@ def get_entries(newEntries):
|
||||
|
||||
tmpPlugObj = plugin_object_class(
|
||||
ap['mac'],
|
||||
ap['ip'],
|
||||
get_unifi_val(ap, 'ip'),
|
||||
name,
|
||||
'Ubiquiti Networks Inc.',
|
||||
deviceType,
|
||||
@@ -134,7 +133,7 @@ def get_entries(newEntries):
|
||||
|
||||
tmpPlugObj = plugin_object_class(
|
||||
cl['mac'],
|
||||
cl['ip'],
|
||||
get_unifi_val(cl, 'ip'),
|
||||
name,
|
||||
get_unifi_val(cl, 'oui'),
|
||||
'Other',
|
||||
@@ -156,7 +155,7 @@ def get_entries(newEntries):
|
||||
|
||||
tmpPlugObj = plugin_object_class(
|
||||
us['mac'],
|
||||
us['ip'],
|
||||
get_unifi_val(us, 'ip'),
|
||||
name,
|
||||
get_unifi_val(us, 'oui'),
|
||||
'Other',
|
||||
|
||||
Reference in New Issue
Block a user