From 4224fa69ec135ec9b818eac02dbca3d3256189aa Mon Sep 17 00:00:00 2001 From: Vincent Le Gallic Date: Sun, 3 Mar 2013 08:12:08 +0100 Subject: [PATCH] =?UTF-8?q?[munin/who]=20Un=20plugin=20munin=20esseul?= =?UTF-8?q?=C3=A9?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- munin/who | 21 +++++++++++++++++++++ 1 file changed, 21 insertions(+) create mode 100755 munin/who 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 + +