J'ai un souci avec un plugin que j'ai crée, je n'arrive pas à avoir des logs pour comprendre pourquoi mon graphique reste vide...
J'ai un plugin capable de générer deux graphiquies :
- ln -s /usr/share/munin/plugins/ubuntu_support_ /etc/munin/plugins/ubuntu_support_total => Statistiques des versions d’Ubuntu
- ln -s /usr/share/munin/plugins/ubuntu_support_ /etc/munin/plugins/ubuntu_support_percent => Répartition des versions d’Ubuntu
Le script munin va chercher des données qui sont dans un fichier .csv "Open data" qui est mis à jour chaque matin.
#!/bin/bash
# License: GPLv2
# Author: Vivien Guéant
FILE_STAT_NB=/home/ubuntu-archive/stats/open-data/consolidated_statistics_ubuntu-fr_nb.csv
FILE_STAT_PCT=/home/ubuntu-archive/stats/open-data/consolidated_statistics_ubuntu-fr_pct.csv
type=`cut -d "_" -f 2 <<< "$0"`
if [ "$1" == "config" ]
then
if [ "$type" = "total" ]
then # Separate computers
cat <<'EOF'
graph_title Statistiques des versions d’Ubuntu
graph_vlabel Nombre d’ordinateurs distincts
graph_category ubuntu
graph_args --base 1000 --upper-limit 100 -l 0
support.label Utilisateurs de versions d'Ubuntu pris en charge
support.min 0
support.type DERIVE
support.draw AREA
end.label end bps
end.min 0
end.type DERIVE
end.draw STACK
total.label Total bps
total.min 0
total.type DERIVE
total.draw LINE1
EOF
else # Percentage
cat <<'EOF'
graph_scale no
graph_title Répartition des versions d’Ubuntu
graph_vlabel Pourcentage des ordinateurs utilisant Ubuntu
graph_category ubuntu
graph_args --upper-limit 100 -l 0 -r
support.label % versions d'Ubuntu pris en charge
support.min 0
support.draw AREA
end.label end %
end.min 0
end.draw STACK
EOF
fi
else
if [ "$type" = "total" ]
then # Separate computers
echo "support.value `tail -n 1 $FILE_STAT_NB | cut -d ',' -f 4 | cut -d '"' -f 2`"
echo "end.value `tail -n 1 $FILE_STAT_NB | cut -d ',' -f 3 | cut -d '"' -f 2`"
echo "total.value `tail -n 1 $FILE_STAT_NB | cut -d ',' -f 2 | cut -d '"' -f 2`"
else # Percentage
echo "support.value `tail -n 1 $FILE_STAT_PCT | cut -d ',' -f 4 | cut -d '"' -f 2`"
echo "end.value `tail -n 1 $FILE_STAT_PCT | cut -d ',' -f 3 | cut -d '"' -f 2`"
fi
fi
Quand j’exécute à la main mes script, j'ai bien les bonnes données :
$ sudo munin-run ubuntu_support_total
support.value 672014
end.value 187919
total.value 859933
$ sudo munin-run ubuntu_support_percent
support.value 78.147
end.value 21.852
Coté graphique,
Celui sur les données sans pourcentage reste vide sans que je comprenne pourquoi.

Ceui sur les pourcetage est ok :
