leiweibau / Pi.Alert

Scan the devices connected to your WIFI / LAN and alert you the connection of unknown devices. It also warns if a "always connected" device disconnects. In addition, it is possible to check web services for availability. For this purpose HTTP status codes and the response time of the service are evaluated.
https://leiweibau.net
GNU General Public License v3.0
478 stars 32 forks source link

[Feature Request] Hypervisors #189

Closed modem7 closed 1 year ago

modem7 commented 1 year ago

Heya,

Some people have hypervisors on their network, and as such, things like virtual machines and containers can't be attached on the network page as there is no option to do so (as these items aren't connected to a switch/router/access point).

My request is as follows:

Allow the ability to attach the VM/Container to the Hypervisor (much like one would do with WLAN) under Network.

modem7 commented 1 year ago

Whilst there is an argument to be made that containers are technically services rather than nodes/machines, they do show up on the network diagram if one has set them up with MACVLAN so they have their own vNIC.

For example, these are some LXC containers I've created on Proxmox which show up on the network diagram as they have their own vNIC: image

And here is my list of Virtual Machines and LXC containers: image

leiweibau commented 1 year ago

I also use different hypervisors in my network. I have handled it by assigning the VMs to the same port as the hypervisor. When doing this, the hosts/VMs are listed one below the other. Of course, I also understand the desire to display the VMs separately. I'll give that some thought.

modem7 commented 1 year ago

I wasn't aware you could do that.

Your method would be suitable (although I would recommend the VM/Container labels for Connection Type).

It all depends on your viewpoint and obviously the cost/benefit on the rework.

leiweibau commented 1 year ago

Adding 1-2 labels and extending the code is a bit of work, but it's not too much. And there is no pressure, because this is a freetime project.

However, a rewrite will not happen so soon, because the presentation at the end looks simple, but the creation of the page is so convoluted that I have no motivation for the time being.

modem7 commented 1 year ago

That makes sense!

It makes sense to keep it on the backburner for now until such a time it becomes viable or someone with suitable python experience puts a PR in.

The method you've mentioned above works fine for the moment, so I appreciate that!

leiweibau commented 1 year ago

Adding labels should be possible with the next update in the next 1-2 weeks. If I have any questions, I will get back to you here.

Just to give a short explanation why this page "creeps me out" a bit 😉.

So that I don't have to make database queries again and again for the creation of the page and thus possibly block the scan, I load different tables in arrays. These are then used to generate the tabs and the content of the tabs. Thereby further arrays with arrays in them are created which are later read out again. In addition, there is the array for the different languages and arrays for exceptions such as the manual port configuration. To make it short: This page is a mountain of arrays whose content changes dynamically.

modem7 commented 1 year ago

To make it short: This page is a mountain of arrays whose content changes dynamically.

Jeez, I can absolutely see why. I shuddered at the explanation, and was very thankful I'm a backend engineer!

leiweibau commented 1 year ago

Here is a preview. Some tweaks are not done yet.

New Tab:

hyper_tab

New Device Type:

hyper_type

Selection:

hyper_target hyper_connect
modem7 commented 1 year ago

Oh that looks absolutely perfect!

leiweibau commented 1 year ago

Update released with https://github.com/leiweibau/Pi.Alert/commit/37b6b1e7a051dec1668b86bea410f37ef4feb055

modem7 commented 1 year ago

Works perfectly, will close as complete.

Thank you very much for the massively quick turnaround!