" |enabled | boolean | no | 1 | When set to 0, disables hostmngr. The daemon will however keep running, and can be re-enabled by setting to 1. |
" |history| boolean | no | 1 | When set to 0, disables history. |
" |history_file | string | no | '/etc/hosts_history.json' | Specifies history file name. History records are stored in this file in JSON format. |
" |history_timeout | integer | no | 604800 | Specifies the duration in seconds a _non-live_ history record will be kept in history. |
interface | - | - | - | - | - |
" | ifname | string | no | br-lan | Interface name over which hostmngr runs. Default is 'br-lan', which is the bridge interface facing the LAN side. This means hostmngr detects host devices in the LAN side. |
-----------
## CLI (through UBUS) ##
The hostmngr daemon provides UBUS methods through which user or any service
can interact with for fetching status and stats of the host devices in the network.
````bash
root@iopsys:~# ubus -v list hosts
'hosts' @1000ffff
"show":{}
"history":{}
"debug":{}
````
Sample output of the 'ubus call hosts show' invocation -
````bash
root@eagle-44d43771baa0:~# ubus call hosts show
{
"hosts": [
{
"macaddress": "00:02:02:aa:bb:cc",
"hostname": "acx-laptop",
"ipv4addr": "192.168.1.160",
"address_source": "DHCP",
"lease_time_remaining": 3369,
"iswifi": false,
"is1905": false,
"state": "reachable",
"num_tcp": 0,
"num_udp": 10,
"interface": "eth3",
"ipv4_address": [
{
"ip": "192.168.1.160"
}
],
"ipv6_address": [
],
"wan_stats": {
"tx_packets": 70,
"tx_bytes": 7323,
"rx_packets": 61,
"rx_bytes": 5860
}
}
]
}
````
Sample output of the 'ubus call hosts history' -
````bash
root@eagle-44d43771baa0:~# ubus call hosts history
{
"history": [
{
"idx": 4,
"macaddress": "00:02:02:aa:bb:cc",
"hostname": "acx-laptop",
"first_seen": "2023-05-30T21:30:38",
"last_seen": "2023-05-30T21:31:57",
"alive": true,
"iswifi": false,
"wan_stats": {
"tx_packets": 0,
"tx_bytes": 0,
"rx_packets": 0,
"rx_bytes": 0
}
}
]
}
````
The value of **'alive'** changes to **false** when the host device is no longer
present in the network. A _non-live_ host device is one that is not present in the
network at that time.
## Dependencies ##
'hostmngr' requires the following components for build and runtime dependencies: