diff --git a/confluent_client/bin/nodediscover b/confluent_client/bin/nodediscover index b6b485de..1d1d4c39 100755 --- a/confluent_client/bin/nodediscover +++ b/confluent_client/bin/nodediscover @@ -44,6 +44,8 @@ columnmapping = { 'Mac': 'macs', 'Switch': 'switch', 'Port': 'port', + 'Advertised IP': 'otheripaddrs', + 'Other IP': 'otheripaddrs', } @@ -208,7 +210,8 @@ def list_discovery(options, session): columns = [] for field in options.fields.split(','): for cdt in columnmapping: - if cdt.lower() == field.lower(): + if cdt.lower().replace( + ' ', '') == field.lower().replace(' ', ''): columns.append(cdt) else: columns = defcolumns diff --git a/confluent_server/confluent/discovery/core.py b/confluent_server/confluent/discovery/core.py index 9f37f424..bb23e2e1 100644 --- a/confluent_server/confluent/discovery/core.py +++ b/confluent_server/confluent/discovery/core.py @@ -211,6 +211,8 @@ def send_discovery_datum(info): if infotype in servicenames: types.append(servicenames[infotype]) yield msg.KeyValueData({'types': types}) + if 'otheraddresses' in info: + yield msg.KeyValueData({'otheripaddrs': list(info['otheraddresses'])}) def _info_matches(info, criteria): @@ -637,6 +639,9 @@ def detected(info): uuid = info.get('uuid', None) if uuid_is_valid(uuid): known_uuids[uuid][info['hwaddr']] = info + info['otheraddresses'] = set([]) + for i4addr in info.get('attributes', {}).get('ipv4-address', []): + info['otheraddresses'].add(i4addr) if handler and handler.https_supported and not handler.https_cert: if handler.cert_fail_reason == 'unreachable': log.log(