Update dsmon.sh
This commit is contained in:
4
dsmon.sh
4
dsmon.sh
@@ -63,6 +63,7 @@ RUN(){
|
||||
fi
|
||||
|
||||
SERVERHOSTNAME=(`hostname`)
|
||||
SERVERHOSTNAME_FULL=(`hostname -f`)
|
||||
SERVERIP=(`hostname -I`)
|
||||
SERVERIPS=''
|
||||
for nip in "${SERVERIP[@]}"; do
|
||||
@@ -80,7 +81,7 @@ RUN(){
|
||||
thresholdlog+=("${KEY}:${THRESHOLD[$KEY]}")
|
||||
done
|
||||
|
||||
QRY="USE servermonitor; UPDATE hosts SET ip='${SERVERIPS// /}',hostname='${SERVERHOSTNAME}',limits='${thresholdlog[@]}' WHERE id='${SERVERMON_ID}';"
|
||||
QRY="USE servermonitor; UPDATE hosts SET ip='${SERVERIPS// /}',hostname='${SERVERHOSTNAME}',hostname_full='${SERVERHOSTNAME_FULL}',limits='${thresholdlog[@]}' WHERE id='${SERVERMON_ID}';"
|
||||
MYSQL_PWD="sysmoninsert" ${mysqlcmd} ${mysql_conn} -u sysmoninsert -e "${QRY}"
|
||||
|
||||
|
||||
@@ -219,6 +220,7 @@ RUN_CHECK(){
|
||||
touch /tmp/dscheck.${hostname}.running
|
||||
hostid=${host_ids[$hostname]}
|
||||
|
||||
|
||||
MSG=" ${host_name[$hostid]}"
|
||||
MSG2="- [ ${host_ip[$hostid]} ] - "
|
||||
c=0; cw=85; spc=''; spc1=`expr ${cw} - ${#MSG} - ${#MSG2}`; until [ $c = ${spc1} ]; do spc="${spc} "; c=`expr $c + 1`; done
|
||||
|
||||
Reference in New Issue
Block a user