mirror of
https://github.com/munin-monitoring/contrib.git
synced 2018-11-08 00:59:34 +01:00
nginx_error: add support for 'dirty config' capability
This commit is contained in:
parent
0e864944d7
commit
7ed71b441d
1 changed files with 13 additions and 6 deletions
|
@ -49,6 +49,7 @@ None known.
|
||||||
=head1 VERSION
|
=head1 VERSION
|
||||||
|
|
||||||
1.1 - 2018/01/20
|
1.1 - 2018/01/20
|
||||||
|
* add 'dirty config' capability support
|
||||||
* fix shell style issues reported by shellcheck
|
* fix shell style issues reported by shellcheck
|
||||||
* improve readability of symlink configuration code
|
* improve readability of symlink configuration code
|
||||||
|
|
||||||
|
@ -102,7 +103,7 @@ http_codes[503]='Service Unavailable'
|
||||||
|
|
||||||
|
|
||||||
# parse error counts from log file
|
# parse error counts from log file
|
||||||
do_ () {
|
do_fetch () {
|
||||||
local count status_code
|
local count status_code
|
||||||
declare -A line_counts
|
declare -A line_counts
|
||||||
while read -r count status_code; do
|
while read -r count status_code; do
|
||||||
|
@ -112,7 +113,6 @@ do_ () {
|
||||||
for status_code in "${!http_codes[@]}"; do
|
for status_code in "${!http_codes[@]}"; do
|
||||||
echo "error${status_code}.value ${line_counts[$status_code]:-0}"
|
echo "error${status_code}.value ${line_counts[$status_code]:-0}"
|
||||||
done
|
done
|
||||||
exit 0
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
@ -128,19 +128,26 @@ do_config () {
|
||||||
echo "error${status_code}.min 0"
|
echo "error${status_code}.min 0"
|
||||||
echo "error${status_code}.label $status_code ${http_codes[$status_code]}"
|
echo "error${status_code}.label $status_code ${http_codes[$status_code]}"
|
||||||
done
|
done
|
||||||
exit 0
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
do_autoconf () {
|
do_autoconf () {
|
||||||
echo yes
|
echo yes
|
||||||
exit 0
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
case $1 in
|
case $1 in
|
||||||
config|autoconf|'')
|
config)
|
||||||
eval "do_$1"
|
do_config
|
||||||
|
# support "dirty config" capability
|
||||||
|
if [ "${MUNIN_CAP_DIRTYCONFIG:-}" = "1" ]; then do_fetch; fi
|
||||||
|
;;
|
||||||
|
autoconf)
|
||||||
|
do_autoconf
|
||||||
|
;;
|
||||||
|
'')
|
||||||
|
do_fetch
|
||||||
|
;;
|
||||||
esac
|
esac
|
||||||
|
|
||||||
exit $?
|
exit $?
|
||||||
|
|
Loading…
Reference in a new issue