|
@@ -251,9 +251,10 @@ class BaseStorage(object):
|
|
|
item['node_id'] = itemid
|
|
|
|
|
|
# remove node's MACs from clients list
|
|
|
+ item_mac = item.get('mac') or ffstatus.guess_mac_from_nodeid(itemid)
|
|
|
clients = [x for x in item.get('clients', [])]
|
|
|
- if 'mac' in item and item['mac'] in clients:
|
|
|
- clients.remove(item['mac'])
|
|
|
+ if item_mac is not None and item_mac in clients:
|
|
|
+ clients.remove(item_mac)
|
|
|
for mac in item.get('macs', []):
|
|
|
if mac in clients:
|
|
|
clients.remove(mac)
|
|
@@ -269,9 +270,9 @@ class BaseStorage(object):
|
|
|
|
|
|
diff_added = [x for x in new_clients if x not in prev_clients]
|
|
|
diff_removed = [x for x in prev_clients if x not in new_clients]
|
|
|
- self.__send_metric("nodes." + itemid + ".clients_added",
|
|
|
+ self.__send_metric("nodes." + item_mac + ".clients_added",
|
|
|
len(diff_added), ts)
|
|
|
- self.__send_metric("nodes." + itemid + ".clients_removed",
|
|
|
+ self.__send_metric("nodes." + item_mac + ".clients_removed",
|
|
|
len(diff_removed), ts)
|
|
|
|
|
|
# finally, set each new data
|