From 2e6a0b9bc127baf9c0b9436ce9f088ab3d16f840 Mon Sep 17 00:00:00 2001 From: Cyberes Date: Sun, 25 Feb 2024 15:35:14 -0700 Subject: [PATCH] fix bsd and package name --- check_dns.sh | 6 +++--- packages.txt | 2 +- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/check_dns.sh b/check_dns.sh index 848c543..fcf2fa6 100755 --- a/check_dns.sh +++ b/check_dns.sh @@ -27,7 +27,7 @@ if [[ -z $query_domain && ${query_domain+x} ]]; then fi # Perform DNS resolution check and measure the time -start_time=$(date +%s%N) +start_time=$(date +%s) if [[ -z "$dns_server" ]]; then # The DNS server was not provided. @@ -37,8 +37,8 @@ else result=$(dig @$dns_server "$query_domain" +short) fi -end_time=$(date +%s%N) -response_time=$(((end_time - start_time) / 1000000)) +end_time=$(date +%s) +response_time=$((end_time - start_time)) perfdata="response_time=${response_time}ms;${warning_time};${critical_time};0;" # Check response time against warning and critical levels diff --git a/packages.txt b/packages.txt index ede148e..4ec3f62 100644 --- a/packages.txt +++ b/packages.txt @@ -6,4 +6,4 @@ smartmontools curl recode python3-pip -dig +dnsutils