mirror of
https://github.com/munin-monitoring/contrib.git
synced 2018-11-08 00:59:34 +01:00
Initial version
This commit is contained in:
parent
52a6d10bfe
commit
5d09d49499
1 changed files with 34 additions and 0 deletions
34
plugins/other/logins
Executable file
34
plugins/other/logins
Executable file
|
@ -0,0 +1,34 @@
|
||||||
|
#!/bin/sh
|
||||||
|
|
||||||
|
do_config() {
|
||||||
|
graph=( 2 # number of graphs.
|
||||||
|
label draw colour # graph setup
|
||||||
|
logins AREA 40ff40 # 1st graph setup data
|
||||||
|
users LINE2 ff0080 # 2nd graph setup data
|
||||||
|
)
|
||||||
|
|
||||||
|
cat << EOF
|
||||||
|
graph_title Users Online
|
||||||
|
graph_vlabel Number of users and logins
|
||||||
|
graph_category logins
|
||||||
|
graph_args --base 1000 -l 0
|
||||||
|
graph_scale no
|
||||||
|
EOF
|
||||||
|
|
||||||
|
# can go into an include file
|
||||||
|
labels=$((${#graph[*]}/(graph+1)))
|
||||||
|
for ((i=0; i<graph; i++)); do
|
||||||
|
for ((j=0; j<labels; j++)); do
|
||||||
|
conf=$((i*labels+labels+1))
|
||||||
|
echo "${graph[conf]}.${graph[j+1]} ${graph[conf+j]}"
|
||||||
|
done
|
||||||
|
done
|
||||||
|
}
|
||||||
|
|
||||||
|
do_fetch() {
|
||||||
|
echo "logins.value $(who | wc -l)"
|
||||||
|
echo "users.value $(who | sed 's/ .*//' | sort -u | wc -l)"
|
||||||
|
}
|
||||||
|
|
||||||
|
do_${1:-fetch}
|
||||||
|
exit 0
|
Loading…
Reference in a new issue