diff --git a/munin/who b/munin/who new file mode 100755 index 00000000..f0b132a9 --- /dev/null +++ b/munin/who @@ -0,0 +1,21 @@ +#!/bin/zsh + +# Monitoring du nombre de sessions ssh ouvertes +# sur la machine + +if [ "$1" = "autoconfig" ]; then + echo "yes" +elif [ "$1" = "config" ]; then + echo "graph_title Connexions ssh" + echo "graph_args --base 1000 -l 0" + echo "total.label Nombre de connexions ouvertes" + echo "total.draw AREA" + echo "uniq.label Nombre de personnes connectés" + echo "uniq.draw AREA" +else + who=$(/usr/bin/who | cut -d' ' -f1) + echo "total.value $(echo $who | wc -l)" + echo "uniq.value $(echo $who | sort | uniq | wc -l)" +fi + +