Make nmap work in Docker

This commit is contained in:
Paulus Schoutsen 2015-08-31 22:01:45 -07:00
parent 78826648e3
commit b41706efe3
2 changed files with 7 additions and 3 deletions

View file

@ -5,6 +5,12 @@ VOLUME /config
RUN pip3 install --no-cache-dir -r requirements_all.txt
# For the nmap tracker
RUN apt-get update && \
apt-get install -y --no-install-recommends nmap net-tools && \
apt-get clean && rm -rf /var/lib/apt/lists/* /tmp/* /var/tmp/*
# Open Z-Wave disabled because broken
#RUN apt-get update && \
# apt-get install -y cython3 libudev-dev && \
# apt-get clean && rm -rf /var/lib/apt/lists/* /tmp/* /var/tmp/* && \

View file

@ -137,9 +137,7 @@ class NmapDeviceScanner(object):
continue
name = info['hostnames'][0] if info['hostnames'] else ipv4
# Mac address only returned if nmap ran as root
mac = info['addresses'].get('mac')
if mac is None:
mac = _arp(ipv4)
mac = info['addresses'].get('mac') or _arp(ipv4)
if mac is None:
continue
device = Device(mac.upper(), name, ipv4, now)