If the nslookup fails, then maybe a warning in the log file would be a good idea?
I was getting (note host_name is a zero-length string, ""):
Mon Oct 8 17:51:20 2018 user.debug /usr/bin/hassd.sh: post {"mac":"6c:5a:b5:4e:75:c6","host_name":"","consider_home":"24:00","source_type":"router"}
instead of:
Mon Oct 8 17:51:20 2018 user.debug /usr/bin/hassd.sh: post {"mac":"6c:5a:b5:4e:75:c6","host_name":"db-desktop","consider_home":"24:00","source_type":"router"}
This happens when reverse name lookups fails in function get_host_name in functions.sh:
root@sr-router:~# nslookup 172.27.0.99
Server: 8.8.8.8
Address: 8.8.8.8#53
** server can't find 99.0.27.172.in-addr.arpa: NXDOMAIN
Say: logger -t $0 -p warning "Reverse DNS is not setup, so names cannot be resolved"
If the
nslookupfails, then maybe a warning in the log file would be a good idea?I was getting (note
host_nameis a zero-length string,""):instead of:
This happens when reverse name lookups fails in
function get_host_nameinfunctions.sh:Say:
logger -t $0 -p warning "Reverse DNS is not setup, so names cannot be resolved"