2009-05-26 17:31:15 +02:00
|
|
|
#!/bin/sh
|
|
|
|
#
|
|
|
|
# Plugin to the number of subscribers to a EOC list.
|
|
|
|
#
|
|
|
|
# Copyright (C) 2009 - Julien Danjou <julien@danjou.info>
|
|
|
|
# Licensed under WTFPL
|
|
|
|
#
|
|
|
|
# Standard config options you may want to set:
|
|
|
|
# [eoc_*]
|
|
|
|
# user list
|
|
|
|
# env.HOME /var/list
|
|
|
|
#
|
|
|
|
# Magic markers - optional - used by installation scripts and
|
|
|
|
# munin-config:
|
|
|
|
#
|
|
|
|
#%# family=manual
|
|
|
|
#%# capabilities=autoconf
|
|
|
|
|
|
|
|
if [ "$1" = "autoconf" ]; then
|
2018-08-02 00:20:35 +02:00
|
|
|
echo yes
|
2009-05-26 17:31:15 +02:00
|
|
|
exit 0
|
|
|
|
fi
|
|
|
|
|
2018-08-02 00:20:35 +02:00
|
|
|
LISTNAME=$(basename "$0" | sed 's/^eoc_subscribers_count_//g' | tr '_' '@')
|
2009-05-26 17:31:15 +02:00
|
|
|
|
|
|
|
if [ "$1" = "config" ]; then
|
|
|
|
|
2018-08-02 00:20:35 +02:00
|
|
|
echo "graph_title Number of subscribers to ${LISTNAME}"
|
2009-05-26 17:31:15 +02:00
|
|
|
echo 'graph_vlabel subscribers'
|
|
|
|
echo 'graph_category mailinglist'
|
|
|
|
echo 'subscribers.label subscribers'
|
|
|
|
echo 'subscribers.draw AREA'
|
2018-08-02 00:20:35 +02:00
|
|
|
echo 'subscribers.info Number of subscribers to the list'
|
2009-05-26 17:31:15 +02:00
|
|
|
exit 0
|
|
|
|
fi
|
|
|
|
|
2018-08-02 00:20:35 +02:00
|
|
|
printf "subscribers.value %s" "$(enemies-of-carlotta --name "${LISTNAME}" --list | wc -l)"
|