aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--client_settings.example.sh3
-rwxr-xr-xmonitor_daemon.sh7
2 files changed, 9 insertions, 1 deletions
diff --git a/client_settings.example.sh b/client_settings.example.sh
new file mode 100644
index 0000000..59bd00f
--- /dev/null
+++ b/client_settings.example.sh
@@ -0,0 +1,3 @@
+#!/bin/bash
+export SOCKET_HOST=127.0.0.1
+export SOCKET_PORT=2334
diff --git a/monitor_daemon.sh b/monitor_daemon.sh
index 7d976ee..e18720f 100755
--- a/monitor_daemon.sh
+++ b/monitor_daemon.sh
@@ -4,7 +4,12 @@
# echo "you must specify the triggered command"
# exit 1
#fi
-CLIENT="python lab_monitor_client.py"
+if [[ -e client_settings.sh ]]; then
+ source client_settings.sh
+ SOCKET_SPEC="--host $SOCKET_HOST --port $SOCKET_PORT"
+fi
+echo "Reporting to $SOCKET_SPEC"
+CLIENT="python lab_monitor_client.py $SOCKET_SPEC"
function on_exit {
$CLIENT --drop "$JID"
exit 0