munin:accueil

Différences

Ci-dessous, les différences entre deux révisions de la page.

Lien vers cette vue comparative

Les deux révisions précédentes Révision précédente
Prochaine révision
Révision précédente
munin:accueil [2023/12/30 18:01] – [Installation d'un nœud] add scripts for speedtest phswmunin:accueil [2024/12/25 12:48] (Version actuelle) – [Installation d'un nœud] fix formatting in du_ script phsw
Ligne 106: Ligne 106:
 echo "down.value $DOWNLOAD" echo "down.value $DOWNLOAD"
 echo "up.value $UPLOAD" echo "up.value $UPLOAD"
 +</file>
 +
 +
 +== Taille de dossiers ==
 +
 +<file bash du_>
 +#!/bin/bash
 +
 +: <<=cut
 +
 +=head1 NAME
 +
 +du - Size of directories
 +
 +=head1 CONFIGURATION
 +
 +Put this file in "/usr/local/share/munin/plugins/du_". Then, create a symbolic
 +link to this file called, for instance, "du_work". "work" will be the name of
 +the graph.
 +
 +The configuration should look like the following:
 +
 +[du_work]
 +    env.directories /path/to/dir1 /path/to/dir2
 +    env.prefix /path/to/
 +    env.critical 1073741824
 +
 +- "directories" contains a space-separated list of directories to report size of.
 +- "prefix" (optionnal) is the prefix of directories to hide in graph labels.
 +- "critical" (optionnal) is the critical size (in bytes) for all directories.
 +
 +=cut
 +
 +GRAPH_NAME=${0##*du_}
 +DIRECTORIES=${directories:-UNSET}
 +CRITICAL=${critical:-UNSET}
 +PREFIX=${prefix:-UNSET}
 +
 +
 +case $1 in
 +    config)
 +        echo "graph_title Directory size $GRAPH_NAME"
 +        echo "graph_category disk"
 +        echo "graph_args --base 1024 -l 0"
 +        echo "graph_vlabel Size"
 +        echo "graph_info Graph of size occupied by directories"
 +
 +        if [ "$DIRECTORIES" != "UNSET" ]; then
 +            for d in $DIRECTORIES
 +            do
 +                slug=$(echo $d | sed 's/\//_/g')
 +
 +                if [ "$PREFIX" != "UNSET" ]; then
 +                    echo "${slug}.label ${d#"$PREFIX"}"
 +                else
 +                    echo "${slug}.label $d"
 +                fi
 +                echo "${slug}.type GAUGE"
 +                echo "${slug}.draw LINE1"
 +
 +                if [ "$CRITICAL" != "UNSET" ]; then
 +                    echo "${slug}.critical $CRITICAL"
 +                fi
 +            done
 +        fi
 +
 +        exit 0;;
 +esac
 +
 +if [ "$DIRECTORIES" != "UNSET" ]; then
 +    for d in $DIRECTORIES
 +    do
 +        slug=$(echo $d | sed 's/\//_/g')
 +        echo "${slug}.value $(du -sb $d | cut -f 1)"
 +    done
 +fi
 </file> </file>
  
  • munin/accueil.1703955718.txt.gz
  • Dernière modification : 2023/12/30 18:01
  • de phsw