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 [2021/07/17 17:21] – [Installation d'un nœud] fix broken link phswmunin:accueil [2024/12/25 12:48] (Version actuelle) – [Installation d'un nœud] fix formatting in du_ script phsw
Ligne 21: Ligne 21:
 munin-node-configure munin-node-configure
 </code> </code>
-En rajoutant ''--suggest'', il est possible de savoir quels plugins il est pertinent d'activer et lesquels posent problème.+En rajoutant ''%%--%%suggest'', il est possible de savoir quels plugins il est pertinent d'activer et lesquels posent problème.
  
 L'activation d'un plugin se fait en faisant un lien symbolique de ''/usr/share/munin/plugins/<plugin>'' vers ''/etc/munin/plugins/'' L'activation d'un plugin se fait en faisant un lien symbolique de ''/usr/share/munin/plugins/<plugin>'' vers ''/etc/munin/plugins/''
Ligne 47: Ligne 47:
  
 == PiHole == == PiHole ==
-Plugin pour monitorer PiHole: [[https://github.com/Rauks/MuninPiholePlugins]]+Plugin pour monitorer PiHole: [[https://github.com/Rauks/MuninPiholePlugins]] mais préférer le fork [[https://github.com/RenWal/MuninPiholePlugins]] qui contient un graphe en plus. 
 + 
 +Il faut créer un token depuis l'interface d'administration de PiHole et l'utiliser : 
 +  * ''/admin/api.php?summary&auth=$envtoken'', il faut ensuite supprimer le séparateur des milliers : <code bash>stats=$(echo $apicall | sed 's/[{}"]//g' | sed -E "s/([0-9]),([0-9])/\1\2/g" | tr "," "\n")</code> 
 +  * ''/admin/api.php?getQueryTypes&auth=$envtoken''
  
  
 == Débit Internet == == Débit Internet ==
-Pour monitorer le débit de la connexion Internet: [[https://github.com/giovino/munin-speedtest-plugin]]+Pour monitorer le débit de la connexion Internet, utiliser l'outil de Ookla : https://www.speedtest.net/apps/cli. Il est ensuite possible de stocker le résultat de la commande suivante dans un fichier : 
 +<code bash> 
 +speedtest --accept-license --accept-gdpr --format=json-pretty 
 +</code> 
 +et ensuite utiliser les deux plugins suivants : 
 +<file bash latency> 
 +#!/bin/bash 
 + 
 +case $1 in 
 + config) 
 + echo "graph_category network" 
 + echo "graph_title Latency" 
 + echo "graph_args -l 0" 
 + echo "graph_vlabel ms" 
 + echo "graph_scale no" 
 + echo "latency.label Latency" 
 + echo "latency.type GAUGE" 
 + echo "latency.draw LINE1" 
 + echo "graph_info Graph of Internet Connection Latency" 
 + exit 0;; 
 +esac 
 + 
 +OUTPUT=$(jq .ping.latency speedtest.out) 
 + 
 +echo "latency.value $OUTPUT" 
 +</file> 
 +<file bash speedtest> 
 +#!/bin/bash 
 + 
 +case $1 in 
 + config) 
 + echo "graph_category network" 
 + echo "graph_title Speedtest" 
 + echo "graph_args --base 1000 -l 0" 
 + echo "graph_vlabel DL / UL" 
 + echo "graph_scale no" 
 + echo "down.label DL" 
 + echo "down.type GAUGE" 
 + echo "down.draw LINE1" 
 + echo "up.label UL" 
 + echo "up.type GAUGE" 
 + echo "up.draw LINE1" 
 + echo "graph_info Graph of Internet Connection Speed" 
 + exit 0;; 
 +esac 
 + 
 +DOWNLOAD=$(jq ".download.bandwidth*8/1e6" speedtest.out) 
 +UPLOAD=$(jq ".upload.bandwidth*8/1e6" speedtest.out) 
 + 
 +echo "down.value $DOWNLOAD" 
 +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>
  
  
  • munin/accueil.1626535300.txt.gz
  • Dernière modification : 2021/07/17 17:21
  • de phsw