Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Plugin for Mikrotik DHCP Leases #532

Open
1 task done
elraro opened this issue Jan 6, 2024 · 5 comments
Open
1 task done

Plugin for Mikrotik DHCP Leases #532

elraro opened this issue Jan 6, 2024 · 5 comments
Labels
Contributors 🙏 Open for contributors to step in & help as I don't have time & expertise for everything myself. Feature request➕ New feature or request help wanted 🆘 Extra attention is needed

Comments

@elraro
Copy link

elraro commented Jan 6, 2024

Is there an existing issue for this?

  • 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

@elraro elraro added the Feature request➕ New feature or request label Jan 6, 2024
@jokob-sk
Copy link
Owner

jokob-sk commented Jan 7, 2024

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

@jokob-sk jokob-sk added the Contributors 🙏 Open for contributors to step in & help as I don't have time & expertise for everything myself. label Jan 7, 2024
@elraro
Copy link
Author

elraro commented Jan 7, 2024

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!

@jokob-sk
Copy link
Owner

jokob-sk commented Jan 7, 2024

Oh, in that case, sure thing. Go ahead and create a new plugin. I thought there was a file to read from.

@jokob-sk jokob-sk added the help wanted 🆘 Extra attention is needed label Jan 25, 2024
@elraro
Copy link
Author

elraro commented Feb 9, 2024

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!

@jokob-sk
Copy link
Owner

jokob-sk commented Feb 9, 2024

@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!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Contributors 🙏 Open for contributors to step in & help as I don't have time & expertise for everything myself. Feature request➕ New feature or request help wanted 🆘 Extra attention is needed
Projects
None yet
Development

No branches or pull requests

2 participants