Skip to content

Commit

Permalink
feat(monitor): add udp query option (#2314)
Browse files Browse the repository at this point in the history
  • Loading branch information
dgibbs64 committed Apr 27, 2019
1 parent 9a906b0 commit 1ba0cd7
Showing 1 changed file with 8 additions and 0 deletions.
8 changes: 8 additions & 0 deletions lgsm/functions/command_monitor.sh
Expand Up @@ -30,6 +30,9 @@ for queryattempt in {1..5}; do
elif [ "${querymethod}" == "tcp" ]; then
bash -c 'exec 3<> /dev/tcp/'${ip}'/'${queryport}''
querystatus="$?"
elif [ "${querymethod}" == "udp" ]; then
bash -c 'exec 3<> /dev/udp/'${ip}'/'${queryport}''
querystatus="$?"
fi

if [ "${querystatus}" == "0" ]; then
Expand Down Expand Up @@ -175,6 +178,11 @@ fn_monitor_query_tcp(){
fn_monitor_loop
}

fn_monitor_query_upd(){
querymethod="upd"
fn_monitor_loop
}

monitorflag=1
fn_print_dots "${servername}"
sleep 0.5
Expand Down

0 comments on commit 1ba0cd7

Please sign in to comment.