Compare commits
No commits in common. "ed447579006f881fc9a81d900aecd17f8ae13962" and "f4365d32e5cf5a6fec9a0596f1da4ba75a000e5c" have entirely different histories.
ed44757900
...
f4365d32e5
@ -1 +1 @@
|
|||||||
1.8.8.F3,syntax fix
|
1.8.8.F2,no boolean for jq, it considers "false" as missing (null)
|
||||||
|
|||||||
@ -5,11 +5,12 @@
|
|||||||
# "users": ["oleg"],
|
# "users": ["oleg"],
|
||||||
# "type": "cloud",
|
# "type": "cloud",
|
||||||
# "ssh_port": 7822,
|
# "ssh_port": 7822,
|
||||||
# "to_check": "false"
|
# # "to_check": "false"
|
||||||
# "timeout_sec": 5
|
# "timeout_sec": 5
|
||||||
# },
|
# },
|
||||||
|
|
||||||
RootDir="${HOME}/prod"
|
RootDir="${HOME}/prod"
|
||||||
|
# RootDir=/home/oleg/develop/cvtt2 ###### D E B U G
|
||||||
|
|
||||||
AlertChannel=Alerts-CVTT
|
AlertChannel=Alerts-CVTT
|
||||||
Sender=${RootDir}/ops/utils/send_mmost.sh
|
Sender=${RootDir}/ops/utils/send_mmost.sh
|
||||||
@ -64,12 +65,11 @@ for Host in ${Hosts[@]} ; do
|
|||||||
Timeout=$(echo "$HOSTS_CONFIG" | jq -r --arg domain "$Domain" --arg host "$host" '.[$domain][$host].timeout_sec // '"$DEFAULT_TIMEOUT"'')
|
Timeout=$(echo "$HOSTS_CONFIG" | jq -r --arg domain "$Domain" --arg host "$host" '.[$domain][$host].timeout_sec // '"$DEFAULT_TIMEOUT"'')
|
||||||
|
|
||||||
ToCheck=$(echo "$HOSTS_CONFIG" | jq -r --arg domain "$Domain" --arg host "$host" '.[$domain][$host].to_check // '"$DEFAULT_TO_CHECK"'')
|
ToCheck=$(echo "$HOSTS_CONFIG" | jq -r --arg domain "$Domain" --arg host "$host" '.[$domain][$host].to_check // '"$DEFAULT_TO_CHECK"'')
|
||||||
to_check="${ToCheck^^}"
|
to_check="${ToCheck}^^"
|
||||||
if [ "${to_check}" == "TRUE" -o "${to_check}" == "YES" -o "${to_check}" == "Y" -o "${to_check}" == "T" ] ; then
|
if [ "${to_check}" != "TRUE" && "${to_check}" != "YES" && "${to_check}" != "Y" && "${to_check}" != "T" ]; then
|
||||||
echo "Checking host: $Host on port $PortSSH"
|
|
||||||
else
|
|
||||||
continue
|
continue
|
||||||
fi
|
fi
|
||||||
|
echo "Checking host: $Host on port $PortSSH"
|
||||||
|
|
||||||
# Use nc to check if the specified port is open
|
# Use nc to check if the specified port is open
|
||||||
if ! nc -z -w ${Timeout} "$Host" "$PortSSH"; then
|
if ! nc -z -w ${Timeout} "$Host" "$PortSSH"; then
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user