Update install-dsmon.sh

This commit is contained in:
2022-03-13 14:38:39 -05:00
parent 0708035787
commit b16977141a

View File

@@ -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}"`