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