aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorD Delmar Davis <don@suspectdevices.com>2023-08-16 14:48:14 -0700
committerD Delmar Davis <don@suspectdevices.com>2023-08-16 14:48:14 -0700
commite5b9f69ed9cd176b6c0cf73ce3ac8cf63303e4e1 (patch)
tree01fdbdecf3c046b5a803d33c61134181bbe90d5f
parent95d365e6e646f3ed7d96a669772b83e221607b04 (diff)
deploy this
-rw-r--r--docs/images/Untitled 2.pngbin0 -> 157884 bytes
-rwxr-xr-xthumper.py26
2 files changed, 26 insertions, 0 deletions
diff --git a/docs/images/Untitled 2.png b/docs/images/Untitled 2.png
new file mode 100644
index 0000000..594c6ba
--- /dev/null
+++ b/docs/images/Untitled 2.png
Binary files differ
diff --git a/thumper.py b/thumper.py
new file mode 100755
index 0000000..7dd9af5
--- /dev/null
+++ b/thumper.py
@@ -0,0 +1,26 @@
+#!/usr/bin/python
+
+import socket
+import subprocess
+
+def isExporting():
+ try:
+ # connect to the host -- tells us if the host is actually
+ # reachable
+ sock = socket.create_connection(("thumper", 9100),timeout=3)
+ if sock is not None:
+ print('dew\'s dat wabbit')
+ sock.close
+ return True
+ except OSError as e:
+ pass
+ return False
+def kickThumper():
+ ret = subprocess.call(["ssh", "root@henri-le-renne", "swctrl poe set auto id 6"]);
+ ret = subprocess.call(["ssh", "root@henri-le-renne", "swctrl poe restart id 6"]);
+
+
+if __name__ == '__main__':
+ if (not isExporting()) :
+ print("Thumpers not talking. Going to kick it")
+ kickThumper()