Browse Source

feat(monitor): add tcp query to query raw (#2134)

pull/2150/head
Daniel Gibbs 6 years ago
committed by GitHub
parent
commit
06dcbb7ed4
No known key found for this signature in database GPG Key ID: 4AEE18F83AFDEB23
  1. 16
      lgsm/functions/command_dev_query_raw.sh
  2. 1
      lgsm/functions/command_monitor.sh

16
lgsm/functions/command_dev_query_raw.sh

@ -41,4 +41,18 @@ echo "./query_gsquery.py -a \"${ip}\" -p \"${queryport}\" -e \"${engine}\""
if [ ! -f "${functionsdir}/query_gsquery.py" ]; then
fn_fetch_file_github "lgsm/functions" "query_gsquery.py" "${functionsdir}" "chmodx" "norun" "noforce" "nomd5"
fi
"${functionsdir}"/query_gsquery.py -a "${ip}" -p "${queryport}" -e "${engine}"
"${functionsdir}"/query_gsquery.py -a "${ip}" -p "${queryport}" -e "${engine}"
echo""
echo "================================="
echo "tcp Raw Output"
echo "================================="
echo""
echo "bash -c 'exec 3<> /dev/tcp/'${ip}'/'${queryport}''"
bash -c 'exec 3<> /dev/tcp/'${ip}'/'${queryport}''
querystatus="$?"
if [ "${querystatus}" == "0" ]; then
echo "tcp query PASS"
else
echo "tcp query FAIL"
fi

1
lgsm/functions/command_monitor.sh

@ -13,6 +13,7 @@ local function_selfname="$(basename "$(readlink -f "${BASH_SOURCE[0]}")")"
fn_monitor_loop(){
# Will query up to 5 times every 15 seconds.
# Query will wait up to 60 seconds to confirm server is down giving server time if changing map.
totalseconds=0
for queryattempt in {1..5}; do
fn_print_dots "Querying port: ${querymethod}: ${ip}:${queryport} : ${totalseconds}/${queryattempt}: "
fn_print_querying_eol

Loading…
Cancel
Save