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
munin:accueil [2024/12/25 12:22] – [Installation d'un nœud] add du_ plugin phswmunin:accueil [2024/12/25 12:48] (Version actuelle) – [Installation d'un nœud] fix formatting in du_ script phsw
Ligne 109: Ligne 109:
  
  
-== Taille de dossiers+== Taille de dossiers ==
  
 <file bash du_> <file bash du_>
Ligne 122: Ligne 122:
 =head1 CONFIGURATION =head1 CONFIGURATION
  
-Put this file in `/usr/local/share/munin/plugins/du_`. Then, create a symbolic +Put this file in "/usr/local/share/munin/plugins/du_". Then, create a symbolic 
-link to this file called, for instance, `du_work``workwill be the name of+link to this file called, for instance, "du_work""workwill be the name of
 the graph. the graph.
  
 The configuration should look like the following: The configuration should look like the following:
-```+
 [du_work] [du_work]
     env.directories /path/to/dir1 /path/to/dir2     env.directories /path/to/dir1 /path/to/dir2
     env.prefix /path/to/     env.prefix /path/to/
     env.critical 1073741824     env.critical 1073741824
-``` + 
-`directoriescontains a space-separated list of directories to report size of. +"directoriescontains a space-separated list of directories to report size of. 
-`prefix(optionnal) is the prefix of directories to hide in graph labels. +"prefix(optionnal) is the prefix of directories to hide in graph labels. 
-`critical(optionnal) is the critical size (in bytes) for all directories.+"critical(optionnal) is the critical size (in bytes) for all directories.
  
 =cut =cut
Ligne 153: Ligne 153:
         echo "graph_info Graph of size occupied by directories"         echo "graph_info Graph of size occupied by directories"
  
-        for d in $DIRECTORIES +        if [ "$DIRECTORIES" != "UNSET" ]; then 
-        do +            for d in $DIRECTORIES 
-            slug=$(echo $d | sed 's/\//_/g')+            do 
 +                slug=$(echo $d | sed 's/\//_/g')
  
-            if [ "$PREFIX" != "UNSET" ]; then +                if [ "$PREFIX" != "UNSET" ]; then 
-                echo "${slug}.label ${d#"$PREFIX"}" +                    echo "${slug}.label ${d#"$PREFIX"}" 
-            else +                else 
-                echo "${slug}.label $d" +                    echo "${slug}.label $d" 
-            fi +                fi 
-            echo "${slug}.type GAUGE" +                echo "${slug}.type GAUGE" 
-            echo "${slug}.draw LINE1"+                echo "${slug}.draw LINE1"
  
-            if [ "$CRITICAL" != "UNSET" ]; then +                if [ "$CRITICAL" != "UNSET" ]; then 
-                echo "${slug}.critical $CRITICAL" +                    echo "${slug}.critical $CRITICAL" 
-            fi +                fi 
-        done+            done 
 +        fi
  
         exit 0;;         exit 0;;
 esac esac
  
-for d in $DIRECTORIES +if [ "$DIRECTORIES" != "UNSET" ]; then 
-do +    for d in $DIRECTORIES 
-    slug=$(echo $d | sed 's/\//_/g'+    do 
-    echo "${slug}.value $(du -sb $d | cut -f 1)" +        slug=$(echo $d | sed 's/\//_/g'
-done+        echo "${slug}.value $(du -sb $d | cut -f 1)" 
 +    done 
 +fi
 </file> </file>
  
  • munin/accueil.1735125736.txt.gz
  • Dernière modification : 2024/12/25 12:22
  • de phsw