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

How could I reach the DHCP Leases table? #24

Closed
carldebilly opened this issue Jul 9, 2018 · 2 comments
Closed

How could I reach the DHCP Leases table? #24

carldebilly opened this issue Jul 9, 2018 · 2 comments

Comments

@carldebilly
Copy link

I'm currently trying to build a device presence detection (for integration with SmartThings) and I want to know if a device is present in the DHCP leases table (status="online").

At first it seems it's not available directly in fauxapi, but I'm wondering if it's something which can be easily added.

Since I'm definitely not familiar with PHP nor developping for pfSense (I'm a dotnet guy), I don't know where to start to add this in fauxapi.

@carldebilly
Copy link
Author

After few thoughts, I think the ARP table could be a more reliable way to get the presence information I need instead of DHCP.

@ndejong
Copy link
Owner

ndejong commented Jul 10, 2018

Based on the detail you've provided "device presence detection" I'd suggest you simply need to watch the ARP tables which can be done at the pfSense console using arp -a

Adding a function to provide this would be rather easy but it is a step outside the original mission of providing a programmatic interface to pfSense to manage the config.xml file and the functions required to get that config adopted by the system.

This does not mean it's a dead-end, you should be able to use the function_call call and invoke the exec_command pfSense function to hence make an arp -a call and extract the data you need - read-the-docs, you will need to enable exec_command in the /etc/pfsense_function_calls.txt file to make this work.

Collecting the same data via a simple ssh remote-exec is your other option here.

@ndejong ndejong closed this as completed Jul 10, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants