Skip to content

Commit

Permalink
Transmit run time of checks
Browse files Browse the repository at this point in the history
  • Loading branch information
mortzu committed Jul 24, 2019
1 parent aae1c6a commit ffbedec
Show file tree
Hide file tree
Showing 4 changed files with 28 additions and 12 deletions.
10 changes: 7 additions & 3 deletions checks/addresses-nonroot.sh
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
# Set path to a save default
PATH="$(dirname "$0")/..:/usr/lib/gatemon:/usr/lib/nagios/plugins:/usr/lib/monitoring-plugins:/bin:/usr/bin:/sbin:/usr/sbin"

export TIMEFORMAT="%0R"
export TIMEFORMAT="%2R"
export LC_ALL=C

NETWORK_DEVICE="$1"
Expand Down Expand Up @@ -32,10 +32,14 @@ fi
exec 3>&- 4>&-

cat <<EOF
ipv4: ${STATUS_CODE}
ipv4:
status: ${STATUS_CODE}
time: ${ELAPSED_TIME}
EOF

# IPv6
cat <<EOF
ipv6: 0
ipv6:
status: 0
time: false
EOF
10 changes: 7 additions & 3 deletions checks/dns-nonroot.sh
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ else
exit 1
fi

export TIMEFORMAT="%0R"
export TIMEFORMAT="%2R"

NETWORK_DEVICE="$1"
SERVER_IP4="$2"
Expand Down Expand Up @@ -40,7 +40,9 @@ fi
exec 3>&- 4>&-

cat <<EOF
ipv4: ${STATUS_CODE}
ipv4:
status: ${STATUS_CODE}
time: ${ELAPSED_TIME}
EOF

# IPv6
Expand All @@ -55,5 +57,7 @@ fi
exec 3>&- 4>&-

cat <<EOF
ipv6: ${STATUS_CODE}
ipv6:
status: ${STATUS_CODE}
time: ${ELAPSED_TIME}
EOF
10 changes: 7 additions & 3 deletions checks/ntp-nonroot.sh
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ else
exit 1
fi

export TIMEFORMAT="%0R"
export TIMEFORMAT="%2R"

NETWORK_DEVICE="$1"
SERVER_IP4="$2"
Expand Down Expand Up @@ -40,7 +40,9 @@ fi
exec 3>&- 4>&-

cat <<EOF
ipv4: ${STATUS_CODE}
ipv4:
status: ${STATUS_CODE}
time: ${ELAPSED_TIME}
EOF

# IPv6
Expand All @@ -55,5 +57,7 @@ fi
exec 3>&- 4>&-

cat <<EOF
ipv6: ${STATUS_CODE}
ipv6:
status: ${STATUS_CODE}
time: ${ELAPSED_TIME}
EOF
10 changes: 7 additions & 3 deletions checks/uplink-nonroot.sh
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ else
exit 1
fi

export TIMEFORMAT="%0R"
export TIMEFORMAT="%2R"

NETWORK_DEVICE="$1"
SERVER_IP4="$2"
Expand Down Expand Up @@ -44,7 +44,9 @@ fi
exec 3>&- 4>&-

cat <<EOF
ipv4: ${STATUS_CODE}
ipv4:
status: ${STATUS_CODE}
time: ${ELAPSED_TIME}
EOF

# IPv6
Expand All @@ -59,5 +61,7 @@ fi
exec 3>&- 4>&-

cat <<EOF
ipv6: ${STATUS_CODE}
ipv6:
status: ${STATUS_CODE}
time: ${ELAPSED_TIME}
EOF

0 comments on commit ffbedec

Please sign in to comment.