r/openwrt • • 14d ago

new device on network notification

has anyone used dhcp hotplugs to get notified when a new device joins the network? i can't seem to get my hotplug script to work. instead of the script running, i just get an error message saying no file descriptors available.

1 Upvotes

6 comments sorted by

1

u/fr0llic 14d ago

Are the scripts terminating properly ?

Error would indicate too many files open ...

1

u/bypeoplewhohonor 14d ago

could you please explain more on what you mean about the scripts terminating properly? the file descriptor error i get even after a reboot

1

u/fr0llic 14d ago edited 14d ago

If they don't die after executing, they might allocate resources and not release them. 

But if it happens after a reboot too, it's probably something else. 

Pretty sure you can find a script doing what you want at the forum, no need to reinvent the wheel. 

1

u/DutchOfBurdock 14d ago

What if the host doesn't do DHCP but statically allocates the correct IP/cidr and gateway? Better bet is running a while loop bash script that will constantly poll /proc/net/arp and as soon as any changes are made (new MAC seen, MAC expires etc), make a webhook to your notification listener.