Update install-dsmon.sh

This commit is contained in:
2024-11-27 21:23:13 -06:00
parent f74540a7e2
commit 1801d00f23

View File

@@ -154,9 +154,9 @@ if [ "${SET_SERVERMONID}" = "new" ]; then
if [ "${mysqlip}" != "" ]; then
QRY="USE servermonitor; INSERT INTO hosts (\`host\`,\`hostname\`,\`ip\`,\`limits\`) VALUES ('${ADD_SERVERNAME}','${ADD_SERVERHOSTNAME}','${SERVERIPS// /}','${thresholdlog[@]}');"
mysql -h ${mysqlip} -u sysmoninsert -psysmoninsert -e "${QRY}"
mariadb --skip-ssl -h ${mysqlip} -u sysmoninsert -psysmoninsert -e "${QRY}"
QRY="USE servermonitor; SELECT id FROM hosts WHERE host='${ADD_SERVERNAME}';"
SET_SERVERMONID=`mysql -h ${mysqlip} -u sysmoninsert -psysmoninsert -e "${QRY}"`
SET_SERVERMONID=`mariadb --skip-ssl -h ${mysqlip} -u sysmoninsert -psysmoninsert -e "${QRY}"`
else
echo -e "${idsCL[Red]}Could not connect to MySQL${idsCL[Default]}"
fi