From b16977141a3ad4a45f1dcd63e2946601fdc1e6fe Mon Sep 17 00:00:00 2001 From: David Schroeder Date: Sun, 13 Mar 2022 14:38:39 -0500 Subject: [PATCH] Update install-dsmon.sh --- install-dsmon.sh | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/install-dsmon.sh b/install-dsmon.sh index 1399eb5..b36e1a7 100755 --- a/install-dsmon.sh +++ b/install-dsmon.sh @@ -58,7 +58,9 @@ if [ "${SET_SERVERMONID}" = "new" ]; then ADD_SERVERNAME=${hostname} fi - QRY="USE servermonitor; INSERT INTO hosts (\`host\`) VALUES ('${ADD_SERVERNAME}');" + ADD_SERVERIP=`hostname -I` + + QRY="USE servermonitor; INSERT INTO hosts (\`host\`,\`ip\`) VALUES ('${ADD_SERVERNAME}','${ADD_SERVERIP});" mysql -h mysqldb.scity.us -P 6033 --user=sysmoninsert --password=sysmoninsert -e "${QRY}" QRY="USE servermonitor; SELECT id FROM hosts WHERE host='${ADD_SERVERNAME}';" SET_SERVERMONID=`mysql -h mysqldb.scity.us -P 6033 --user=sysmoninsert --password=sysmoninsert -e "${QRY}"`