Update install-dsmon.sh
This commit is contained in:
@@ -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}"`
|
||||
|
||||
Reference in New Issue
Block a user