mirror of
https://github.com/munin-monitoring/contrib.git
synced 2025-07-25 18:38:30 +00:00
dspam_ : fix parsing error when values are huge
This commit is contained in:
parent
24d12be42c
commit
ab55406619
1 changed files with 5 additions and 6 deletions
|
@ -234,23 +234,22 @@ update_statefile() {
|
||||||
|
|
||||||
debug starting $dspam_stats -t -S
|
debug starting $dspam_stats -t -S
|
||||||
local t_start=$(date +%s)
|
local t_start=$(date +%s)
|
||||||
$dspam_stats -t -S | while read a b c d e f g h i j k l m x; do
|
$dspam_stats -t -S | while IFS=' :' read a b c d e f g h i j k l m x; do
|
||||||
|
|
||||||
# example of output format (3.9.1 rc1) for each user:
|
# example of output format (3.9.1 rc1) for each user:
|
||||||
#username@example.org
|
#username@example.org
|
||||||
# TP: 0 TN: 2147 FP: 0 FN: 53 SC: 0 NC: 0
|
# TP: 0 TN: 2147 FP: 0 FN: 53 SC: 0 NC: 0
|
||||||
# SHR: 0.00% HSR: 0.00% OCA: 97.59%
|
# SHR: 0.00% HSR: 0.00% OCA: 97.59%
|
||||||
|
|
||||||
# or for short user names:
|
# or for short user names:
|
||||||
#vmail TP: 1141 TN: 459 FP: 0 FN: 5 SC: 0 NC: 0
|
#vmail TP:80312082 TN:198342928 FP: 82941 FN: 57326 SC: 0 NC: 3498
|
||||||
# SHR: 99.56% HSR: 0.00% OCA: 99.69%
|
# SHR: 99.56% HSR: 0.00% OCA: 99.69%
|
||||||
|
|
||||||
case $a in
|
case $a in
|
||||||
TP:)
|
TP)
|
||||||
# the 2nd line
|
# the 2nd line
|
||||||
local tp=$b tn=$d fp=$f fn=$h sc=$j nc=$l
|
local tp=$b tn=$d fp=$f fn=$h sc=$j nc=$l
|
||||||
;;
|
;;
|
||||||
SHR:)
|
SHR)
|
||||||
# the 3rd line
|
# the 3rd line
|
||||||
local shr=$(echo $b | sed 's/%$//g')
|
local shr=$(echo $b | sed 's/%$//g')
|
||||||
local hsr=$(echo $d | sed 's/%$//g')
|
local hsr=$(echo $d | sed 's/%$//g')
|
||||||
|
@ -267,7 +266,7 @@ update_statefile() {
|
||||||
# the 1st line
|
# the 1st line
|
||||||
local uid=$a
|
local uid=$a
|
||||||
# data from 2nd line is also here
|
# data from 2nd line is also here
|
||||||
[ "$b" = "TP:" ] && local tp=$c tn=$e fp=$g fn=$i sc=$k nc=$m
|
[ "$b" = "TP" ] && local tp=$c tn=$e fp=$g fn=$i sc=$k nc=$m
|
||||||
;;
|
;;
|
||||||
esac
|
esac
|
||||||
done
|
done
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue