* use debug log level for unimportant messages
This commit is contained in:
parent
fcaa945a88
commit
5cc8513322
|
@ -376,7 +376,7 @@ func (clients *clientsContainer) addFromHostsFile() {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
log.Info("Added %d client aliases from %s", n, hostsFn)
|
log.Debug("Added %d client aliases from %s", n, hostsFn)
|
||||||
}
|
}
|
||||||
|
|
||||||
// Add IP -> Host pairs from the system's `arp -a` command output
|
// Add IP -> Host pairs from the system's `arp -a` command output
|
||||||
|
@ -422,19 +422,24 @@ func (clients *clientsContainer) addFromSystemARP() {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
log.Info("Added %d client aliases from 'arp -a' command output", n)
|
log.Debug("Added %d client aliases from 'arp -a' command output", n)
|
||||||
}
|
}
|
||||||
|
|
||||||
// add clients from DHCP that have non-empty Hostname property
|
// add clients from DHCP that have non-empty Hostname property
|
||||||
func (clients *clientsContainer) addFromDHCP() {
|
func (clients *clientsContainer) addFromDHCP() {
|
||||||
leases := config.dhcpServer.Leases()
|
leases := config.dhcpServer.Leases()
|
||||||
|
n := 0
|
||||||
for _, l := range leases {
|
for _, l := range leases {
|
||||||
if len(l.Hostname) == 0 {
|
if len(l.Hostname) == 0 {
|
||||||
continue
|
continue
|
||||||
}
|
}
|
||||||
_, _ = config.clients.AddHost(l.IP.String(), l.Hostname, ClientSourceDHCP)
|
ok, _ := config.clients.AddHost(l.IP.String(), l.Hostname, ClientSourceDHCP)
|
||||||
|
if ok {
|
||||||
|
n++
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
log.Debug("Added %d client aliases from DHCP", n)
|
||||||
|
}
|
||||||
|
|
||||||
type clientHostJSON struct {
|
type clientHostJSON struct {
|
||||||
IP string `json:"ip"`
|
IP string `json:"ip"`
|
||||||
|
|
Loading…
Reference in New Issue