1
0
Fork 0
mirror of https://github.com/munin-monitoring/contrib.git synced 2025-07-21 10:39:53 +00:00

Merge pull request #1464 from ap-wtioit/master-improve_bind9_plugins_github

bind9_*: update stat_file only if it's older than 4 minutes
This commit is contained in:
Kenyon Ralph 2024-12-04 10:47:52 -08:00 committed by GitHub
commit 8fe355e1d9
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
3 changed files with 39 additions and 12 deletions

View file

@ -26,11 +26,20 @@ if [ "$rndc" = "" ]; then
rndc="/usr/sbin/rndc"
fi
# Blank the stats file (else stats are appended not replaced)
rm ${stat_file}
# only renew stats if older than 4 minutes
if [ "$refresh_minutes" = "" ]; then
refresh_minutes=4
fi
# Ask to bind to build new one
${rndc} stats
if [ "$(find "$(dirname "$stat_file")" -mindepth 1 -maxdepth 1 -cmin -"$refresh_minutes" -name "$(basename "$stat_file")" )" == "" ] ; then
if [ -e "${stat_file}" ] ; then
# Blank the stats file (else stats are appended not replaced)
rm "${stat_file}"
fi
# Ask to bind to build new one
${rndc} stats
fi
# The section we are looking for in the stats.
section="Resolver Statistics"

View file

@ -26,11 +26,20 @@ if [ "$rndc" = "" ]; then
rndc="/usr/sbin/rndc"
fi
# Blank the stats file (else stats are appended not replaced)
rm ${stat_file}
# only renew stats if older than 4 minutes
if [ "$refresh_minutes" = "" ]; then
refresh_minutes=4
fi
# Ask to bind to build new one
${rndc} stats
if [ "$(find "$(dirname "$stat_file")" -mindepth 1 -maxdepth 1 -cmin -"$refresh_minutes" -name "$(basename "$stat_file")" )" == "" ] ; then
if [ -e "${stat_file}" ] ; then
# Blank the stats file (else stats are appended not replaced)
rm "${stat_file}"
fi
# Ask to bind to build new one
${rndc} stats
fi
# The section we are looking for in the stats.
section="Name Server Statistics"

View file

@ -26,11 +26,20 @@ if [ "$rndc" = "" ]; then
rndc="/usr/sbin/rndc"
fi
# Blank the stats file (else stats are appended not replaced)
rm ${stat_file}
# only renew stats if older than 4 minutes
if [ "$refresh_minutes" = "" ]; then
refresh_minutes=4
fi
# Ask to bind to build new one
${rndc} stats
if [ "$(find "$(dirname "$stat_file")" -mindepth 1 -maxdepth 1 -cmin -"$refresh_minutes" -name "$(basename "$stat_file")" )" == "" ] ; then
if [ -e "${stat_file}" ] ; then
# Blank the stats file (else stats are appended not replaced)
rm "${stat_file}"
fi
# Ask to bind to build new one
${rndc} stats
fi
# The section we are looking for in the stats.
section="Socket I/O Statistics"