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

Whitespace cleanup

* remove trailing whitespace
* remove empty lines at the end of files
This commit is contained in:
Lars Kruse 2018-08-02 02:03:42 +02:00
parent ef851f0c34
commit 17f784270a
604 changed files with 2927 additions and 2945 deletions

View file

@ -18,7 +18,7 @@ bandwidth_<interface> to this file. E.g.
Most likely usage is to monitor an interface connected to your ISP.
The suggest option will try and determine if you have any interfaces with a
The suggest option will try and determine if you have any interfaces with a
public IP and if so it will suggest monitoring those interfaces. If all
IP addresses are private the setup will have to be done manually. Suggest
does not handle IPv6 addresses.
@ -192,12 +192,12 @@ EOM
}
sub read_traffic {
open( my $rx, "<", "/sys/class/net/$interface/statistics/rx_bytes" )
open( my $rx, "<", "/sys/class/net/$interface/statistics/rx_bytes" )
|| die "Unable to read: $!";
$counter_input = <$rx>;
chomp $counter_input;
close($rx);
open(my $tx , "<", "/sys/class/net/$interface/statistics/tx_bytes" )
open(my $tx , "<", "/sys/class/net/$interface/statistics/tx_bytes" )
|| die "Unable to read: $!";
$counter_output = <$tx>;
chomp $counter_output;
@ -231,7 +231,7 @@ sub update_stats {
else {
if ( $perf_ref->{last}->{counter_input} > $counter_input ) {
$input =
$counter_input
$counter_input
+ $rollover
- $perf_ref->{last}->{counter_input};
}
@ -240,7 +240,7 @@ sub update_stats {
}
if ( $perf_ref->{last}->{counter_output} > $counter_output ) {
$output =
$counter_output
$counter_output
+ $rollover
- $perf_ref->{last}->{counter_output};
}

View file

@ -1,7 +1,7 @@
#!/bin/sh
# bgpd.sh
#
#
#
# Created by spleen.

View file

@ -6,7 +6,7 @@
# NOTE: NEEDS NON FREE UTILITY "wl"
# Configuration:
# [brc_rssi]
# env.WIFISIDE eth0 # Set the WiFi side interface. Used to filter arp entries.
# env.WIFISIDE eth0 # Set the WiFi side interface. Used to filter arp entries.
# # On a openwrt box defaults to "nvram get lan_ifname" otherwise
# # no default.
#
@ -58,7 +58,7 @@ EOF
m=$(echo $M | tr -d ':')
LABEL=$M
NAME=''
IP=$(echo "$ETHERS" | awk '/^'$M'/ { print $2; }')
case $IP in
'') :;;

View file

@ -5,7 +5,7 @@
# The base frame is copied from the proftp plugin
#
##########################################################################################
# Folgende Eintraege in der Datei /etc/munin/plugin-conf.d/munin-node nicht vergessen ! #
# Folgende Eintraege in der Datei /etc/munin/plugin-conf.d/munin-node nicht vergessen ! #
# Don't forget to add following lines to the file /etc/munin/plugin-conf.d/munin-node #
# [quota] #
# user root #
@ -50,7 +50,7 @@ fi
# Zeitfenster vergroessert werden resize the reference periode
if [ "${1//[^[:digit:]]}" != "" ]; then
factor=${1//[^[:digit:]]}
else
else
factor=1
fi
@ -77,10 +77,10 @@ fi
# Nur zum Testen - for testing ony
if [ "$factor" -gt 1 ]; then
echo "======================== Nur fuer Testzwecke ======================"
echo "======================== Nur fuer Testzwecke ======================"
echo "Timestamp :" $Timestamp $(date -d "1970-01-01 UTC + $Timestamp seconds")
echo "Ref_Timestamp:" $Ref_Timestamp $(date -d "1970-01-01 UTC + $Ref_Timestamp seconds")
echo "Zeitfenster :" $((Timeslot/60)) Minuten
echo "Zeitfenster :" $((Timeslot/60)) Minuten
echo "Last_update :" $Last_update $(date -d "1970-01-01 UTC + $Last_update seconds")
echo "======================== for testing only ======================"
echo "======================== for testing only ======================"
fi

View file

@ -1,6 +1,6 @@
#!/bin/bash
#
# Plugin to monitor the number of hosts denied by DenyHosts
# Plugin to monitor the number of hosts denied by DenyHosts
#
# $Log$
# Revision 1.0 2009/06/05 16:00:00 tjansson

View file

@ -68,7 +68,7 @@
# For autoconfiguration you'll also need the following Perl module:
#
# Proc::ProcessTable - Perl extension to access the unix process table
# http://search.cpan.org/perldoc?Proc::ProcessTable
# http://search.cpan.org/perldoc?Proc::ProcessTable
#
# On a Debian/Ubuntu system you can install this with the following command
# (if APT is configured properly):
@ -213,7 +213,7 @@ if ( !( ( $usenetstat eq "yes" and defined($fmshost) and defined($fmsport) ) or
# 2. Look for the FMS config file in ${FMS_DIR}/conf/fms.ini.
# 3. Fetch host, port, admin username and password values from the
# config file.
# check that plugin is running with root privileges
if ( $> == 0 ) {
my $ProcTable = new Proc::ProcessTable;

View file

@ -11,7 +11,7 @@
#
# libwww-perl (LWP) Perl library
# Proc::ProcessTable Perl module
#
#
# Tested with:
# Debian Etch
# Macromedia Flash Media Server 2.0.3 r68
@ -32,7 +32,7 @@
# http://search.cpan.org/perldoc?LWP
#
# Proc::ProcessTable - Perl extension to access the unix process table
# http://search.cpan.org/perldoc?Proc::ProcessTable
# http://search.cpan.org/perldoc?Proc::ProcessTable
#
# On a Debian/Ubuntu system:
# apt-get install libwww-perl libproc-process-perl
@ -150,7 +150,7 @@ if ( !( defined($host) and defined($port) and defined($username) and defined($pa
# 2. Look for the FMS config file in ${FMS_DIR}/conf/fms.ini.
# 3. Fetch host, port, admin username and password values from the
# config file.
# check that plugin is running with root privileges
if ( $> == 0 ) {
my $ProcTable = new Proc::ProcessTable;

View file

@ -12,7 +12,7 @@
#
# libwww-perl (LWP) Perl library
# Proc::ProcessTable Perl module
#
#
# Tested with:
# Debian Etch
# Macromedia Flash Media Server 2.0.3 r68
@ -33,7 +33,7 @@
# http://search.cpan.org/perldoc?LWP
#
# Proc::ProcessTable - Perl extension to access the unix process table
# http://search.cpan.org/perldoc?Proc::ProcessTable
# http://search.cpan.org/perldoc?Proc::ProcessTable
#
# On a Debian/Ubuntu system:
# apt-get install libwww-perl libproc-process-perl
@ -151,7 +151,7 @@ if ( !( defined($host) and defined($port) and defined($username) and defined($pa
# 2. Look for the FMS config file in ${FMS_DIR}/conf/fms.ini.
# 3. Fetch host, port, admin username and password values from the
# config file.
# check that plugin is running with root privileges
if ( $> == 0 ) {
my $ProcTable = new Proc::ProcessTable;

View file

@ -10,10 +10,10 @@
# Additionally, you need Accountingrules in fwbuilder
# fwbuilder creates Chains in INPUT-, OUTPUT- and FORWARD-Chain
# with Rules that "RETURN"
# You will have to specify rule options with name "ACCOUNTING" for the
# You will have to specify rule options with name "ACCOUNTING" for the
# rules to use, otherwise no rules will be found.
# try "fwbuilder_ suggest" to see if all is ok.
#
# try "fwbuilder_ suggest" to see if all is ok.
#
#
# Furthermore, this plugin needs to be run as root for iptables to work
#
@ -95,7 +95,7 @@ if [ "$1" = "config" ]; then
echo 'in.label received'
echo 'in.type DERIVE'
echo 'in.min 0'
echo 'in.cdef in,8,*'
echo 'in.cdef in,8,*'
exit 0
fi;

View file

@ -11,7 +11,7 @@
# http://www.elessar.one.pl/article_munin.php
#
###
# Written by Rafal Rajs
# Written by Rafal Rajs
# Date: 2007/06/19
# Email: elessar1@poczta.wp.pl
# WWW: http://www.elessar.one.pl

View file

@ -11,7 +11,7 @@
# http://www.elessar.one.pl/article_munin.php
#
###
# Written by Rafal Rajs
# Written by Rafal Rajs
# Date: 2007/06/19
# Email: elessar1@poczta.wp.pl
# WWW: http://www.elessar.one.pl

View file

@ -2,7 +2,7 @@
#
# Plugin to monitor the number of hosts in /etc/hosts.deny
# that are deined access to sshd
#
#
# Based on denyhosts plugin by tjansson (2009)
#
# Copyright (C) 2009 Kåre Hartvig Jensen (kaare.hartvig.jensen@gmail.com)
@ -13,7 +13,7 @@
# (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
# 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.
#

View file

@ -89,20 +89,20 @@ my $graphs =
'per_if_fields' => [qw(rx_bytes tx_bytes)],
'general_fields' => [qw(rx_bytes tx_bytes)]
},
'if_packets' =>
'if_packets' =>
{
'munin' =>
{
'category' => 'network',
'args' => '--base 1000',
'title' => ':if: traffic, packets',
'title' => ':if: traffic, packets',
'vlabel' => 'Packets in (-) / out (+), avg. per second',
'info' => 'This graph shows the traffic in packets of the :if:, averaged value per second from last update'
},
'per_if_fields' => [qw(rx_packets tx_packets rx_compressed tx_compressed rx_dropped tx_dropped multicast)],
'general_fields' => [qw(rx_packets tx_packets)]
},
'if_errors' =>
'if_errors' =>
{
'munin' =>
{
@ -199,12 +199,12 @@ my $graphs =
# {
# 'type' - types:
# 'percent',
# 'full' =>
# 'full' =>
# {
# 'source' => 'interface',
# 'name' => 'bps'
# },
# 'part' =>
# 'part' =>
# {
# 'source' => 'field',
# 'name' => 'tx_bytes'
@ -262,7 +262,7 @@ my $fields =
'difference' => 'count'
},
# --------------------------------------------------------------------------
'multicast' =>
'multicast' =>
{
'munin' =>
{
@ -284,8 +284,8 @@ my $fields =
'difference' => 'per_secund'
},
# --------------------------------------------------------------------------
'rx_bytes' =>
{
'rx_bytes' =>
{
'munin' =>
{
'type' => 'GAUGE',
@ -335,9 +335,9 @@ my $fields =
{
'munin' =>
{
'type' => 'GAUGE',
'draw' => 'LINE1',
'label' => 'CRC errors' ,
'type' => 'GAUGE',
'draw' => 'LINE1',
'label' => 'CRC errors' ,
'info' => 'CRC errors'
},
'source' =>
@ -774,12 +774,12 @@ my $fields =
'calculated' =>
{
'type' => 'percent',
'full' =>
'full' =>
{
'source' => 'interface',
'name' => 'bps'
},
'part' =>
'part' =>
{
'source' => 'field',
'name' => 'rx_bytes'
@ -809,12 +809,12 @@ my $fields =
'calculated' =>
{
'type' => 'percent',
'full' =>
'full' =>
{
'source' => 'interface',
'name' => 'bps'
},
'part' =>
'part' =>
{
'source' => 'field',
'name' => 'tx_bytes'
@ -889,7 +889,7 @@ my $fields =
'peack_protect' => 'packet_size_range'
},
# --------------------------------------------------------------------------
'retries' =>
'retries' =>
{
'munin' =>
{
@ -906,7 +906,7 @@ my $fields =
'difference' => 'count'
},
# --------------------------------------------------------------------------
'nwid' =>
'nwid' =>
{
'munin' =>
{
@ -928,7 +928,7 @@ my $fields =
'difference' => 'count'
},
# --------------------------------------------------------------------------
'misc' =>
'misc' =>
{
'munin' =>
{
@ -945,7 +945,7 @@ my $fields =
'difference' => 'count'
},
# --------------------------------------------------------------------------
'fragment' =>
'fragment' =>
{
'munin' =>
{
@ -967,7 +967,7 @@ my $fields =
'difference' => 'count'
},
# --------------------------------------------------------------------------
'beacon' =>
'beacon' =>
{
'munin' =>
{
@ -984,7 +984,7 @@ my $fields =
'difference' => 'count'
},
# --------------------------------------------------------------------------
'crypt' =>
'crypt' =>
{
'munin' =>
{
@ -1006,7 +1006,7 @@ my $fields =
'difference' => 'count'
},
# --------------------------------------------------------------------------
'rx_wifierr' =>
'rx_wifierr' =>
{
'munin' =>
{
@ -1031,7 +1031,7 @@ my $fields =
}
},
# --------------------------------------------------------------------------
'tx_wifierr' =>
'tx_wifierr' =>
{
'munin' =>
{
@ -1056,13 +1056,13 @@ my $fields =
need_multigraph();
if (defined($ARGV[0]) and ($ARGV[0] eq 'autoconf'))
if (defined($ARGV[0]) and ($ARGV[0] eq 'autoconf'))
{
printf("%s\n", -e $ifpath ? "yes" : "no ($ifpath not exists)");
exit (0);
}
$interfaces = get_interfaces();
if (defined($ARGV[0]) and ($ARGV[0] eq 'config'))
if (defined($ARGV[0]) and ($ARGV[0] eq 'config'))
{
print_config();
exit (0);
@ -1124,7 +1124,7 @@ sub get_interfaces
for (keys %{$interfaces}) { $interfaces->{$_}{'name'} = sprintf("[%${maxlen}s]", $interfaces->{$_}{'name'}); }
}
else { die "$ifpath not exists\n"; }
return $interfaces;
}
@ -1169,7 +1169,7 @@ sub get_peak_range
$range->{'max'} = $interfaces->{$if}{'bps'};
$range->{'min'} = 0;
}
# packets per sec
# packets per sec
elsif($fields->{$field}{'peack_protect'} eq 'max_interface_pps' and defined ($interfaces->{$if}{'bps'}))
{
$range->{'max'} = $interfaces->{$if}{'bps'}/$min_packet_size;
@ -1283,10 +1283,10 @@ sub generate_field
my ($config, $graph_name, $field, $if, $is_general_graph) = @_[0..4];
return '' unless(check_field_avialability($if, $field));
my $field_graph_name = $is_general_graph ? sprintf("%s_%s", $if, $field) : $field;
for my $option (keys %{$fields->{$field}{'munin'}})
for my $option (keys %{$fields->{$field}{'munin'}})
{
next if exists($config->{$graph_name}{'fields'}{$field_graph_name}{$option});
$config->{$graph_name}{'fields'}{$field_graph_name}{$option} = replace_if_template($fields->{$field}{'munin'}{$option}, $interfaces->{$if}{'name'});
$config->{$graph_name}{'fields'}{$field_graph_name}{$option} = replace_if_template($fields->{$field}{'munin'}{$option}, $interfaces->{$if}{'name'});
}
if(exists($fields->{$field}{'cdef'}))
{
@ -1300,13 +1300,13 @@ sub generate_field
{
$up_field = $fields->{$down_field}{'negative'}{'name'};
$up_field_name = $is_general_graph ? sprintf("%s_%s", $if, $up_field) : $up_field;
$config->{$graph_name}{'fields'}{$up_field_name}{'label'} =
$config->{$graph_name}{'fields'}{$up_field_name}{'label'} =
concat_names($fields->{$down_field}{'munin'}{'label'}, $fields->{$up_field}{'munin'}{'label'}, $is_general_graph ? $if : '');
}
elsif($fields->{$down_field}{'negative'}{'type'} eq 'dummy')
{
$up_field_name = $is_general_graph ? sprintf("%s_%s_dummy", $if, $down_field) : sprintf("%s_dummy", $down_field);
$config->{$graph_name}{'fields'}{$up_field_name}{'label'} =
$config->{$graph_name}{'fields'}{$up_field_name}{'label'} =
concat_names($fields->{$down_field}{'munin'}{'label'}, $fields->{$down_field}{'munin'}{'label'}, $is_general_graph ? $if : '');
$config->{$graph_name}{'fields'}{$up_field_name}{'info'} = $fields->{$down_field}{'munin'}{'info'};
}
@ -1344,7 +1344,7 @@ sub generate_graph
{
for my $field (@{$graphs->{$graph}{'general_fields'}})
{
for my $general_if (keys %{$interfaces})
for my $general_if (keys %{$interfaces})
{
my $res_field = generate_field($config, $graph_name, $field, $general_if, 1);
push(@order, $res_field) if $res_field ne '';
@ -1361,9 +1361,9 @@ sub generate_graph
}
if(scalar(@order) > 0)
{
for my $option (keys %{$graphs->{$graph}{'munin'}})
for my $option (keys %{$graphs->{$graph}{'munin'}})
{
$config->{$graph_name}{'graph'}{$option} = replace_if_template($graphs->{$graph}{'munin'}{$option}, $is_general_graph ? 'All interfaces' : $interfaces->{$if}{'name'});
$config->{$graph_name}{'graph'}{$option} = replace_if_template($graphs->{$graph}{'munin'}{$option}, $is_general_graph ? 'All interfaces' : $interfaces->{$if}{'name'});
}
$config->{$graph_name}{'graph'}{'order'} = join(' ', @order); # if scalar(@order) > 1;
unless($is_general_graph)
@ -1378,7 +1378,7 @@ sub generate_graphs
{
my ($config, $graph) = @_[0..1];
generate_graph($config, $graph, '', 1);
for my $if (keys %{$interfaces})
for my $if (keys %{$interfaces})
{
generate_graph($config, $graph, $if, 0);
}
@ -1565,9 +1565,9 @@ sub print_values
for my $field (@{$graphs->{$graph}{'general_fields'}}) {
for my $if (keys %{$interfaces}) {
prepare_value($values, $field, sprintf("%s_%s", $if, $field), $graph, $if, $data, $raw_data, $raw_prev_data); } } }
for my $if (keys %{$interfaces})
for my $if (keys %{$interfaces})
{
for my $graph (keys %{$graphs})
for my $graph (keys %{$graphs})
{
my $graph_name = sprintf("%s.%s", $graph, $if);
for my $field (@{$graphs->{$graph}{'per_if_fields'}})

View file

@ -78,7 +78,7 @@ int config() {
"down.graph no" "\n"
"down.cdef down,8,*" "\n"
"down.min 0" "\n"
"up.label bps" "\n"
"up.type DERIVE" "\n"
"up.negative down" "\n"
@ -186,10 +186,10 @@ int acquire() {
char if_id[64];
uint_fast64_t r_bytes, r_packets, r_errs, r_drop, r_fifo, r_frame, r_compressed, r_multicast;
uint_fast64_t t_bytes, t_packets, t_errs, t_drop, t_fifo, t_frame, t_compressed, t_multicast;
sscanf(line, "%s"
sscanf(line, "%s"
" "
"%llu %llu %llu %llu %llu %llu %llu %llu"
" "
"%llu %llu %llu %llu %llu %llu %llu %llu"
" "
"%llu %llu %llu %llu %llu %llu %llu %llu"
, if_id
, &r_bytes, &r_packets, &r_errs, &r_drop, &r_fifo, &r_frame, &r_compressed, &r_multicast
@ -200,11 +200,11 @@ int acquire() {
if_id[strlen(if_id) - 1] = '\0';
char out_buffer[1024];
sprintf(out_buffer,
sprintf(out_buffer,
"multigraph if_%s_1sec" "\n"
"up.value %ld:%llu" "\n"
"down.value %ld:%llu" "\n"
, if_id
, if_id
, epoch, r_bytes
, epoch, t_bytes
);
@ -276,7 +276,7 @@ int main(int argc, char **argv) {
}
/***** DEMO
/proc/net/dev sample
Inter-| Receive | Transmit

View file

@ -19,7 +19,7 @@
#
# Plugin | Used | Suggestions
# ------ | ---- | -----------
# if_uptime | yes |
# if_uptime | yes |
#
# 7. Restart munin: "/etc/init.d/munin-node restart"
# 8. Hold on for 5 minutes at most and watch the graph appear.
@ -117,7 +117,7 @@ $current_uptime
EOF
}
# Munin routines
# Munin routines
case "$1" in
autoconf)
if [[ $(ifconfig &> /dev/null; echo "$?") == 0 ]]; then
@ -146,7 +146,7 @@ EOM
done
exit 0
;;
*)
*)
# Print data for Munin
for (( i=0; i<"${#INTERFACES[*]}"; i++ ))
do

View file

@ -38,7 +38,7 @@ fi
if [ "$1" = "config" ]; then
echo "graph_order rbytes obytes"
echo "graph_order rbytes obytes"
echo "graph_title $INTERFACE traffic"
echo 'graph_args --base 1000'
echo 'graph_vlabel bits per ${graph_period} in (-) / out (+)'

View file

@ -2,18 +2,18 @@
########################################################################
# Copyright (c) 2012, Adrien Urban
# All rights reserved.
#
#
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the following conditions are
# met:
#
# met:
#
# 1. Redistributions of source code must retain the above copyright
# notice, this list of conditions and the following disclaimer.
# notice, this list of conditions and the following disclaimer.
# 2. Redistributions in binary form must reproduce the above copyright
# notice, this list of conditions and the following disclaimer in the
# documentation and/or other materials provided with the
# distribution.
#
# distribution.
#
# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
# "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
# LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
@ -439,7 +439,7 @@ EOF
}
sub check_req()
{
my $data = get_data();
my $data = get_data();
if (0 != scalar(keys %$data)) {
return 1;
}

View file

@ -65,7 +65,7 @@ if [ "$1" = "config" ]; then
echo 'in.label received'
echo 'in.type DERIVE'
echo 'in.min 0'
echo 'in.cdef in,8,*'
echo 'in.cdef in,8,*'
exit 0
fi;

View file

@ -17,7 +17,7 @@
#
# Furthermore, nat configuration must contain "log" option. E.g.
#
# ipfw nat 123 config ip 198.76.28.4 log
# ipfw nat 123 config ip 198.76.28.4 log
#
# This plugin is based on the if_ plugin.
#
@ -45,7 +45,7 @@ if [ "$1" = "autoconf" ]; then
echo "yes"
exit 0
fi
fi
if [ "$1" = "suggest" ]; then
$ipfw nat show config 2> /dev/null | /usr/bin/awk '/nat [0-9]+ .+ log/{print $3;}'

View file

@ -22,7 +22,7 @@
# Revisions:
# 2006.01.00 - First release.
# 2006.11.26 - Use -j RETURN in rules, and sort interfaces
#
#
#
# Magic markers (optional - used by munin-config and some installation
# scripts):
@ -94,7 +94,7 @@ if [ "$1" = "config" ]; then
echo 'graph_args --base 1000'
echo 'graph_category network'
echo 'graph_info This graph shows the traffic of the interfaces in bits per second, and should be precise above 50Mbps as well. All forwarded traffic is measured in the incoming counter of the given interface.'
for iface in $IFACES; do
echo "$iface.label ${iface}_received"
echo "$iface.type DERIVE"

View file

@ -1,5 +1,5 @@
#!/bin/sh
#
#
# Plugin to monitor the number of open connexions to LDAP
#
# $Log: ldap_connections,v $
@ -34,14 +34,14 @@
#
#
# plugin-conf.d/-options:
#
#
# netstat -- path to netstat executable
# ports -- ldap ports used (389 and 636)
# only used ones are graphed
# socket -- ldapi socket (default: /var/run/openldap/ldapi)
#
# Parameters:
#
#
# config (required)
# autoconf (optional - used by munin-config)
#

View file

@ -144,7 +144,7 @@ for shareName in `cat $defaultServer_volumesFile | grep "^[^#:]" | grep -oP "^([
for currentUid in $connectedUsers; do # For each connected users
currentUserHomeDir=`getent passwd $currentUid | cut -d ':' -f6` # Fetch it's the home directory
currentUserHomeDir=`readlink -f "$currentUserHomeDir"` # We want the realpath (resolves symbolic links and normalize the path)
#FIX: We use pipe `lsof` outputs to `echo -e` with `xargs` because lsof "displays only printable ASCII characters" (cf. http://ftp.cerias.purdue.edu/pub/tools/unix/sysutils/lsof/00FAQ #14.5)
# Then if a share with non-ASCII characters in it's path were to be opened, lsof would return them on \xNN form and grep wouldn't match: `echo -e /the/path` fixes this
[ `$baseLsofCommand -F n | xargs -0 echo -e | grep "^n$currentUserHomeDir" | wc -l` -gt 0 ] && let openShares++ # If found in lsof output: increment the openShares counter

View file

@ -15,17 +15,17 @@
(http://nlnetlabs.nl/projects/nsd/)
=head1 CONFIGURATION
The plugin needs access to the nsd logfile and the nsd pid file to
force the running nsd process to write the current statistics.
Tip: To see if it's already set up correctly, just run this plugin
Tip: To see if it's already set up correctly, just run this plugin
with the parameter "autoconf". If you get a "yes", everything should
work like a charm already.
This configuration section shows the defaults of the plugin:
The stats line is a set of space-separated values that you wish to
The stats line is a set of space-separated values that you wish to
retrieve from NSD. The format is VALUE=Caption. For spaces in a
caption value, replace them with an underscore (_).
@ -34,7 +34,7 @@
env.pidfile /var/run/nsd3/nsd.pid
env.stats "A=A AAAA=AAAA MX=MX PTR=PTR TYPE252=AXFR SNXD=NXDOMAIN RQ=Total_Successful"
If you need to set a user for the logfile to be readable, and most
If you need to set a user for the logfile to be readable, and most
importantly, the process to receive the signal, you may specify it.
For example:
@ -42,29 +42,29 @@
user nsd
=head1 INTERPRETATION
The plugin shows the number of queries that nsd has received,
The plugin shows the number of queries that nsd has received,
averaged over a period to gain the number of queries per second.
For most servers, these values will be very low. In the event
of a misconfiguration, the plugin will return undefined values.
=head1 MAGIC MARKERS
#%# family=auto
#%# capabilities=autoconf
=head1 VERSION
v1.0.1
=head1 AUTHOR
J.T.Sage <jtsage@gmail.com>
=head1 LICENSE
GPLv2
=cut
"""

View file

@ -115,9 +115,9 @@ if ( exists $ARGV[0] and $ARGV[0] eq 'config' ) {
last;
}
}
if($haschild == 1) {
if($haschild == 1) {
$queues{$key}->{leaf} = 0;
next;
next;
}
$queues{$key}->{leaf} = 1;
print $queues{$key}->{queue},$queues{$key}->{handle}, " ";

View file

@ -14,7 +14,7 @@
v0.2 - Updated to match output of current versions of ice- and shoutcast.
*/
// -------------- CONFIGURATION START ---------------------------------------
$cfg = array(
$cfg = array(
// SERVER #1
array( "name" => "IceCast", // name for munin
"type" => "ice", // server-type (ice/shout)

View file

@ -6,7 +6,7 @@
# Basically this plugin examines the output of "shorewall -x show accounting".
# See http://atlee.ca/blog/2006/01/20/munin-shorewall/ for a description of
# the original script by Chris AtLee.
#
#
# Copyright 2010-2012 Lars Kruse <devel@sumpralle.de>
# Copyright 2006 Chris AtLee <chris@atlee.ca>
#

View file

@ -1,11 +1,11 @@
#!/usr/bin/python
# shorewall_ v2.0 - 30 Aug 2008 - Tanguy Pruvot <tanguy.pruvot@gmail.com>
#
#
# A munin plugin for tracking traffic as recorded by shorewall accounting rules
#
#
# ex: ln -s /usr/share/munin/plugins/shorewall_ /etc/munin/plugins/shorewall_ftp
# will log ftp* rules like ftp, ftp_input, ftp_output etc...
#
#
# Basic Concept by Chris AtLee <chris@atlee.ca> Released under the GPL v2
import sys, commands, re
@ -61,7 +61,7 @@ def getBytesByChain():
for name in chainNames:
retval.append((name, chains[name]))
return retval
if len(sys.argv) > 1:
if sys.argv[1] == "autoconf":
print "yes"
@ -76,6 +76,6 @@ if len(sys.argv) > 1:
print "%s.label %s" % (chain, chain)
print "%s.cdef %s,8,*" % (chain, chain)
sys.exit(0)
for chain, bytes in getBytesByChain():
print "%s.value %i" % (chain, bytes)

View file

@ -6,7 +6,7 @@
# Released under the GPL v2
import sys, commands, re
accountingLineExp = re.compile(r"^\s*\d+[KMG]*\s+(\d+)([KMGT]*)\s+(\w+).*$")
def getBytesByChain():
trafficCmd = "shorewall"
status, output = commands.getstatusoutput("/sbin/shorewall show accounting 2>/dev/null")
@ -41,7 +41,7 @@ def getBytesByChain():
for name in chainNames:
retval.append((name, chains[name]))
return retval
if len(sys.argv) > 1:
if sys.argv[1] == "autoconf":
print "yes"
@ -56,6 +56,6 @@ if len(sys.argv) > 1:
print "%s.label %s" % (chain, chain)
print "%s.cdef %s,8,*" % (chain, chain)
sys.exit(0)
for chain, bytes in getBytesByChain():
print "%s.value %i" % (chain, bytes)

View file

@ -42,14 +42,14 @@ case $1 in
exit 0
;;
config)
echo "graph_order `mytc $DEVICE | awk '{ print $2 "_" $3 "_drops" }' | tr "\n" " "`"
echo "graph_title $DEVICE TC traffic drops"
echo 'graph_args --base 1000'
echo 'graph_vlabel drops per ${graph_period}'
echo 'graph_category network'
echo "graph_info This graph shows the TC classes traffic drops of the $DEVICE network interface, epxressed in packets."
# mytc $DEVICE | tr "_" " " | awk '{ print $2 "_" $3 "_" $4 "_drops.label " $2 "/" $3 ":" $4 "\n" $2 "_" $3 "_" $4 "_drops.type COUNTER\n" $2 "_" $3 "_" $4 "_drops.min 0\n" $2 "_" $3 "_" $4 "_drops.cdef " $2 "_" $3 "_" $4 ",8,*" }'
mytc $DEVICE | tr "_" " " | awk '{ print $2 "_" $3 "_" $4 "_drops.label " $2 "/" $3 ":" $4 "\n" $2 "_" $3 "_" $4 "_drops.type DERIVE\n" $2 "_" $3 "_" $4 "_drops.min 0" }'
exit 0

View file

@ -42,14 +42,14 @@ case $1 in
exit 0
;;
config)
echo "graph_order `mytc $DEVICE | awk '{ print $2 "_" $3 "_packets" }' | tr "\n" " "`"
echo "graph_title $DEVICE TC traffic packets"
echo 'graph_args --base 1000'
echo 'graph_vlabel packets per ${graph_period}'
echo 'graph_category network'
echo "graph_info This graph shows the TC classes traffic packets of the $DEVICE network interface."
# mytc $DEVICE | tr "_" " " | awk '{ print $2 "_" $3 "_" $4 "_packets.label " $2 "/" $3 ":" $4 "\n" $2 "_" $3 "_" $4 "_packets.type COUNTER\n" $2 "_" $3 "_" $4 "_packets.min 0\n" $2 "_" $3 "_" $4 "_packets.cdef " $2 "_" $3 "_" $4 ",8,*" }'
mytc $DEVICE | tr "_" " " | awk '{ print $2 "_" $3 "_" $4 "_packets.label " $2 "/" $3 ":" $4 "\n" $2 "_" $3 "_" $4 "_packets.type DERIVE\n" $2 "_" $3 "_" $4 "_packets.min 0" }'
exit 0

View file

@ -13,7 +13,7 @@ This plugin implements the multigraph protocol and provides the following graphs
transmission_throughput - monitor traffic volumes of Transmission torrents
transmission_activity - plugin to monitor traffic speed of Transmission torrents
This plugin requires python and the transmissionrpc python module.
This plugin requires python and the transmissionrpc python module.
See http://pypi.python.org/pypi/transmissionrpc/
=head1 CONFIGURATION
@ -64,13 +64,13 @@ find this plugin on github at http://github.com/VolatileMesh/munin-plugins
=head1 CHANGELOG
=head2 1.0 - 2010/11/12
first release
=head2 1.1 - 2011/05/29
fix transmission error handling
=cut
"""
__version__ = '1.1'
@ -138,7 +138,7 @@ def autoconf():
def fetch():
import transmissionrpc
try:
client = transmissionrpc.Client(host, port=port, user=user, password=passwd)
except transmissionrpc.TransmissionError, err:
@ -148,20 +148,20 @@ def fetch():
stats = client.session_stats(10)
print_values_throughput(stats)
print_values_activity(stats)
def print_values_activity(stats):
print "multigraph {plugin_name}_activity".format(plugin_name=plugin_name)
try:
print "total.value %s" % stats.torrentCount
except:
print "total.value U"
try:
print "active.value %s" % stats.activeTorrentCount
except:
print "active.value U"
try:
print "paused.value %s" % stats.pausedTorrentCount
except:
@ -174,12 +174,12 @@ def print_values_throughput(stats):
print "down.value %s" % stats.cumulative_stats['downloadedBytes']
except:
print "down.value U"
try:
print "up.value %s" % stats.cumulative_stats['uploadedBytes']
except:
print "up.value U"
def dumpstats():
@ -192,7 +192,7 @@ def dumpstats():
stats = client.session_stats(10)
print stats
if __name__ == '__main__':
if len(sys.argv)>1 :
if sys.argv[1]=="dumpstats" :

View file

@ -4,7 +4,7 @@
# Multigraph munin plugin to monitor Ubiquiti AirOS F (airFiber) devices various parameters. It needs
# Perl's Net::Telnet or Net::OpenSSH to be able to connect.
#
# To use this plugin, copy it to the munin's plugin directory (eg. /usr/share/munin/plugins)
# To use this plugin, copy it to the munin's plugin directory (eg. /usr/share/munin/plugins)
# under the name "ubiquiti_airfiber_". Don't change this filename! Follow these steps:
#
# 1. Give names to your devices, in fqdn style. Like "master.wlan" or "slave.wlan". To make the
@ -22,7 +22,7 @@
#
# 3. In /etc/munin/plugin-conf.d/munin-node add the following, to be able to contact
# those devices via telnet (obviously replacing these with your own data):
#
#
# [ubiquiti_airos_master.wlan]
# user root # User and Group are required only if using any of the SSH modes to store
# group root # the keys in /root/.ssh directory (or any user with homedir and shell)
@ -53,12 +53,12 @@
#
# 5. Restart the munin node by 'service munin-node restart'.
#
# If all went well, after 5 minutes or so you should have two additional nodes listed
# If all went well, after 5 minutes or so you should have two additional nodes listed
# on the Web Interface of munin.
#
# To use the script with public keys authentication and no password, set env.NetMode SSHkey, and
# create a pair of keys using command 'sudo ssh-keygen -t rsa'. This will generate in /root/.ssh
# directory two files, id_rsa and id_rsa.pub. Upload id_rsa.pub to your Ubiquiti device using
# To use the script with public keys authentication and no password, set env.NetMode SSHkey, and
# create a pair of keys using command 'sudo ssh-keygen -t rsa'. This will generate in /root/.ssh
# directory two files, id_rsa and id_rsa.pub. Upload id_rsa.pub to your Ubiquiti device using
# Services > SSH Server > Authorized Keys window. Try to log in to the device by command line
# first ('sudo ssh foobar@slave.wlan'), to save the RSA key fingerprint in the root account.
#
@ -82,7 +82,7 @@ use warnings;
my $NetMode = $ENV{'NetMode'};
if ($NetMode =~ /Telnet/) {
use Net::Telnet;
}
}
elsif ($NetMode =~ /SSH/) {
use Net::OpenSSH;
}
@ -350,20 +350,20 @@ if ($NetMode =~ /Telnet/) {
elsif ($NetMode =~ /SSHPass/) {
## Initiate SSH Session using password authentication
$SSH = Net::OpenSSH->new($Hostname,
$SSH = Net::OpenSSH->new($Hostname,
port => $Port,
user => $User,
user => $User,
password => $Pass,
timeout => 10,
# master_stderr_discard => 1,
master_opts => [-o => "StrictHostKeyChecking=no"]);
$SSH->error and
$SSH->error and
# warn "Couldn't establish SSH connection: " . $SSH->error;
&printResults(); # Nothing happens, except printing undefined results to munin
}
elsif ($NetMode =~ /SSHKey/) {
## Initiate SSH Session using public key authentication
## Initiate SSH Session using public key authentication
$SSH = Net::OpenSSH->new($Hostname,
port => $Port,
user => $User,
@ -541,8 +541,8 @@ $ping_timelo = ($1 / 1000) if ($pinglo =~ m@min/avg/max.*\s\d+(?:\.\d+)?/(\d+(?:
$packet_losslo = $1 if ($pinglo =~ /(\d+)% packet loss/);
chomp($load, $uptime, $ping_time, $packet_loss, $cpuuser, $cpusystem, $cpunice, $cpuidle, $cpuiowait, $cpuirq, $cpusoftirq, $ping_timelo, $packet_losslo,
$rxrate, $txrate, $rxpower0, $rxpower1, $powerout, $feet, $dist, $temp0, $temp1,
chomp($load, $uptime, $ping_time, $packet_loss, $cpuuser, $cpusystem, $cpunice, $cpuidle, $cpuiowait, $cpuirq, $cpusoftirq, $ping_timelo, $packet_losslo,
$rxrate, $txrate, $rxpower0, $rxpower1, $powerout, $feet, $dist, $temp0, $temp1,
$rssi0, $rssi1, $baseline, $fade, $txfreq, $rxfreq, $txmodrate, $speed);
&printResults();

View file

@ -4,7 +4,7 @@
# Multigraph munin plugin to monitor Ubiquiti AirOS devices various parameters. It needs
# Perl's Net::Telnet or Net::OpenSSH to be able to connect.
#
# To use this plugin, copy it to the munin's plugin directory (eg. /usr/share/munin/plugins)
# To use this plugin, copy it to the munin's plugin directory (eg. /usr/share/munin/plugins)
# under the name "ubiquiti_airos_". Don't change this filename! Follow these steps:
#
# 1. Give names to your devices, in fqdn style. Like "apo.wlan" or "cli.wlan". To make the
@ -53,12 +53,12 @@
#
# 5. Restart the munin node by 'service munin-node restart'.
#
# If all went well, after 5 minutes or so you should have two additional nodes listed
# If all went well, after 5 minutes or so you should have two additional nodes listed
# on the Web Interface of munin.
#
# To use the script with public keys authentication and no password, set env.NetMode SSHkey, and
# create a pair of keys using command 'sudo ssh-keygen -t rsa'. This will generate in /root/.ssh
# directory two files, id_rsa and id_rsa.pub. Upload id_rsa.pub to your Ubiquiti device using
# To use the script with public keys authentication and no password, set env.NetMode SSHkey, and
# create a pair of keys using command 'sudo ssh-keygen -t rsa'. This will generate in /root/.ssh
# directory two files, id_rsa and id_rsa.pub. Upload id_rsa.pub to your Ubiquiti device using
# Services > SSH Server > Authorized Keys window. Try to log in to the device by command line
# first ('sudo ssh foobar@cli.wlan'), to save the RSA key fingerprint in the root account.
#
@ -89,7 +89,7 @@ use warnings;
my $NetMode = $ENV{'NetMode'};
if ($NetMode =~ /Telnet/) {
use Net::Telnet;
}
}
elsif ($NetMode =~ /SSH/) {
use Net::OpenSSH;
}
@ -103,7 +103,7 @@ chomp ($HostLo);
##############################################################################
## Define variables
my $graph_period = "second";
my ($load, $uptime, $ping_time, $packet_loss, $amc, $amq, $conn, $mt, $mf, $mb, $errlrcvd, $errltrans, $errwrcvd, $errwtrans, $ping_timelo, $packet_losslo);
my ($load, $uptime, $ping_time, $packet_loss, $amc, $amq, $conn, $mt, $mf, $mb, $errlrcvd, $errltrans, $errwrcvd, $errwtrans, $ping_timelo, $packet_losslo);
my ($trflup, $trfldown, $trfwup, $trfwdown, $freq, $txccq, $acttimeout, $txsignal, $noisefloor, $txrate, $rxrate, $errnwid);
my ($errcrypt, $errfrag, $errretries, $errbmiss, $errother, $cpuuser, $cpusystem, $cpunice, $cpuidle, $cpuiowait, $cpuirq, $cpusoftirq);
$load = $uptime = $ping_time = $packet_loss = $amc = $amq = $conn = $mt = $mf = $mb = $errlrcvd = $errltrans = $errwrcvd = $errwtrans = $ping_timelo = $packet_losslo = "U";
@ -454,20 +454,20 @@ if ($NetMode =~ /Telnet/) {
elsif ($NetMode =~ /SSHPass/) {
## Initiate SSH Session using password authentication
$SSH = Net::OpenSSH->new($Hostname,
$SSH = Net::OpenSSH->new($Hostname,
port => $Port,
user => $User,
user => $User,
password => $Pass,
timeout => 10,
# master_stderr_discard => 1,
master_opts => [-o => "StrictHostKeyChecking=no"]);
$SSH->error and
$SSH->error and
# warn "Couldn't establish SSH connection: " . $SSH->error;
&printResults(); # Nothing happens, except printing undefined results to munin
}
elsif ($NetMode =~ /SSHKey/) {
## Initiate SSH Session using public key authentication
## Initiate SSH Session using public key authentication
$SSH = Net::OpenSSH->new($Hostname,
port => $Port,
user => $User,
@ -666,8 +666,8 @@ my $pinglo = join(" ", @pinglo);
$ping_timelo = ($1 / 1000) if ($pinglo =~ m@min/avg/max.*\s\d+(?:\.\d+)?/(\d+(?:\.\d+)?)/\d+(?:\.\d+)?@);
$packet_losslo = $1 if ($pinglo =~ /(\d+)% packet loss/);
chomp($load, $uptime, $ping_time, $packet_loss, $amc, $amq, $conn, $mt, $mf, $mb, $errlrcvd, $errltrans, $ping_timelo, $packet_losslo,
$errwrcvd, $errwtrans, $trflup, $trfldown, $trfwup, $trfwdown, $freq, $txccq, $acttimeout, $txsignal,
chomp($load, $uptime, $ping_time, $packet_loss, $amc, $amq, $conn, $mt, $mf, $mb, $errlrcvd, $errltrans, $ping_timelo, $packet_losslo,
$errwrcvd, $errwtrans, $trflup, $trfldown, $trfwup, $trfwdown, $freq, $txccq, $acttimeout, $txsignal,
$noisefloor, $txrate, $rxrate, $errnwid, $errcrypt, $errfrag, $errretries, $errbmiss, $errother,
$cpuuser, $cpusystem, $cpunice, $cpuidle, $cpuiowait, $cpuirq, $cpusoftirq);
@ -688,7 +688,7 @@ sub printResults {
print "multigraph airos_ack\n";
print "acttimeout.value " . $acttimeout . "\n";
print "\n";
print "multigraph airos_dbm\n";
print "txsignal.value " . $txsignal . "\n";
print "noisefloor.value " . $noisefloor . "\n";

View file

@ -1,5 +1,5 @@
#!/bin/bash
#
#
# A Munin Plugin to show umts signal strength using gcom
# Created by Derik Vercueil <jfvercueil@yahoo.co.uk>
# Based on a work of "auth"

View file

@ -115,7 +115,7 @@ EOF
"*")
echo "$0: unknown mode '$1'" >&2
exit 1
esac
esac
}
fetch () {
@ -135,7 +135,7 @@ fetch () {
"*")
echo "$0: unknown mode '$1'" >&2
exit 1
esac
esac
}
mode=`echo $0 | sed 's/.*_//'`

View file

@ -26,7 +26,7 @@ if [ "$1" = "config" ]; then
echo 'totalrx.info Total data received.'
echo 'totalrx.cdef totalrx,1000000,*'
exit 0
fi;

View file

@ -34,7 +34,7 @@ if [ "$1" = "config" ]; then
echo 'totalrx.info Total data received.'
echo 'totalrx.cdef totalrx,1000000,*'
exit 0
fi;