1
0
Fork 0
mirror of https://github.com/munin-monitoring/contrib.git synced 2025-07-25 02:18:08 +00:00
Munin-Contrib/plugins/other/windows_domain
2011-12-18 15:10:38 +01:00

24 lines
605 B
Bash
Executable file

#!/bin/sh
# munin plugin to monitor the number of logged in users
# and the number of hosts they're spread across on a windows domain.
# uses output dump of "net sess" from the domain controller.
# (c) 2011 jon@jon.bpa.nu
#%# family=manual
SESSIONS="/srv/pub/kram/dud"
case $1 in
config)
cat <<CFG
graph_title windows domain
graph_vlabel users/hosts
graph_category network
users.label users
hosts.label hosts
CFG
exit 0;;
esac
tail -n+5 "$SESSIONS" | head -n-2 | awk '$2 ~ "[a-z]+" { ua[tolower($2)]; ha[$1] }
END{ print "users.value",length(ua);
print "hosts.value",length(ha) }'