1
0
Fork 0
mirror of https://github.com/munin-monitoring/contrib.git synced 2025-07-21 18:41:03 +00:00

Category Tree: Reduce number of categories

and mv some from "others" to specific category
This commit is contained in:
dipohl 2017-02-22 19:09:05 +01:00
parent cc3622d96c
commit 7042351e74
9 changed files with 12 additions and 10 deletions

79
plugins/freeradius/freeradius Executable file
View file

@ -0,0 +1,79 @@
#!/bin/sh
# This program is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation; either version 2 of the License, or
# (at your option) any later version.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with this program; if not, write to the Free Software
# Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
#
# Written by Daniele Albrizio <daniele@albrizio.dyndns.org> maj 2007
# Based upon Lasse Karstensen <lkarsten@hyse.org> june 2006 bash plugin foor the main structure and
# mike@gaertner.cc 2006 perl plugin for the "total requests graph" idea
#
####
# Shell plugin to graph the daily amount of per second or per minute freeradius login requests.
#
# Plugin Configuration for your munin plugins conf (/etc/munin/plugin-conf.d/munin-node in Debian)
#
# [freeradius]
# user <a user that can read freeradius logfiles>
# env.radius_log=/where/your/freeradius/log.is (if not set defaults to syslog)
# env.graph_period=<minute|second> (if not set defaults to second)
#
#
# Magic markers - optional - used by installation scripts and
# munin-config:
#
#%# family=manual
#%# capabilities=autoconf
if [ "$1" = "autoconf" ]; then
echo yes
exit 0
fi
if [ "$1" = "config" ]; then
echo 'graph_title freeradius requests'
echo 'graph_args --base 1000 -l 0 '
if [ -n ${graph_period} ]; then
echo 'graph_period '${graph_period}
fi
echo 'graph_vlabel requests / ${graph_period}'
echo 'graph_category auth'
echo 'requests.label Authentication requests'
echo 'requests.info freeRADIUS authentication requests'
echo 'requests.type DERIVE'
echo 'requests.min 0'
echo 'success.label Login OK'
echo 'success.info Successful freeRADIUS authentications'
echo 'success.type DERIVE'
echo 'success.min 0'
echo 'failed.label Login FAILED'
echo 'failed.info Failed freeRADIUS authentications'
echo 'failed.type DERIVE'
echo 'failed.min 0'
exit 0
fi
if [ -z ${radius_log} ]; then
echo -n "requests.value " && egrep "`date +%b\ %e`.*radiusd.*Login" /var/log/messages|wc -l
echo -n "success.value " && egrep "`date +%b\ %e`.*radiusd.*Login OK" /var/log/messages|wc -l
echo -n "failed.value " && egrep "`date +%b\ %e`.*radiusd.*Login incorrect" /var/log/messages|wc -l
else
echo -n "requests.value " && egrep "`date +%b\ %e`.*Login" ${radius_log}|wc -l
echo -n "success.value " && egrep "`date +%b\ %e`.*Login OK" ${radius_log}|wc -l
echo -n "failed.value " && egrep "`date +%b\ %e`.*Login incorrect" ${radius_log}|wc -l
fi

View file

@ -0,0 +1,103 @@
#!/bin/sh
: << =cut
=head1 NAME
freeradius_queue - Plugin to get number of waiting packets in FreeRADIUS queues
=head1 APPLICABLE SYSTEMS
FreeRADIUS 3.0.7 or later.
=head1 CONFIGURATION
This plugin uses the following configuration variables:
[freeradius_queue]
env.radmin - Path to "radmin" executable.
env.socketfile - Path to administration socket.
=head1 AUTHOR
Copyright (C) 2015 Arran Cudbard-Bell <a.cudbardb@freeradius.org>
=head1 LICENSE
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation; either version 2 of the License, or
(at your option) any later version.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with this program; if not, write to the Free Software
Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA
=head1 MAGIC MARKERS
#%# family=auto
#%# capabilities=autoconf
=cut
RADMIN=${radmin:-`which radmin 2>/dev/null`}
RADMIN=${RADMIN:-/usr/sbin/radmin}
SOCKETFILE=${socketfile:-/var/run/radiusd/radiusd.sock}
#
# Check we can execute radmin, and check that the stats queue
# command exists, and provides us with valid results.
#
# Note: Before 3.0.7 there was no separate communications channel
# for error codes or error messages, so radmin would always exit
# with 0, even on failure.
#
if [ "$1" = "autoconf" ]; then
if [ -x $RADMIN ] && $RADMIN -f $SOCKETFILE -e "stats queue" 2>/dev/null | grep 'queue_len' > /dev/null; then
echo yes
else
echo no
fi
exit 0
fi
if [ "$1" = "config" ]; then
echo 'graph_title FreeRADIUS queued packets'
echo 'graph_args --base 1000 -l 0 '
echo 'graph_period second'
echo 'graph_vlabel requests / ${graph_period}'
echo 'graph_category auth'
echo 'queue_len_internal.label Internal'
echo 'queue_len_internal.info number of requests waiting in the internal queue'
echo 'queue_len_internal.type DERIVE'
echo 'queue_len_internal.min 0'
echo 'queue_len_proxy.label Proxy'
echo 'queue_len_proxy.info number of requests waiting in the proxy queue'
echo 'queue_len_proxy.type DERIVE'
echo 'queue_len_proxy.min 0'
echo 'queue_len_auth.label Authentication'
echo 'queue_len_auth.info number of requests waiting in the authentication queue'
echo 'queue_len_auth.type DERIVE'
echo 'queue_len_auth.min 0'
echo 'queue_len_acct.label Accounting'
echo 'queue_len_acct.info number of requests waiting in the accounting queue'
echo 'queue_len_acct.type DERIVE'
echo 'queue_len_acct.min 0'
echo 'queue_len_detail.label Detail reader'
echo 'queue_len_detail.info number of requests waiting in the detail queue'
echo 'queue_len_detail.type DERIVE'
echo 'queue_len_detail.min 0'
exit 0
fi
$RADMIN -f $SOCKETFILE -e "stats queue" | grep 'queue_len*' | awk '{print $1".value " $2}'