mirror of
https://github.com/munin-monitoring/contrib.git
synced 2025-07-25 02:18:08 +00:00
Plugin-Gallery: Better 2nd level headings
This commit is contained in:
parent
3a6fdce80f
commit
ae4e85ab60
13 changed files with 11 additions and 13 deletions
89
plugins/vpn/openvpn_as_traffic
Executable file
89
plugins/vpn/openvpn_as_traffic
Executable file
|
@ -0,0 +1,89 @@
|
|||
#!/bin/bash
|
||||
# -*- bash -*-
|
||||
|
||||
: << =cut
|
||||
|
||||
=head1 NAME
|
||||
|
||||
openvpn_as_traffic -OpenVPN traffic
|
||||
|
||||
=head1 CONFIGURATION
|
||||
|
||||
Require jsonpipe software:
|
||||
https://github.com/dvxhouse/jsonpipe
|
||||
|
||||
[openvpn_as*]
|
||||
user root
|
||||
|
||||
=head1 AUTHOR
|
||||
|
||||
Ricardo Fraile <rfrail3@yahoo.es>
|
||||
|
||||
=head1 LICENSE
|
||||
|
||||
GPLv2
|
||||
|
||||
=head1 MAGICK MARKERS
|
||||
|
||||
#%# family=auto
|
||||
#%# capabilities=autoconf
|
||||
|
||||
=cut
|
||||
|
||||
. $MUNIN_LIBDIR/plugins/plugin.sh
|
||||
|
||||
|
||||
# Script folder
|
||||
D_BIN="/usr/local/openvpn_as/scripts"
|
||||
SUM1=0
|
||||
SUM2=0
|
||||
NOW=`date +%s`
|
||||
|
||||
if [ "$1" = "autoconf" ]; then
|
||||
echo yes
|
||||
exit 0
|
||||
fi
|
||||
|
||||
if [ "$1" = "config" ]; then
|
||||
|
||||
echo "graph_title OpenVPN traffic"
|
||||
echo 'graph_args --base 1000'
|
||||
echo 'graph_vlabel Bytes in (-) / out (+)'
|
||||
echo 'graph_category network'
|
||||
echo "graph_info OpenVPN traffic"
|
||||
|
||||
|
||||
echo "down.label Bytes"
|
||||
echo "down.type DERIVE"
|
||||
echo "down.graph no"
|
||||
echo "down.cdef down,8,*"
|
||||
echo "down.min 0"
|
||||
|
||||
echo "up.label Bytes"
|
||||
echo "up.type DERIVE"
|
||||
echo "up.negative down"
|
||||
echo "up.cdef up,8,*"
|
||||
echo "up.info Bytes"
|
||||
echo "up.min 0"
|
||||
exit 0
|
||||
fi
|
||||
|
||||
# List users values, bytes sent
|
||||
LIST1=`$D_BIN/sacli VPNStatus | tr '/' - | jsonpipe | grep "/openvpn_[0-9]/client_list/[0-9]/4" | tr -d '"' | awk '{print $2} '`
|
||||
|
||||
# Sum list
|
||||
for i in $LIST1; do
|
||||
SUM1=`expr $SUM1 + $i`
|
||||
done
|
||||
|
||||
# List users values, bytes received
|
||||
LIST2=`$D_BIN/sacli VPNStatus | tr '/' - | jsonpipe | grep "/openvpn_[0-9]/client_list/[0-9]/3" | tr -d '"' | awk '{print $2} '`
|
||||
|
||||
# Sum list
|
||||
for i in $LIST2; do
|
||||
SUM2=`expr $SUM2 + $i`
|
||||
done
|
||||
|
||||
|
||||
echo "down.value $SUM1"
|
||||
echo "up.value $SUM2"
|
Loading…
Add table
Add a link
Reference in a new issue