From deefb86c60034589a6ff08ec8c69573555409122 Mon Sep 17 00:00:00 2001 From: Jon Higgs Date: Tue, 17 Apr 2007 12:40:04 +0200 Subject: [PATCH] Initial version --- plugins/other/samba_users | 38 ++++++++++++++++++++++++++++++++++++++ 1 file changed, 38 insertions(+) create mode 100755 plugins/other/samba_users diff --git a/plugins/other/samba_users b/plugins/other/samba_users new file mode 100755 index 00000000..2730da8a --- /dev/null +++ b/plugins/other/samba_users @@ -0,0 +1,38 @@ +#!/bin/sh +# +# Plugin to monitor the number of Samba users on the machine. +# +# Parameters: +# +# config (required) +# autoconf (optional - used by munin-config) +# +# $Log$ +# Revision 1.0 2007/04/16 Jon Higgs +# Initial Release - Adapated from jimmyo's processses plugin. +# +# Magick markers (optional - used by munin-config and som installation +# scripts): +#%# family=auto +#%# capabilities=autoconf + +if [ "$1" = "autoconf" ]; then + echo yes + exit 0 +fi + +if [ "$1" = "config" ]; then + + echo 'graph_title Samba Users' + echo 'graph_args --base 1000 -l 0 ' + echo 'graph_vlabel number of Samba users.' + echo 'graph_category Samba' + echo 'graph_info This graph shows the number Samba users.' + echo 'samba_users.label Samba Users' + echo 'samba_users.draw LINE2' + echo 'samba_users.info The current number of Samba users.' + exit 0 +fi + +echo -n "samba_users.value " +smbstatus -b 2> /dev/null | grep -c -v -e "^Samba" -e "^---" -e "^PID" -e ^$