|
@@ -196,7 +196,6 @@ struct
|
|
branch = branch,
|
|
branch = branch,
|
|
firmware = firmware,
|
|
firmware = firmware,
|
|
model = model,
|
|
model = model,
|
|
- gateway = gateway,
|
|
|
|
clients = clients,
|
|
clients = clients,
|
|
online = online,
|
|
online = online,
|
|
uplink = uplink,
|
|
uplink = uplink,
|
|
@@ -257,7 +256,7 @@ struct
|
|
("firstseen", prom2string (info_prefix ^ "_firstseen", minitems, LargeInt.toString (Time.toSeconds firstseen)))]
|
|
("firstseen", prom2string (info_prefix ^ "_firstseen", minitems, LargeInt.toString (Time.toSeconds firstseen)))]
|
|
end
|
|
end
|
|
|
|
|
|
- fun node_stats { hostname, node_id, branch, firmware, model, gateway, clients, online, uplink, loadavg, memory_usage, uptime, rootfs_usage, tx, rx, forward, mgmt_tx, mgmt_rx } =
|
|
|
|
|
|
+ fun node_stats { hostname, node_id, branch, firmware, model, clients, online, uplink, loadavg, memory_usage, uptime, rootfs_usage, tx, rx, forward, mgmt_tx, mgmt_rx } =
|
|
let val items =
|
|
let val items =
|
|
[SOME ("clients", Int.toString clients),
|
|
[SOME ("clients", Int.toString clients),
|
|
SOME ("online", if online then "1" else "0"),
|
|
SOME ("online", if online then "1" else "0"),
|
|
@@ -271,7 +270,7 @@ struct
|
|
case forward of SOME forward' => SOME ("forward", Real.toString(forward')) | NONE => NONE,
|
|
case forward of SOME forward' => SOME ("forward", Real.toString(forward')) | NONE => NONE,
|
|
case mgmt_tx of SOME mgmt_tx' => SOME ("mgmt_tx", Real.toString(mgmt_tx')) | NONE => NONE,
|
|
case mgmt_tx of SOME mgmt_tx' => SOME ("mgmt_tx", Real.toString(mgmt_tx')) | NONE => NONE,
|
|
case mgmt_rx of SOME mgmt_rx' => SOME ("mgmt_rx", Real.toString(mgmt_rx')) | NONE => NONE]
|
|
case mgmt_rx of SOME mgmt_rx' => SOME ("mgmt_rx", Real.toString(mgmt_rx')) | NONE => NONE]
|
|
- fun item2prom (key, value) = (key, stats_prefix ^ key ^ "{hostname=\"" ^ hostname ^ "\",node_id=\"" ^ node_id ^ "\",branch=\"" ^ branch ^ "\",firmware=\"" ^ firmware ^ "\",model=\"" ^ model ^ "\",gateway=\"" ^ gateway ^ "\"} " ^ value ^ " " ^ !timestamp ^ "\n")
|
|
|
|
|
|
+ fun item2prom (key, value) = (key, stats_prefix ^ key ^ "{hostname=\"" ^ hostname ^ "\",node_id=\"" ^ node_id ^ "\",branch=\"" ^ branch ^ "\",firmware=\"" ^ firmware ^ "\",model=\"" ^ model ^ "\"} " ^ value ^ " " ^ !timestamp ^ "\n")
|
|
in List.mapPartial (fn (SOME i) => SOME (item2prom i) | NONE => NONE) items
|
|
in List.mapPartial (fn (SOME i) => SOME (item2prom i) | NONE => NONE) items
|
|
end
|
|
end
|
|
|
|
|