summaryrefslogtreecommitdiff
path: root/python-status-exporter/modules/tools.py
diff options
context:
space:
mode:
Diffstat (limited to 'python-status-exporter/modules/tools.py')
-rw-r--r--python-status-exporter/modules/tools.py10
1 files changed, 10 insertions, 0 deletions
diff --git a/python-status-exporter/modules/tools.py b/python-status-exporter/modules/tools.py
new file mode 100644
index 0000000..f54099d
--- /dev/null
+++ b/python-status-exporter/modules/tools.py
@@ -0,0 +1,10 @@
+
+
+import socket
+def primary_ip():
+ s = socket.socket(socket.AF_INET, socket.SOCK_DGRAM)
+ s.connect(("8.8.8.8", 80))
+ ip = s.getsockname()[0]
+ s.close()
+ return ip
+