vortex-5 / ddwrt-bwmon

An Individual Bandwidth Monitor For DD-WRT
171 stars 37 forks source link

Giving devices custom names #42

Closed ssabetan closed 7 years ago

ssabetan commented 7 years ago

Hello,

Loving bwmon for dd-wrt. Is it possible to give each of my devices a custom name? Some hostnames aren't showing up and I only get MAC address. Any ideas?

Thanks.

vortex-5 commented 7 years ago

Your host names aren't showing up?

There are 2 reasons that have come up in the past one you're running DHCPD instead of the default dnsmasq for DHCP this causes the hostnames to not appear in /tmp/dnsmaq.leases file which is what the script uses.

The other reason is there's a bug and it's interpreting the leases incorrectly.

I would first check your router for the /tmp/dnsmasq.leases file.

If you would post the contents of the file for diagnostic (be sure to remove or obfuscate part of the mac address).

The important parts of the file is seeing that your hostnames exist in it and seeing that the mac addresses are lower cased although there is code in the script to handle the case that the mac addresses are upper cased.

As a far back there is a file in the bwmon directory called mac-names.js. This is an unelegant non automatic way of assigning names. It was originally intended on being used as a name override if you for some reason wanted a different host name than what appeared as a dns entry.

I.E. if you want "Johns-iphone" to show up as "iphone6s" mac-names.js takes highest priority so it will override any other names it finds. The mac-names.js shipped with the tool has 2 entries to help you understand the format of the file.