jokob-sk / NetAlertX

πŸ–§πŸ” WIFI / LAN intruder detector. Scans for devices connected to your network and alerts you if new and unknown devices are found.
GNU General Public License v3.0
3.12k stars 186 forks source link

Multi-Site UNIFIMP for Importing Hosts in a Multi-Site Unifi Infrastructure #858

Closed Disciplus86 closed 4 weeks ago

Disciplus86 commented 1 month ago

Is there an existing issue for this?

Is your feature request related to a problem? Please describe

Hi,

I have two sites, each with its own cloud key, but currently, UNIFIMP can only import one site.

Describe the solution you'd like

Do you think it’s possible to duplicate the UNIFIMP plugin to create a second or third UNIFIMP module (e.g., UNIFIMP1, UNIFIMP2)?

Describe alternatives you've considered

What would be easier: modifying the existing module or duplicating it?

Anything else?

nothing

Am I willing to test this? πŸ§ͺ

Can I help implement this? πŸ‘©β€πŸ’»πŸ‘¨β€πŸ’»

jokob-sk commented 1 month ago

Hi @Disciplus86,

The plugin should allow you to add multiple sites.

https://github.com/jokob-sk/NetAlertX/blob/05e4de0dc80f86c8ccc99a687a137875429b5d7e/front/plugins/unifi_import/script.py#L89

The code loops thru all sites and collects devices. Have you tried adding more sites in the setting UNIFI_SITES?

jokob-sk commented 1 month ago

If you have different log ins and or controllers you can potentially run multiple NAX instances and synchronize them with the sync plugin: https://github.com/jokob-sk/NetAlertX/tree/main/front/plugins/sync

Disciplus86 commented 1 month ago

Hi @Disciplus86,

The plugin should allow you to add multiple sites.

https://github.com/jokob-sk/NetAlertX/blob/05e4de0dc80f86c8ccc99a687a137875429b5d7e/front/plugins/unifi_import/script.py#L89

The code loops thru all sites and collects devices. Have you tried adding more sites in the setting UNIFI_SITES?

Hi @jokob-sk , No, i can't. I have 2 controller (UNIFI_HOST) with one site :/

in the code : c = Controller(UNIFI_HOST, UNIFI_USERNAME, UNIFI_PASSWORD, port=PORT, version=VERSION, ssl_verify=VERIFYSSL, site_id=site)

I will try to duplicate the plugin :/

Disciplus86 commented 1 month ago

If you have different log ins and or controllers you can potentially run multiple NAX instances and synchronize them with the sync plugin: https://github.com/jokob-sk/NetAlertX/tree/main/front/plugins/sync

Yes, i think is the most easier.

jokob-sk commented 4 weeks ago

Closing as resolved, will reopen if needed