for home automation purposes (presence detection of devices) i'm looking for a commandline command to write all local hosts with active connections into a textfile which i can parse in my home automation system.
just like the hosts are displayed at the "Status-->Connected Hosts" page in gargoyle router
i plan to setup a cronjob to write the file and send it to a remote machine
can anyone help me with that?
hosts with active connections
Moderator: Moderators
Re: hosts with active connections
Will these clients always be wireless?
https://wiki.openwrt.org/doc/faq/faq.wi ... ed_clients
https://wiki.openwrt.org/doc/faq/faq.wi ... ed_clients
https://lantisproject.com/downloads/gargoylebuilds for the latest releases
Please be respectful when posting. I do this in my free time on a volunteer basis.
Please be respectful when posting. I do this in my free time on a volunteer basis.
Re: hosts with active connections
in fact not, all devices are wired connections (connected through different other wlan APs)
Re: hosts with active connections
Unless I'm missing something, there doesn't seem to be a simple way to do this.
Things that come to mind:
Parse the current dhcp leases file
Ping each address to check if it is still alive
Output list somewhere for processing/sending
Things that come to mind:
Parse the current dhcp leases file
Ping each address to check if it is still alive
Output list somewhere for processing/sending
https://lantisproject.com/downloads/gargoylebuilds for the latest releases
Please be respectful when posting. I do this in my free time on a volunteer basis.
Please be respectful when posting. I do this in my free time on a volunteer basis.
Re: hosts with active connections
dhcp leases came to my mind as well, but is not practicable for short term notification as minimum leasetime is 1h (or do i have the possibility to set minimum dhcp leasetime to 5-15min?) that would be the easiest way.
ping test is a problem since mobile phones shut down wireless after some time of inactivity (sleep) and do no response to ping anymore
ping test is a problem since mobile phones shut down wireless after some time of inactivity (sleep) and do no response to ping anymore
Re: hosts with active connections
any comments on that? is ther a way to set dhcp leasetimes less than an hour?
Re: hosts with active connections
I don't have any better ideas.
Lease times can be set to minutes by putting an "m" after the number.
You probably need to adjust this at the command line as Gargoyle defaults to hours "h"
Lease times can be set to minutes by putting an "m" after the number.
You probably need to adjust this at the command line as Gargoyle defaults to hours "h"
https://lantisproject.com/downloads/gargoylebuilds for the latest releases
Please be respectful when posting. I do this in my free time on a volunteer basis.
Please be respectful when posting. I do this in my free time on a volunteer basis.
Re: hosts with active connections
yeah: that did the trick - had to set it manually in console as webinterface would not let me...
now i can use /tmp/dhcp.leases to check for presence
now i can use /tmp/dhcp.leases to check for presence
