5. Host Checks
The Host Checks API is only available from the Host Checks Hooks.
Functions
-
function getIp()
Get the Host IP address and VLAN information.
- Returns
table:
ip: the host IP address
vlan: the host VLAN ID (0 for no VLAN)
-
function isLocal()
Check if the host is local.
- Returns
true if local, false otherwise
-
function getApplicationBytes(int app_id)
Get the nDPI application bytes.
- Parameters
app_id – the nDPI application ID
- Returns
the nDPI application bytes
-
function getBytes()
Get the bytes sent and received by the host.
- Returns
table:
bytes.sent: the bytes sent
bytes.rcvd: the bytes received
-
function getPackets()
Get the packets sent and received by the host.
- Returns
table:
packets.sent: the packets sent
packets.rcvd: the packets received
-
function getNumFlows()
Get the total flows of the host.
- Returns
table:
total_flows.as_client: the number of flows generated by the host
total_flows.as_server: the number of flows received by the host
-
function getTime()
Get time information about the host.
- Returns
table:
seen.first: the Unix timestamp when the host was first seen seen.last: the Unix timestamp when the host was last seen duration: the total seconds the host was seen total_activity_time: the total seconds in which the host was active
-
function getDNSInfo()
Get detailed DNS information on the host.
- Returns
a lua table with the information. See DnsStats::lua for details
-
function getHTTPInfo()
Get detailed HTTP information on the host.
- Returns
a lua table with the information. See HTTPstats::lua for details
-
function getTsKey()
Get the unique key to be used to store host timeseries data.
- Returns
the host timeseries key