mirror of
https://github.com/munin-monitoring/contrib.git
synced 2018-11-08 00:59:34 +01:00
Merge pull request #404 from whyscream/dspam-fixes
Minor fixes for dspam_ plugin
This commit is contained in:
commit
f29162ba0b
@ -234,13 +234,17 @@ update_statefile() {
|
||||
|
||||
debug starting $dspam_stats -t -S
|
||||
local t_start=$(date +%s)
|
||||
$dspam_stats -t -S | while read a b c d e f g h i j k l x; do
|
||||
$dspam_stats -t -S | while 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:
|
||||
#username@example.org
|
||||
# TP: 0 TN: 2147 FP: 0 FN: 53 SC: 0 NC: 0
|
||||
# SHR: 0.00% HSR: 0.00% OCA: 97.59%
|
||||
|
||||
# or for short user names:
|
||||
#vmail TP: 1141 TN: 459 FP: 0 FN: 5 SC: 0 NC: 0
|
||||
# SHR: 99.56% HSR: 0.00% OCA: 99.69%
|
||||
|
||||
case $a in
|
||||
TP:)
|
||||
# the 2nd line
|
||||
@ -262,6 +266,8 @@ update_statefile() {
|
||||
*)
|
||||
# the 1st line
|
||||
local uid=$a
|
||||
# data from 2nd line is also here
|
||||
[ "$b" = "TP:" ] && local tp=$c tn=$e fp=$g fn=$i sc=$k nc=$m
|
||||
;;
|
||||
esac
|
||||
done
|
||||
@ -495,7 +501,7 @@ print_fetch() {
|
||||
if [ -n "$pattern" ]; then
|
||||
debug env.pattern was set, so use it: $pattern
|
||||
continue
|
||||
elif [ $target == "ALL" ]; then
|
||||
elif [ $target = "ALL" ]; then
|
||||
local pattern="-v TOTAL"
|
||||
debug target=ALL: need pattern for all users, but not for TOTAL: $pattern
|
||||
else
|
||||
|
@ -175,8 +175,8 @@ print_config() {
|
||||
echo graph_period minute
|
||||
|
||||
for activity in I S W V O A M F N C; do
|
||||
local label=$(get_activity_description $activity short)
|
||||
local info=$(get_activity_description $activity long)
|
||||
local label="$(get_activity_description $activity short)"
|
||||
local info="$(get_activity_description $activity long)"
|
||||
echo $activity.label $label
|
||||
echo $activity.info $info
|
||||
echo $activity.draw AREASTACK
|
||||
|
Loading…
Reference in New Issue
Block a user