Skip to content

Commit 784e0ab

Browse files
committed
Merge pull request #25 from PaesslerAG/bugfix_external_ip
bugfix for sensor, when WiFi is active sensor was stopping probe
2 parents 4eccbee + 4cb5867 commit 784e0ab

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

miniprobe/sensors/externalip.py

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -64,6 +64,8 @@ def get_data(data, out_queue):
6464
try:
6565
address = ip.get_ip(server)
6666
logging.debug("IP-Address: %s" % address)
67+
localip = ip.local_ip('eth0')
68+
remoteip = ip.remote_ip(server)
6769
except Exception as e:
6870
logging.error("Ooops Something went wrong with '%s' sensor %s. Error: %s" % (ip.get_kind(),
6971
data['sensorid'], e))
@@ -80,7 +82,7 @@ def get_data(data, out_queue):
8082
addressdata.append(element)
8183
data = {
8284
"sensorid": int(data['sensorid']),
83-
"message": "External IP: " + ip.remote_ip(server) + " Internal IP: " + ip.local_ip('eth0'),
85+
"message": "External IP: " + remoteip + " Internal IP: " + localip,
8486
"channel": addressdata
8587
}
8688
del address

0 commit comments

Comments
 (0)