mirror of
https://github.com/munin-monitoring/contrib.git
synced 2025-07-21 10:39:53 +00:00
bind9_*: update stat_file only if it's older than 4 minutes
This commit is contained in:
parent
8fa02efe0a
commit
eb6ce54e07
3 changed files with 39 additions and 12 deletions
|
@ -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"
|
||||
|
|
|
@ -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"
|
||||
|
|
|
@ -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"
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue