NetAlertX
NetAlertX copied to clipboard
Plugin for Mikrotik DHCP Leases
Is there an existing issue for this?
- [X] I have searched the existing open and closed issues
Is your feature request related to a problem? Please describe
I was looking for the possibility to import directly from Mikrotik DHCP Leases, but I couldn't find a plugin to do it.
Describe the solution you'd like
The idea is to be able to import the DHCP Leases from the Mikrotik, just like the leiweibau fork: https://github.com/leiweibau/Pi.Alert/blob/24730e9269254a3ffcc06865feff7799e9fe7744/back/pialert.py#L729
Describe alternatives you've considered
I've been looking at how to create a plugin, and I think I might be able to do it, but I'm wondering how to install a library I need for Python, in order to make the plugin.
@jokob-sk could you confirm me if the python library needed for the plugin can be added here, or should I do it another way?
https://github.com/jokob-sk/Pi.Alert/blob/9f5884c4e769b026135be484dce38a36d6deadf8/install/install_python.sh#L16
Anything else?
More information about the Mikrotik DHCP Leases: https://wiki.mikrotik.com/wiki/Manual:IP/DHCP_Server#Leases
Hi @elraro,
Thanks for helping out!
Please extend the existing dhcp_leases
plugin and add an option to import microtik-formatted dhcp.leases files. It should be pretty straightforward (e.g. let's say the mapped path needs to have microtik
in it, same as with pihole
):
https://github.com/jokob-sk/Pi.Alert/blob/main/front/plugins/dhcp_leases/script.py#L59
Yes, additional python packages can be installed via the file you referenced: https://github.com/jokob-sk/Pi.Alert/blob/9f5884c4e769b026135be484dce38a36d6deadf8/install/install_python.sh#L16
Looking forward to the PR!
Please also update relevant documentation and settings descriptions.
Thanks, j
Hi @jokob-sk
The problem I see with extending the existing dhcp_leases
plugin is this plugin reads the dhcp leases from files on disk. And in this case, I would connect to the mikrotik to read the console output. I had thought about making a new plugin, as the operation was completely different, but I can study it.
Thank you!
Oh, in that case, sure thing. Go ahead and create a new plugin. I thought there was a file to read from.
Hi @jokob-sk
I'm not dead hehe but very busy due to my girlfriend's surgery. Hope I can start with this in a few weeks.
Thank you!
@elraro glad to hear that you are still alive π
I hope the surgery goes well! π And of course no rush.
Thank you in advance for helping out!
Thank you jokob!
I was really busy this months preparing my wedding. Now that I am a married men, I will see your video and I make the plugin.
Congratulations @elraro ππΎ welcome to the club π
Just FYI @elraro , @lookflying submitted a PR for this - but you are more than welcome to improve other things :) https://github.com/jokob-sk/NetAlertX/issues?q=is%3Aissue++label%3A%22help+wanted+%F0%9F%86%98%22+
Its great! Thank you @lookflying . Im learning how to create a plugin. I will take a look!