diff --git a/install-dsmon.sh b/install-dsmon.sh index 04f39fb..10e1840 100755 --- a/install-dsmon.sh +++ b/install-dsmon.sh @@ -144,6 +144,7 @@ if [ "${SET_SERVERMONID}" = "new" ]; then source /opt/idssys/dsmon/config.settings.inc ADD_SERVERHOSTNAME=(`hostname`) + ADD_SERVERHOSTNAME_FULL=(`hostname -f`) ADD_SERVERIP=(`hostname -I`) ADD_SERVERIPS='' for nip in "${ADD_SERVERIP[@]}"; do @@ -162,7 +163,7 @@ if [ "${SET_SERVERMONID}" = "new" ]; then done if [ "${mysqlip}" != "" ]; then - QRY="USE servermonitor; INSERT INTO hosts (\`host\`,\`hostname\`,\`ip\`,\`limits\`) VALUES ('${ADD_SERVERNAME}','${ADD_SERVERHOSTNAME}','${SERVERIPS// /}','${thresholdlog[@]}');" + QRY="USE servermonitor; INSERT INTO hosts (\`host\`,\`hostname\`,\`hostname_full\`,\`ip\`,\`limits\`) VALUES ('${ADD_SERVERNAME}','${ADD_SERVERHOSTNAME}','${ADD_SERVERHOSTNAME_FULL}','${SERVERIPS// /}','${thresholdlog[@]}');" ${mysqlcmd} -h ${mysqlip} -u sysmoninsert -psysmoninsert -e "${QRY}" QRY="USE servermonitor; SELECT id FROM hosts WHERE host='${ADD_SERVERNAME}';" SET_SERVERMONID=`${mysqlcmd} -h ${mysqlip} -u sysmoninsert -psysmoninsert -e "${QRY}"`