NobGit
public nobgit read

NobMail

Based on mailcow: dockerized

Languages

Repository composition by tracked source files.

PHP
PHP 49% JavaScript 35% HTML 9% CSS 4% Shell 2% Python 1% Lua 0% Perl 0% Ruby 0% SCSS 0%
Create file Wiki Documentation
Clone
https://nobgit.com/orgs/nobgit/nobmail.git
ssh://[email protected]:2222/orgs/nobgit/nobmail.git

Trace

data/Dockerfiles/watchdog/check_dns.sh

Trace helps you understand code history line by line. See who changed each line, when it changed, and which commit introduced it.

check_dns.sh on main
Author Date Commit Line Code
maxi322 11 months ago 5e66ffa

watchdog: use dig instead of check_dns (#6685)

Full commit hash
5e66ffa36604e8c41bb23c7606ad951ed888b6b4
Author
maxi322 <[email protected]>
Date
11 months ago
Selected line
1
#!/bin/sh
Open commit View diff
1 #!/bin/sh
same change 5e66ffa

watchdog: use dig instead of check_dns (#6685)

Full commit hash
5e66ffa36604e8c41bb23c7606ad951ed888b6b4
Author
maxi322 <[email protected]>
Date
11 months ago
Selected line
2
Open commit View diff
2
same change 5e66ffa

watchdog: use dig instead of check_dns (#6685)

Full commit hash
5e66ffa36604e8c41bb23c7606ad951ed888b6b4
Author
maxi322 <[email protected]>
Date
11 months ago
Selected line
3
while getopts "H:s:" opt; do
Open commit View diff
3 while getopts "H:s:" opt; do
same change 5e66ffa

watchdog: use dig instead of check_dns (#6685)

Full commit hash
5e66ffa36604e8c41bb23c7606ad951ed888b6b4
Author
maxi322 <[email protected]>
Date
11 months ago
Selected line
4
  case "$opt" in
Open commit View diff
4 case "$opt" in
same change 5e66ffa

watchdog: use dig instead of check_dns (#6685)

Full commit hash
5e66ffa36604e8c41bb23c7606ad951ed888b6b4
Author
maxi322 <[email protected]>
Date
11 months ago
Selected line
5
    H) HOST="$OPTARG" ;;
Open commit View diff
5 H) HOST="$OPTARG" ;;
same change 5e66ffa

watchdog: use dig instead of check_dns (#6685)

Full commit hash
5e66ffa36604e8c41bb23c7606ad951ed888b6b4
Author
maxi322 <[email protected]>
Date
11 months ago
Selected line
6
    s) SERVER="$OPTARG" ;;
Open commit View diff
6 s) SERVER="$OPTARG" ;;
same change 5e66ffa

watchdog: use dig instead of check_dns (#6685)

Full commit hash
5e66ffa36604e8c41bb23c7606ad951ed888b6b4
Author
maxi322 <[email protected]>
Date
11 months ago
Selected line
7
    *) echo "Usage: $0 -H host -s server"; exit 3 ;;
Open commit View diff
7 *) echo "Usage: $0 -H host -s server"; exit 3 ;;
same change 5e66ffa

watchdog: use dig instead of check_dns (#6685)

Full commit hash
5e66ffa36604e8c41bb23c7606ad951ed888b6b4
Author
maxi322 <[email protected]>
Date
11 months ago
Selected line
8
  esac
Open commit View diff
8 esac
same change 5e66ffa

watchdog: use dig instead of check_dns (#6685)

Full commit hash
5e66ffa36604e8c41bb23c7606ad951ed888b6b4
Author
maxi322 <[email protected]>
Date
11 months ago
Selected line
9
done
Open commit View diff
9 done
same change 5e66ffa

watchdog: use dig instead of check_dns (#6685)

Full commit hash
5e66ffa36604e8c41bb23c7606ad951ed888b6b4
Author
maxi322 <[email protected]>
Date
11 months ago
Selected line
10
Open commit View diff
10
same change 5e66ffa

watchdog: use dig instead of check_dns (#6685)

Full commit hash
5e66ffa36604e8c41bb23c7606ad951ed888b6b4
Author
maxi322 <[email protected]>
Date
11 months ago
Selected line
11
if [ -z "$SERVER" ]; then
Open commit View diff
11 if [ -z "$SERVER" ]; then
same change 5e66ffa

watchdog: use dig instead of check_dns (#6685)

Full commit hash
5e66ffa36604e8c41bb23c7606ad951ed888b6b4
Author
maxi322 <[email protected]>
Date
11 months ago
Selected line
12
  echo "No DNS Server provided"
Open commit View diff
12 echo "No DNS Server provided"
same change 5e66ffa

watchdog: use dig instead of check_dns (#6685)

Full commit hash
5e66ffa36604e8c41bb23c7606ad951ed888b6b4
Author
maxi322 <[email protected]>
Date
11 months ago
Selected line
13
  exit 3
Open commit View diff
13 exit 3
same change 5e66ffa

watchdog: use dig instead of check_dns (#6685)

Full commit hash
5e66ffa36604e8c41bb23c7606ad951ed888b6b4
Author
maxi322 <[email protected]>
Date
11 months ago
Selected line
14
fi
Open commit View diff
14 fi
same change 5e66ffa

watchdog: use dig instead of check_dns (#6685)

Full commit hash
5e66ffa36604e8c41bb23c7606ad951ed888b6b4
Author
maxi322 <[email protected]>
Date
11 months ago
Selected line
15
Open commit View diff
15
same change 5e66ffa

watchdog: use dig instead of check_dns (#6685)

Full commit hash
5e66ffa36604e8c41bb23c7606ad951ed888b6b4
Author
maxi322 <[email protected]>
Date
11 months ago
Selected line
16
if [ -z "$HOST" ]; then
Open commit View diff
16 if [ -z "$HOST" ]; then
same change 5e66ffa

watchdog: use dig instead of check_dns (#6685)

Full commit hash
5e66ffa36604e8c41bb23c7606ad951ed888b6b4
Author
maxi322 <[email protected]>
Date
11 months ago
Selected line
17
  echo "No host to test provided"
Open commit View diff
17 echo "No host to test provided"
same change 5e66ffa

watchdog: use dig instead of check_dns (#6685)

Full commit hash
5e66ffa36604e8c41bb23c7606ad951ed888b6b4
Author
maxi322 <[email protected]>
Date
11 months ago
Selected line
18
  exit 3
Open commit View diff
18 exit 3
same change 5e66ffa

watchdog: use dig instead of check_dns (#6685)

Full commit hash
5e66ffa36604e8c41bb23c7606ad951ed888b6b4
Author
maxi322 <[email protected]>
Date
11 months ago
Selected line
19
fi
Open commit View diff
19 fi
same change 5e66ffa

watchdog: use dig instead of check_dns (#6685)

Full commit hash
5e66ffa36604e8c41bb23c7606ad951ed888b6b4
Author
maxi322 <[email protected]>
Date
11 months ago
Selected line
20
Open commit View diff
20
same change 5e66ffa

watchdog: use dig instead of check_dns (#6685)

Full commit hash
5e66ffa36604e8c41bb23c7606ad951ed888b6b4
Author
maxi322 <[email protected]>
Date
11 months ago
Selected line
21
# run dig and measure the time it takes to run
Open commit View diff
21 # run dig and measure the time it takes to run
maxi322 11 months ago 1c52eaa

check_dns: better time measurement

Full commit hash
1c52eaa3a4123f019154ad732077736169fc98a8
Author
maxi322 <[email protected]>
Date
11 months ago
Selected line
22
START_TIME=$(perl -MTime::HiRes -e 'print Time::HiRes::time')
Open commit View diff
22 START_TIME=$(perl -MTime::HiRes -e 'print Time::HiRes::time')
maxi322 11 months ago 5e66ffa

watchdog: use dig instead of check_dns (#6685)

Full commit hash
5e66ffa36604e8c41bb23c7606ad951ed888b6b4
Author
maxi322 <[email protected]>
Date
11 months ago
Selected line
23
dig_output=$(dig +short +timeout=2 +tries=1 "$HOST" @"$SERVER" 2>/dev/null)
Open commit View diff
23 dig_output=$(dig +short +timeout=2 +tries=1 "$HOST" @"$SERVER" 2>/dev/null)
same change 5e66ffa

watchdog: use dig instead of check_dns (#6685)

Full commit hash
5e66ffa36604e8c41bb23c7606ad951ed888b6b4
Author
maxi322 <[email protected]>
Date
11 months ago
Selected line
24
dig_rc=$?
Open commit View diff
24 dig_rc=$?
maxi322 11 months ago 1c52eaa

check_dns: better time measurement

Full commit hash
1c52eaa3a4123f019154ad732077736169fc98a8
Author
maxi322 <[email protected]>
Date
11 months ago
Selected line
25
END_TIME=$(perl -MTime::HiRes -e 'print Time::HiRes::time')
Open commit View diff
25 END_TIME=$(perl -MTime::HiRes -e 'print Time::HiRes::time')
maxi322 11 months ago 5e66ffa

watchdog: use dig instead of check_dns (#6685)

Full commit hash
5e66ffa36604e8c41bb23c7606ad951ed888b6b4
Author
maxi322 <[email protected]>
Date
11 months ago
Selected line
26
dig_output_ips=$(echo "$dig_output" | grep -E '^[0-9.]+$' | sort | paste -sd ',' -)
Open commit View diff
26 dig_output_ips=$(echo "$dig_output" | grep -E '^[0-9.]+$' | sort | paste -sd ',' -)
maxi322 11 months ago 1c52eaa

check_dns: better time measurement

Full commit hash
1c52eaa3a4123f019154ad732077736169fc98a8
Author
maxi322 <[email protected]>
Date
11 months ago
Selected line
27
ELAPSED_TIME=$(perl -e "printf('%.3f', $END_TIME - $START_TIME)")
Open commit View diff
27 ELAPSED_TIME=$(perl -e "printf('%.3f', $END_TIME - $START_TIME)")
maxi322 11 months ago 5e66ffa

watchdog: use dig instead of check_dns (#6685)

Full commit hash
5e66ffa36604e8c41bb23c7606ad951ed888b6b4
Author
maxi322 <[email protected]>
Date
11 months ago
Selected line
28
Open commit View diff
28
same change 5e66ffa

watchdog: use dig instead of check_dns (#6685)

Full commit hash
5e66ffa36604e8c41bb23c7606ad951ed888b6b4
Author
maxi322 <[email protected]>
Date
11 months ago
Selected line
29
# validate and perform nagios like output and exit codes
Open commit View diff
29 # validate and perform nagios like output and exit codes
same change 5e66ffa

watchdog: use dig instead of check_dns (#6685)

Full commit hash
5e66ffa36604e8c41bb23c7606ad951ed888b6b4
Author
maxi322 <[email protected]>
Date
11 months ago
Selected line
30
if [ $dig_rc -ne 0 ] || [ -z "$dig_output" ]; then
Open commit View diff
30 if [ $dig_rc -ne 0 ] || [ -z "$dig_output" ]; then
same change 5e66ffa

watchdog: use dig instead of check_dns (#6685)

Full commit hash
5e66ffa36604e8c41bb23c7606ad951ed888b6b4
Author
maxi322 <[email protected]>
Date
11 months ago
Selected line
31
  echo "Domain $HOST was not found by the server"
Open commit View diff
31 echo "Domain $HOST was not found by the server"
same change 5e66ffa

watchdog: use dig instead of check_dns (#6685)

Full commit hash
5e66ffa36604e8c41bb23c7606ad951ed888b6b4
Author
maxi322 <[email protected]>
Date
11 months ago
Selected line
32
  exit 2
Open commit View diff
32 exit 2
same change 5e66ffa

watchdog: use dig instead of check_dns (#6685)

Full commit hash
5e66ffa36604e8c41bb23c7606ad951ed888b6b4
Author
maxi322 <[email protected]>
Date
11 months ago
Selected line
33
elif [ $dig_rc -eq 0 ]; then
Open commit View diff
33 elif [ $dig_rc -eq 0 ]; then
maxi322 11 months ago 1c52eaa

check_dns: better time measurement

Full commit hash
1c52eaa3a4123f019154ad732077736169fc98a8
Author
maxi322 <[email protected]>
Date
11 months ago
Selected line
34
  echo "DNS OK: $ELAPSED_TIME seconds response time. $HOST returns $dig_output_ips"
Open commit View diff
34 echo "DNS OK: $ELAPSED_TIME seconds response time. $HOST returns $dig_output_ips"
maxi322 11 months ago 5e66ffa

watchdog: use dig instead of check_dns (#6685)

Full commit hash
5e66ffa36604e8c41bb23c7606ad951ed888b6b4
Author
maxi322 <[email protected]>
Date
11 months ago
Selected line
35
  exit 0
Open commit View diff
35 exit 0
same change 5e66ffa

watchdog: use dig instead of check_dns (#6685)

Full commit hash
5e66ffa36604e8c41bb23c7606ad951ed888b6b4
Author
maxi322 <[email protected]>
Date
11 months ago
Selected line
36
else
Open commit View diff
36 else
same change 5e66ffa

watchdog: use dig instead of check_dns (#6685)

Full commit hash
5e66ffa36604e8c41bb23c7606ad951ed888b6b4
Author
maxi322 <[email protected]>
Date
11 months ago
Selected line
37
  echo "Unknown error"
Open commit View diff
37 echo "Unknown error"
same change 5e66ffa

watchdog: use dig instead of check_dns (#6685)

Full commit hash
5e66ffa36604e8c41bb23c7606ad951ed888b6b4
Author
maxi322 <[email protected]>
Date
11 months ago
Selected line
38
  exit 3
Open commit View diff
38 exit 3
same change 5e66ffa

watchdog: use dig instead of check_dns (#6685)

Full commit hash
5e66ffa36604e8c41bb23c7606ad951ed888b6b4
Author
maxi322 <[email protected]>
Date
11 months ago
Selected line
39
fi
Open commit View diff
39 fi