From 87dabce8ab9d4100a38a989be27ad473018ed9cd Mon Sep 17 00:00:00 2001 From: David Schroeder Date: Sun, 3 Apr 2022 19:17:35 -0500 Subject: [PATCH] Update install-dsmon.sh --- install-dsmon.sh | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/install-dsmon.sh b/install-dsmon.sh index c40124f..8cc517a 100755 --- a/install-dsmon.sh +++ b/install-dsmon.sh @@ -100,7 +100,7 @@ if [ "${SET_SERVERMONID}" = "new" ]; then ADD_SERVERNAME=${hostname} fi - ADD_SERVERIP=`hostname -I` + ADD_SERVERHOSTNAME=(`hostname`) ADD_SERVERIP=(`hostname -I`) ADD_SERVERIPS='' for nip in "${ADD_SERVERIP[@]}"; do @@ -113,7 +113,7 @@ if [ "${SET_SERVERMONID}" = "new" ]; then fi done - QRY="USE servermonitor; INSERT INTO hosts (\`host\`,\`ip\`) VALUES ('${ADD_SERVERNAME}','${SERVERIPS// /}');" + QRY="USE servermonitor; INSERT INTO hosts (\`host\`,\`hostname\`,\`ip\`) VALUES ('${ADD_SERVERNAME}','${ADD_SERVERHOSTNAME}','${SERVERIPS// /}');" 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}"`