Search Exchange
Search All Sites
Nagios Live Webinars
Let our experts show you how Nagios can help your organization.Login
Directory Tree
Directory
sergeiadmin
bysergeiadmin, November 9, 2021
Just my +2 Cents. The script doesnt' truncate the stats file from rndc stats command. As result after several years I noticed that /var/named/data/named_stats.txt increased to 1,5G and when the script within icinga tries to run this script it take about 2 minutes before tac command load all the file into the memory to perform awk action. Of course icinga tries to kill the script after 60 seconds timeout and produces error. I have modified a script a little a bit, so the named statistics file will be purged everytime after check_bind.sh is executed:
[root@dns2 ~]# diff -u /usr/lib64/nagios/plugins/site/privileged/check_bind.sh ./check_bind.sh
--- /usr/lib64/nagios/plugins/site/privileged/check_bind.sh 2021-11-08 15:20:32.365380038 +0100
+++ ./check_bind.sh 2021-11-09 13:44:52.301734327 +0100
@@ -143,6 +143,7 @@
then
sudo chroot $path_chroot $path_rndc/rndc stats
else
+ test -f $path_stats/named_stats.txt && truncate --size 0 $path_stats/named_stats.txt
sudo $path_rndc/rndc stats
fi
}
[root@dns2 ~]# diff -u /usr/lib64/nagios/plugins/site/privileged/check_bind.sh ./check_bind.sh
--- /usr/lib64/nagios/plugins/site/privileged/check_bind.sh 2021-11-08 15:20:32.365380038 +0100
+++ ./check_bind.sh 2021-11-09 13:44:52.301734327 +0100
@@ -143,6 +143,7 @@
then
sudo chroot $path_chroot $path_rndc/rndc stats
else
+ test -f $path_stats/named_stats.txt && truncate --size 0 $path_stats/named_stats.txt
sudo $path_rndc/rndc stats
fi
}