diff --git a/plugins/amavis/amavis-debian b/plugins/amavis/amavis-debian index ef73e689..b80e527c 100755 --- a/plugins/amavis/amavis-debian +++ b/plugins/amavis/amavis-debian @@ -1,5 +1,5 @@ #!/bin/sh -# +# # Plugin to monitor the amavis mail filter for Debian # (based upon a plugin authored by Geoffroy Desvernay) # @@ -32,7 +32,7 @@ BC=${bc:-`which bc`} mktempfile () { mktemp -} +} if [ "$1" = "autoconf" ]; then if [ -f "${AMAVIS_LOG}" -a -n "${LOGTAIL}" -a -x "${LOGTAIL}" -a -n "${BC}" -a -x "${BC}" ] ; then @@ -96,7 +96,7 @@ then virus=`grep 'INFECTED' ${TEMP_FILE} | wc -l` spam=`grep 'Blocked SPAM' ${TEMP_FILE} | wc -l` other=`echo ${total}-${clean}-${virus}-${other}-${spam} | ${BC}` - + /bin/rm -f $TEMP_FILE fi diff --git a/plugins/amavis/amavis_awk b/plugins/amavis/amavis_awk index 154a8d7c..332a2b60 100755 --- a/plugins/amavis/amavis_awk +++ b/plugins/amavis/amavis_awk @@ -2,7 +2,7 @@ # # Plugin to monitor Amavis virus and spam statistics. # -# +# # Based on a routine by William Towle # Uncomment the cdef lines to convert the graph to mails/minute # Comment out the line "total.graph no" to show the total on the graph. This may not be aesthetically pleasing. @@ -38,7 +38,7 @@ if [ "$1" = "config" ]; then echo 'graph_args --base 1000 -l 0' echo 'graph_order clean p_spam b_spam virus total' - + echo 'clean.min 0' echo 'clean.type ABSOLUTE' #echo 'clean.cdef clean,60,*' @@ -70,12 +70,12 @@ fi $LOGTAIL ${MAIL_LOG} $STATEFILE | \ -awk 'BEGIN { na= 0; nb= 0; nc= 0; nd= 0; total= 0 } +awk 'BEGIN { na= 0; nb= 0; nc= 0; nd= 0; total= 0 } - { - - if (index($0, "Passed CLEAN")) { na++ ; total++ } - else if (index($0, "Passed SPAMMY")) { nb++ ; total++ } + { + + if (index($0, "Passed CLEAN")) { na++ ; total++ } + else if (index($0, "Passed SPAMMY")) { nb++ ; total++ } else if (index($0, "Blocked SPAMMY")) { nc++ ; total++ } else if (index($0, "INFECTED")) { nd++ ; total++ } } diff --git a/plugins/amule/amule_queue b/plugins/amule/amule_queue index 649280bb..53f5afd0 100755 --- a/plugins/amule/amule_queue +++ b/plugins/amule/amule_queue @@ -1,13 +1,13 @@ #!/bin/sh # # Plugin to monitor the number of clients in the the aMule queue. -# +# # In order to use this plugin, you need to enable the "Online Signature" feature # available in aMule's configuration options. You will also need to tell aMule to save # the signature file in '/tmp' . # For detailed instructions with screenshots, see http://linux.andreagozzi.com/content/munin_stuff.php # -# +# # Parameters understood: # # config (required) diff --git a/plugins/amule/amule_shares b/plugins/amule/amule_shares index 0b569cf0..33789a36 100755 --- a/plugins/amule/amule_shares +++ b/plugins/amule/amule_shares @@ -1,13 +1,13 @@ #!/bin/sh # # Plugin to monitor the number of shared files with the aMule ed2k/KAD client. -# +# # In order to use this plugin, you need to enable the "Online Signature" feature # available in aMule's configuration options. You will also need to tell aMule to save # the signature file in '/tmp' . # For detailed instructions with screenshots, see http://linux.andreagozzi.com/content/munin_stuff.php # -# +# # Parameters understood: # # config (required) diff --git a/plugins/amule/amule_transfers b/plugins/amule/amule_transfers index cae83ab0..2591c344 100755 --- a/plugins/amule/amule_transfers +++ b/plugins/amule/amule_transfers @@ -1,13 +1,13 @@ #!/bin/sh # # Plugin to monitor the UL/DL speed of the aMule ed2k/KAD client. -# +# # In order to use this plugin, you need to enable the "Online Signature" feature # available in aMule's configuration options. You will also need to tell aMule to save # the signature file in '/tmp' . # For detailed instructions with screenshots, see http://linux.andreagozzi.com/content/munin_stuff.php # -# +# # Parameters understood: # # config (required) diff --git a/plugins/amule/amule_uptime b/plugins/amule/amule_uptime index 9931a1ea..fbf34e39 100755 --- a/plugins/amule/amule_uptime +++ b/plugins/amule/amule_uptime @@ -1,13 +1,13 @@ #!/bin/sh # # Plugin to monitor the current aMule ed2k/KAD client uptime. -# +# # In order to use this plugin, you need to enable the "Online Signature" feature # available in aMule's configuration options. You will also need to tell aMule to save # the signature file in '/tmp' . # For detailed instructions with screenshots, see http://linux.andreagozzi.com/content/munin_stuff.php # -# +# # Parameters understood: # # config (required) diff --git a/plugins/apache/apache_activity b/plugins/apache/apache_activity index 99e0e966..777125fb 100755 --- a/plugins/apache/apache_activity +++ b/plugins/apache/apache_activity @@ -46,13 +46,13 @@ if (exists $ARGV[0] and $ARGV[0] eq "autoconf") { } my $ua = LWP::UserAgent->new(timeout => 30); my @badports; - + foreach my $port (@PORTS) { my $url = sprintf $URL, $port; my $response = $ua->request(HTTP::Request->new('GET',$url)); push @badports, $port unless $response->is_success and $response->content =~ /Scoreboard/im; } - + if (@badports) { print "no (no apache server-status on ports @badports)\n"; exit 1; @@ -75,7 +75,7 @@ if (exists $ARGV[0] and $ARGV[0] eq "config") { print $val, "\n"; print "activity_${port}_${char}.type GAUGE\n"; } - } + } exit 0; } diff --git a/plugins/apache/apache_average_time_last_n_requests b/plugins/apache/apache_average_time_last_n_requests index 1a32e602..3524ab02 100755 --- a/plugins/apache/apache_average_time_last_n_requests +++ b/plugins/apache/apache_average_time_last_n_requests @@ -3,7 +3,7 @@ # Raphaël Droz - 2016-01-08 # # Monitors the average time requests matching a custom regexp takes -# For instance monitor time execution of files in http://example.com/foo/bar, +# For instance monitor time execution of files in http://example.com/foo/bar, # requests from google, images etc. # # Simply add an entry in the 'type' hashref and modify the description fields @@ -13,7 +13,7 @@ # # NOTE: You need to add a field in your Apache logs showing time executed. # This is normally done using the %T (seconds) or %D (microseconds) -# For instance: +# For instance: # LogFormat "%h %l %u %t \"%r\" %>s %b \"%{Referer}i\" \"%{User-agent}i\" %T %v" # Check http://httpd.apache.org/docs/2.2/mod/mod_log_config.html#formats for more info # @@ -62,14 +62,14 @@ my $types = { # any kind of request total => { munin_fields => { - label => 'All requests', + label => 'All requests', draw => 'LINE2', info => 'Average seconds per any request', }, sum => 0, lines => 0, - matches => sub { - return 1; + matches => sub { + return 1; }, }, @@ -82,11 +82,11 @@ my $types = { }, sum => 0, lines => 0, - matches => sub { - my ($fields) = @_; - my $script; - ($script = $fields->[6]) =~ s/\?.*\z //mx; - return $script =~ m{ \.(png|jpe?g|gif|tiff|ilbm|tga) \z }mx; + matches => sub { + my ($fields) = @_; + my $script; + ($script = $fields->[6]) =~ s/\?.*\z //mx; + return $script =~ m{ \.(png|jpe?g|gif|tiff|ilbm|tga) \z }mx; }, }, }; @@ -101,7 +101,7 @@ if (@ARGV && $ARGV[0] eq 'config') { } } exit(0); -} +} my $config_file = `ls -1 $ACCESS_LOG_PATTERN | tail -n 1`; @@ -121,13 +121,13 @@ foreach my $line (@lines) { $types->{$type}->{'lines'}++; } } -} +} } foreach my $type (keys %{$types}) { my $value = $types->{$type}->{'lines'} ? $types->{$type}->{'sum'} / $types->{$type}->{'lines'} : 'U'; printf "%s.value %s\n", ($type, $value); -} +} diff --git a/plugins/apache/apache_blackbox b/plugins/apache/apache_blackbox index 1346aa4e..e5d3c901 100755 --- a/plugins/apache/apache_blackbox +++ b/plugins/apache/apache_blackbox @@ -5,10 +5,10 @@ # luis peralta - luis@11870.com # http://www.ziritione.org # -# Installing: configure apache blackbox and set the logfile to /var/log/blackbox.log +# Installing: configure apache blackbox and set the logfile to /var/log/blackbox.log # or change the BLACKBOXLOG setting below. # -# Dependencies: apache mod_logio, apache blackbox +# Dependencies: apache mod_logio, apache blackbox # http://www.devco.net/archives/2008/03/05/detailed_apache_stats.php # # Last version available at: http://www.ziritione.org/http_status @@ -23,13 +23,13 @@ use strict; -my $BLACKBOXLOG = "/var/log/blackbox.log"; +my $BLACKBOXLOG = "/var/log/blackbox.log"; -my %WANTED = ( "apache.status.200" => "_200", - "apache.status.301" => "_301", - "apache.status.302" => "_302", - "apache.status.404" => "_404", - "apache.status.5xx" => "_5xx", +my %WANTED = ( "apache.status.200" => "_200", + "apache.status.301" => "_301", + "apache.status.302" => "_302", + "apache.status.404" => "_404", + "apache.status.5xx" => "_5xx", ); my $arg = shift(); @@ -78,7 +78,7 @@ graph_total total\n"); ); $num++; } - + } diff --git a/plugins/apache/apache_byprojects/README.md b/plugins/apache/apache_byprojects/README.md index 40ff2f29..736ecae1 100644 --- a/plugins/apache/apache_byprojects/README.md +++ b/plugins/apache/apache_byprojects/README.md @@ -2,15 +2,15 @@ Those plugins are used to monitor different projects or vhost (i.e. either different log files or using regular expression as filters) on the same web server. ## munin_byprojects_access -Count the number of hits per projects/vhost. +Count the number of hits per projects/vhost. ![byproject_access](https://www.mantor.org/~northox/misc/munin-plugins/nginx_byprojects_access1-month.png "byproject_access") ## munin_byprojects_bandwidth -Count the total bandwidth used by each projects/vhost. [Logtail] (https://www.fourmilab.ch/webtools/logtail/) is required. +Count the total bandwidth used by each projects/vhost. [Logtail] (https://www.fourmilab.ch/webtools/logtail/) is required. ![byproject_bandwidth](https://www.mantor.org/~northox/misc/munin-plugins/apache_byprojects_bandwidth-month.png "byproject_bandwidth") ## munin_byprojects_inout_bandwidth -Counts the in/out bandwidth used by each projects/vhost. [Logtail] (https://www.fourmilab.ch/webtools/logtail/) is required. +Counts the in/out bandwidth used by each projects/vhost. [Logtail] (https://www.fourmilab.ch/webtools/logtail/) is required. ![byproject_inout_bandwidth](https://www.mantor.org/~northox/misc/munin-plugins/apache_byprojects_inout_bandwidth-month.png "byproject_inout_bandwidth") ## Installation diff --git a/plugins/apache/apache_byprojects/byprojects_access b/plugins/apache/apache_byprojects/byprojects_access index a6dc444b..26b47745 100755 --- a/plugins/apache/apache_byprojects/byprojects_access +++ b/plugins/apache/apache_byprojects/byprojects_access @@ -3,16 +3,16 @@ use strict; # # byprojects_access # -# Perl script to monitor access *byprojects* (e.g. vhost) from multiple files +# Perl script to monitor access *byprojects* (e.g. vhost) from multiple files # and/or regex. # -# Danny Fullerton +# Danny Fullerton # Mantor Organization # This work is licensed under a MIT license. # # You need logtail (https://www.fourmilab.ch/webtools/logtail/) # -# Log can be gathered from multiple sources by simply specifying multiple log +# Log can be gathered from multiple sources by simply specifying multiple log # filename or using wildcards (glob). File content can be selected using regex. # # - 'prod' => [ {'path' => '/home/prod/log/access.log'} ], @@ -74,7 +74,7 @@ foreach my $project ( keys %logs ) { my @paths = glob $log->{'path'}; foreach my $path (@paths) { my $state = $statepath.'/'.$project.$x.'_access.state'; - open(LT, "$logtail -f ".$log->{'path'}." -o $state |") or + open(LT, "$logtail -f ".$log->{'path'}." -o $state |") or die "Can't open $logtail : $!"; while () { my $buf = $_; diff --git a/plugins/apache/apache_byprojects/byprojects_bandwidth b/plugins/apache/apache_byprojects/byprojects_bandwidth index 5f6c5372..06546922 100755 --- a/plugins/apache/apache_byprojects/byprojects_bandwidth +++ b/plugins/apache/apache_byprojects/byprojects_bandwidth @@ -3,10 +3,10 @@ use strict; # # byprojects_bandwidth # -# Perl script to monitor total bandwidth *byprojects* (e.g. vhost) from multiple +# Perl script to monitor total bandwidth *byprojects* (e.g. vhost) from multiple # files and/or regex. # -# Danny Fullerton +# Danny Fullerton # Mantor Organization # This work is licensed under a MIT license. # @@ -17,7 +17,7 @@ use strict; # "%h %l %u %t \"%r\" %>s %b \"%{Referer}i\" \"%{User-Agent}i\" %I %O" # where %I is input and %O is output. # -# Log can be gathered from multiple sources by simply specifying multiple log +# Log can be gathered from multiple sources by simply specifying multiple log # filename or using wildcards (glob). File content can be selected using regex. # # - 'prod' => [ {'path' => '/home/prod/log/access.log'} ], @@ -81,7 +81,7 @@ foreach my $project ( keys %logs ) { my @paths = glob $log->{'path'}; foreach my $path (@paths) { my $state = $statepath.'/'.$project.$x.'_totalbandwidth.state'; - open(LT, "$logtail -f ".$log->{'path'}." -o $state |") or + open(LT, "$logtail -f ".$log->{'path'}." -o $state |") or die "Can't open $logtail : $!"; while () { my $buf = $_; diff --git a/plugins/apache/apache_byprojects/byprojects_inout_bandwidth b/plugins/apache/apache_byprojects/byprojects_inout_bandwidth index 5722ce52..e08bb006 100755 --- a/plugins/apache/apache_byprojects/byprojects_inout_bandwidth +++ b/plugins/apache/apache_byprojects/byprojects_inout_bandwidth @@ -3,10 +3,10 @@ use strict; # # byprojects_inout_bandwidth # -# Perl script to monitor in/out bandwidth *byprojects* (e.g. vhost) from +# Perl script to monitor in/out bandwidth *byprojects* (e.g. vhost) from # multiple files and/or regex. # -# Danny Fullerton +# Danny Fullerton # Mantor Organization # This work is licensed under a MIT license. # @@ -17,7 +17,7 @@ use strict; # "%h %l %u %t \"%r\" %>s %b \"%{Referer}i\" \"%{User-Agent}i\" %I %O" # where %I is input and %O is output. # -# Log can be gathered from multiple sources by simply specifying multiple log +# Log can be gathered from multiple sources by simply specifying multiple log # filename or using wildcards (glob). File content can be selected using regex. # # - 'prod' => [ {'path' => '/home/prod/log/access.log'} ], @@ -84,7 +84,7 @@ foreach my $project ( keys %logs ) { my @paths = glob $log->{'path'}; foreach my $path (@paths) { my $state = $statepath.'/'.$project.$x.'_inoutbandwidth.state'; - open(LT, "$logtail -f ".$log->{'path'}." -o $state |") or + open(LT, "$logtail -f ".$log->{'path'}." -o $state |") or die "Can't open $logtail : $!"; while () { my $buf = $_; diff --git a/plugins/apache/apache_memmory b/plugins/apache/apache_memmory index 10d89b3b..4e829191 100755 --- a/plugins/apache/apache_memmory +++ b/plugins/apache/apache_memmory @@ -36,7 +36,7 @@ PROCS=$binname if [ "$1" = "autoconf" ]; then - echo yes + echo yes exit 0 fi @@ -65,5 +65,5 @@ VAL2=`ps auxf | grep ${PROCS} | grep ^${USR} | grep -v grep | awk '{s+=$6} END { VAL3=`expr $VAL2 / $VAL1` echo "servers.value $VAL3" - + diff --git a/plugins/apache/apache_servers b/plugins/apache/apache_servers index 04238fdb..9d20febe 100755 --- a/plugins/apache/apache_servers +++ b/plugins/apache/apache_servers @@ -34,7 +34,7 @@ USR=$apuser PROCS=$binname if [ "$1" = "autoconf" ]; then - echo yes + echo yes exit 0 fi diff --git a/plugins/apache/apache_smaps b/plugins/apache/apache_smaps index 3f063c12..abc0974e 100755 --- a/plugins/apache/apache_smaps +++ b/plugins/apache/apache_smaps @@ -8,7 +8,7 @@ # to Apache2::SizeLimit. # Author: Kjetil Kjernsmo , based on work by William Viker -# Copyright (C) 2007 Opera Software ASA +# Copyright (C) 2007 Opera Software ASA # # Contibutors: Earle Nietzel # diff --git a/plugins/apache/apache_status b/plugins/apache/apache_status index 9ca3f043..a17c4043 100755 --- a/plugins/apache/apache_status +++ b/plugins/apache/apache_status @@ -144,7 +144,7 @@ if ( defined $ARGV[0] and $ARGV[0] eq "autoconf" ) { if ($response->content =~ /^Total Accesses:/im ) { next; } else { - print "no (ExtendedStatus option for apache" + print "no (ExtendedStatus option for apache" . " mod_status is missing on port $port)\n"; exit 0; } diff --git a/plugins/apache/apache_threads b/plugins/apache/apache_threads index a231b392..f7c8fb6a 100755 --- a/plugins/apache/apache_threads +++ b/plugins/apache/apache_threads @@ -32,7 +32,7 @@ GPLv2 if [ "$1" = "autoconf" ]; then - echo yes + echo yes exit 0 fi @@ -81,8 +81,3 @@ done echo "threads.value `echo $((SUM / $COUNT))`" - - - - - diff --git a/plugins/apache/apache_tmemmory b/plugins/apache/apache_tmemmory index 3617c753..9a0c5d55 100755 --- a/plugins/apache/apache_tmemmory +++ b/plugins/apache/apache_tmemmory @@ -35,7 +35,7 @@ PROCS=$binname if [ "$1" = "autoconf" ]; then - echo yes + echo yes exit 0 fi @@ -60,5 +60,5 @@ VAL1=`ps auxf | grep ${PROCS} | grep -v grep | awk '{s+=$6} END {print s}'` VAL2=`expr $VAL1 / 1024` echo "servers.value $VAL2" - + diff --git a/plugins/apache/apache_users b/plugins/apache/apache_users index 4193a1af..bc178f41 100755 --- a/plugins/apache/apache_users +++ b/plugins/apache/apache_users @@ -100,7 +100,7 @@ do else USERNAME[$I]="anonymous" fi - NAME[$I]="_${USERNAME[I]}" # Output sort order + NAME[$I]="_${USERNAME[I]}" # Output sort order else NAME[$I]="${USERNAME[I]}" fi @@ -140,7 +140,7 @@ then FILENAMES=$( find $DIRECTORY -type f -not -wholename $TIMESTAMP | sort) awk '{ printf "%s.label %s\n%s.draw AREA\n", $1, $3, $1 }' $( echo "$FILENAMES" | head -n1 ) - + for FILENAME in $( echo "$FILENAMES" | tail -n+2) do awk '{ printf "%s.label %s\n%s.draw STACK\n", $1, $3, $1 }' $FILENAME diff --git a/plugins/apache/apache_vhosts/apache_logparser b/plugins/apache/apache_vhosts/apache_logparser index 1f427b5e..1da00230 100755 --- a/plugins/apache/apache_vhosts/apache_logparser +++ b/plugins/apache/apache_vhosts/apache_logparser @@ -95,7 +95,7 @@ sub count { #find sitename $file=~s/$site/$1/; $file=$vhost if $vhost; - + # skip broken lines next unless $file; @@ -103,7 +103,7 @@ sub count { my $vpm=clean_fieldname("$file"); $temp{$vpm}{'label'}="$file"; $temp{$vpm}{'label'}=~s/www\.//; - + # count all requests $temp{$vpm}{'requests'}++; @@ -118,13 +118,13 @@ sub count { # average bytes $temp{$vpm}{'avg_bytes'}=$temp{$vpm}{'bytes'}/$temp{$vpm}{'requests'} || 0; } - + # count by status / error code $temp{$vpm}{"status"}{$status}++ if $status; if ($time) { # microsec to millisec - $time=sprintf("%d",$time/1000); + $time=sprintf("%d",$time/1000); # min/max execution time $temp{$vpm}{'max_time'}=max($temp{$vpm}{'max_time'},$time) || 0; @@ -144,9 +144,9 @@ while (1) { # tail files, calls &count with linearray $tail->read; - # begin transaction + # begin transaction $share->lock(LOCK_EX); - + # get data (may be updated by other loggers too) my %old=eval{%{thaw($share->fetch)}}; # using eval to suppress thaw error on empty string at the first run @@ -182,7 +182,7 @@ while (1) { $share->store( freeze \%old ); # end transaction $share->unlock; - + # parse/write every n seconds (plus processing time) sleep $nsec; } diff --git a/plugins/apache/apache_vhosts/apache_pipelogger b/plugins/apache/apache_vhosts/apache_pipelogger index 73c73eee..5bdf9188 100755 --- a/plugins/apache/apache_vhosts/apache_pipelogger +++ b/plugins/apache/apache_vhosts/apache_pipelogger @@ -40,12 +40,12 @@ while () { # sanity check next unless m/^([\d\w\.\-_]+\s){5}([\d\w\.\-_]+$)/; # escaped "." and "-" - + # sitename to munin fieldname my $vpm=clean_fieldname($vhost); $temp{$vpm}{'label'}=$vhost; $temp{$vpm}{'label'}=~s/www\.//; - + # count all requests $temp{$vpm}{'requests'}++; @@ -60,7 +60,7 @@ while () { # average bytes $temp{$vpm}{'avg_bytes'}=$temp{$vpm}{'bytes'}/$temp{$vpm}{'requests'} || 0 if ($bytes); } - + # count by status / error code $temp{$vpm}{"status"}{$status}++ if $status; @@ -77,9 +77,9 @@ while () { }; sub periodic_write { - # begin transaction + # begin transaction $share->lock(LOCK_EX); - + # get data (may be updated by other loggers too) my %old=eval{%{thaw($share->fetch)}}; # using eval to suppress thaw error on empty string at the first run diff --git a/plugins/apache/apache_vhosts/apache_vhosts b/plugins/apache/apache_vhosts/apache_vhosts index 74150dce..a13141ca 100755 --- a/plugins/apache/apache_vhosts/apache_vhosts +++ b/plugins/apache/apache_vhosts/apache_vhosts @@ -18,13 +18,13 @@ This plugin requires data from apache. You can get at the data in two ways: - slightly less performant, but easier to apply to existing installations - If you want response time stats, you have to log them in apache: - LogFormat "%h %l %u %t \"%r\" %>s %b \"%{Referer}i\" \"%{User-Agent}i\" %D" combined-time + LogFormat "%h %l %u %t \"%r\" %>s %b \"%{Referer}i\" \"%{User-Agent}i\" %D" combined-time - Configure the log parser to match your installation regarding naming and log folders - -You can use both solutions simultaneously, the data will be merged. + +You can use both solutions simultaneously, the data will be merged. Be aware that a apache log CustomLog directive in the master config will only log those vhosts that have no directive of their own. - + Install plugin conf (after [apache_*]) [apache_vhosts] @@ -36,14 +36,14 @@ env.checks requests bytes time # subgraphs - create multigraph subgraphs (watch your graphing performance...), default 0 # checks - enable stats on bytes and response times per request, you have to log these in apache -A word on performance: +A word on performance: Requests/sec should not be much of a problem. Pipelogger and Logparser should not have man performance problems, as the apply one regex per line and add some stats. -Stats are saved every n seconds (default: 7) to shared mem in serialized format. That should be ok on the most loaded servers (unless you watch cache logs). -I would estimate that > 10k log lines/sec could start becoming a problem, you might have to start tuning there or use a dedicated system. +Stats are saved every n seconds (default: 7) to shared mem in serialized format. That should be ok on the most loaded servers (unless you watch cache logs). +I would estimate that > 10k log lines/sec could start becoming a problem, you might have to start tuning there or use a dedicated system. You might think about splitting the logs over multiple Logparser scripts to parallelize and merge in larger intervals. -Graphing is another matter, the more vhosts you have. -With subgraphs off, you do 3 main graphs * 4 timescales (day, week, month, year). +Graphing is another matter, the more vhosts you have. +With subgraphs off, you do 3 main graphs * 4 timescales (day, week, month, year). With subgraphs on, you get 2 checks * (1 + 6 * #vhosts) + 1 check * (1 + #vhosts * #statuscodes * 4) With hundreds of vhosts that becomes a problem, as munin-update and munin-html do not scale well. @@ -152,7 +152,7 @@ ${site}_${graph}_$check.type GAUGE END } # end graph } # end sites - } # end subgraph + } # end subgraph } # end checks @@ -173,7 +173,7 @@ graph_period minute graph_order $order END foreach my $site (keys %data) { - + print <new (timeout => 30); my @badports; - + foreach my $port (@PORTS) { my $url = sprintf $URL, $port; my $response = $ua->request (HTTP::Request->new('GET', $url)); push @badports, $port unless $response->is_success; } - + if (@badports) { print "no (no mod_watch exists on ports @badports)\n"; exit 1; @@ -76,7 +76,7 @@ foreach my $port (@PORTS) { my ($server, undef, $ifInOctets, $ifOutOctets, $ifRequests, $ifDocuments) = split (/\s/, $string, 6); push @servers, $server unless $server eq "SERVER"; - push @data, "$server $ifInOctets $ifOutOctets $ifRequests $ifDocuments" + push @data, "$server $ifInOctets $ifOutOctets $ifRequests $ifDocuments" unless $server eq "SERVER"; } } diff --git a/plugins/apache/page_load b/plugins/apache/page_load index cc09a885..8c952c68 100755 --- a/plugins/apache/page_load +++ b/plugins/apache/page_load @@ -22,38 +22,38 @@ # # apache2.conf # LogFormat "%h %l %u %t \"%r\" %>s %O %b %D \"%{Referer}i\" \"%{User-Agent}i\"" custom -# +# # According to : http://httpd.apache.org/docs/2.2/mod/mod_log_config.html # %D The time taken to serve the request, in microseconds. # In our case %D -> 9 -###################################################################################################### +###################################################################################################### # GLOBALS LOGFILE="/var/log/apache2/access.log" BUFFER_SIZE=500 ###################################################################################################### - + do_ () { command="tail -n $BUFFER_SIZE $LOGFILE | awk '{sum=sum+\$9} END {print \"exec_time.value \"(sum/$BUFFER_SIZE)/1000000}'" eval $command exit 0 } - + do_config () { echo "graph_title Average page execution time" echo "graph_vlabel Seconds" echo "graph_category webserver" echo "graph_args --base 1000 -l 0" echo "graph_info Average page execution time" - + echo "exec_time.label Execution time" echo "exec_time.type GAUGE" } - + case $1 in config|'') eval do_$1 esac - + exit $? diff --git a/plugins/apt/deb_packages/README.md b/plugins/apt/deb_packages/README.md index 7dbfc489..781df2c5 100644 --- a/plugins/apt/deb_packages/README.md +++ b/plugins/apt/deb_packages/README.md @@ -24,8 +24,8 @@ This plugin has checked on Debian - Wheezy and squeeze. If you want to use it on older installations, tell me whether it works or which errors you had. It should run past python-apt 0.7 and python 2.5. -check out this git repository from - +check out this git repository from + aptitude install python-apt git clone git://github.com/munin-monitoring/contrib.git cd contrib/plugins/apt/deb_packages @@ -51,7 +51,7 @@ A typical configuration looks like this # Age in seconds an $CACHE_FILE can be. If it is older, the script updates # default if not set is 3540 (one hour) # at the moment this is not used, the plugin always runs (if munin calls it) - # + # env.CACHE_FILE_MAX_AGE 3540 # All these numbers are only for sorting, so you can use env.graph01_sort_by_0 diff --git a/plugins/apt/deb_packages/deb_packages.py b/plugins/apt/deb_packages/deb_packages.py index 538a8efc..931d1d8f 100755 --- a/plugins/apt/deb_packages/deb_packages.py +++ b/plugins/apt/deb_packages/deb_packages.py @@ -1,7 +1,7 @@ #!/usr/bin/python # -*- coding: utf-8 -*- -""" +""" A munin plugin that prints archive and their upgradable packets TODO: make it usable and readable as commandline tool @@ -13,18 +13,18 @@ TODO: separate into 2 graphs sorting a packet to the newest archive (WONTFIX unless someone asks for) -TODO: +TODO: • addinge alternative names for archives "stable -> squeeze" -TODO: add gray as +TODO: add gray as foo.colour 000000 to 'now', '', '', '', '', 'Debian dpkg status file' TODO: update only if system was updated (aptitutde update has been run) • check modification date of /var/cache/apt/pkgcache.bin • cache file must not be older than mod_date of pkgcache.bin + X -TODO: shorten ext_info with getShortestConfigOfOptions -TODO: check whether cachefile matches the config +TODO: shorten ext_info with getShortestConfigOfOptions +TODO: check whether cachefile matches the config • i have no clever idea to do this without 100 lines of code -BUG: If a package will be upgraded, and brings in new dependencies, +BUG: If a package will be upgraded, and brings in new dependencies, these new deps will not be counted. WONTFIX """ import sys @@ -32,7 +32,7 @@ import argparse import apt_pkg from apt.progress.base import OpProgress from time import time, strftime -import os +import os import StringIO import string import re @@ -41,7 +41,7 @@ from types import StringTypes, TupleType, DictType, ListType, BooleanType class EnvironmentConfigBroken(Exception): pass -# print environmental things +# print environmental things # for k,v in os.environ.iteritems(): print >> sys.stderr, "%r : %r" % (k,v) def getEnv(name, default=None, cast=None): @@ -68,14 +68,14 @@ MAX_LIST_SIZE_EXT_INFO = getEnv('MAX_LIST_SIZE_EXT_INFO', default=50, cast=int) STATE_DIR = getEnv('MUNIN_PLUGSTATE', default='.') CACHE_FILE = os.path.join(STATE_DIR, "deb_packages.state") -""" +""" There is no need to execute this script every 5 minutes. The Results are put to this file, next munin-run can read from it CACHE_FILE is usually /var/lib/munin/plugin-state/debian_packages.state """ CACHE_FILE_MAX_AGE = getEnv('CACHE_FILE_MAX_AGE', default=3540, cast=int) -""" +""" Age in seconds an $CACHE_FILE can be. If it is older, the script updates """ @@ -103,9 +103,9 @@ class Apt(object): doc = "apt_pkg.Cache instance, lazy instantiated" def fget(self): class NullProgress(OpProgress): - """ used for do not giving any progress info, - while doing apt things used, cause documented - use of None as OpProgress did not worked in + """ used for do not giving any progress info, + while doing apt things used, cause documented + use of None as OpProgress did not worked in python-apt 0.7 """ def __init__(self): @@ -119,8 +119,8 @@ class Apt(object): def update(*args,**kwords): pass - if self._cache is None: - self._cache = apt_pkg.Cache(NullProgress()) + if self._cache is None: + self._cache = apt_pkg.Cache(NullProgress()) return self._cache return locals() @@ -129,7 +129,7 @@ class Apt(object): doc = "apt_pkg.DepCache object" def fget(self): - if self._depcache is None: + if self._depcache is None: self._depcache = apt_pkg.DepCache(self.cache) return self._depcache @@ -180,7 +180,7 @@ apt = Apt() apt.installedPackages apt.upgradablePackages - initialisation is lazy + initialisation is lazy """ def weightOfPackageFile(detail_tuple, option_tuple): @@ -214,7 +214,7 @@ def Tree(): class TreeTwig(defaultdict): def __init__(self, defaultFactory): - super(TreeTwig, self).__init__(defaultFactory) + super(TreeTwig, self).__init__(defaultFactory) def printAsTree(self, indent=0): for k, tree in self.iteritems(): @@ -245,16 +245,16 @@ class TreeTwig(defaultdict): def getShortestConfigOfOptions(optionList = ['label', 'archive', 'site']): - """ + """ tries to find the order to print a tree of the optionList - with the local repositories with the shortest line + with the local repositories with the shortest line possible options are: 'component' 'label' 'site' 'archive' - 'origin' - 'architecture' + 'origin' + 'architecture' Architecture values are usually the same and can be ignored. tells you which representation of a tree as line is shortest. @@ -262,19 +262,19 @@ def getShortestConfigOfOptions(optionList = ['label', 'archive', 'site']): to write the shortest readable output. """ l = optionList # just because l is much shorter - + # creating possible iterations fieldCount = len(optionList) if fieldCount == 1: selection = l elif fieldCount == 2: - selection = [(x,y) - for x in l + selection = [(x,y) + for x in l for y in l if x!=y ] elif fieldCount == 3: - selection = [(x,y,z) - for x in l - for y in l if x!=y + selection = [(x,y,z) + for x in l + for y in l if x!=y for z in l if z!=y and z!=x] else: raise Exception("NotImplemented for size %s" % fieldCount) @@ -289,7 +289,7 @@ def getShortestConfigOfOptions(optionList = ['label', 'archive', 'site']): r = min( d.items(), key=lambda x: x[1] ) return list(r[0]), r[1] - + def getOptionsTree(cache, keys=None): """ t = getOptionsTree(cache, ['archive', 'site', 'label']) @@ -322,16 +322,16 @@ def createKey(key, file): """ if type(key) in StringTypes: return file.__getattribute__(key) - elif type(key) in (TupleType, ListType): + elif type(key) in (TupleType, ListType): nKey = tuple() for pKey in key: nKey = nKey.__add__((file.__getattribute__(pKey),)) return nKey else: - raise Exception("Not implemented for keytype %s" % type(key)) + raise Exception("Not implemented for keytype %s" % type(key)) def getOptionsTree2(cache, primary=None, secondary=None): - """ + """ primary muss ein iterable oder StringType sein secondary muss iterable oder StringType sein t1 = getOptionsTree2(apt.cache, 'origin', ['site', 'archive']) @@ -369,24 +369,24 @@ def getOptionsTree2(cache, primary=None, secondary=None): dKey = file.__getattribute__(sKey) d = d[dKey] return t - + #def getAttributeSet(iterable, attribute): # return set(f.__getattribute__(attribute) for f in iterable) # #def getOrigins(cache): -# return getAttributeSet(cache.file_list, 'origin') +# return getAttributeSet(cache.file_list, 'origin') # #def getArchives(cache): -# return getAttributeSet(cache.file_list, 'archive') +# return getAttributeSet(cache.file_list, 'archive') # #def getComponents(cache): -# return getAttributeSet(cache.file_list, 'component') +# return getAttributeSet(cache.file_list, 'component') # #def getLabels(cache): -# return getAttributeSet(cache.file_list, 'label') +# return getAttributeSet(cache.file_list, 'label') # #def getSites(cache): -# return getAttributeSet(cache.file_list, 'site') +# return getAttributeSet(cache.file_list, 'site') # class PackageStat(defaultdict): @@ -397,16 +397,16 @@ class PackageStat(defaultdict): with some abilities to print output munin likes """ - sortDict = { 'label': defaultdict( lambda : 20, - {'Debian': 90, + sortDict = { 'label': defaultdict( lambda : 20, + {'Debian': 90, '' : 1, 'Debian Security' : 90, 'Debian Backports': 90}), 'archive': defaultdict( lambda : 5, - { 'now': 0, + { 'now': 0, 'experimental': 10, - 'unstable': 50, - 'sid': 50, + 'unstable': 50, + 'sid': 50, 'testing': 70, 'wheezy': 70, 'squeeze-backports': 80, @@ -426,9 +426,9 @@ class PackageStat(defaultdict): } """ Values to sort options (label, archive, origin ...) - (0..99) is allowed. + (0..99) is allowed. (this is needed for other graphs to calc aggregated weights) - higher is more older and more official or better + higher is more older and more official or better """ dpkgStatusValue = { 'site': '', 'origin': '', 'label': '', 'component': '', 'archive': 'now' } @@ -443,7 +443,7 @@ class PackageStat(defaultdict): 'component' : 10**2, } """ - Dict that stores multipliers + Dict that stores multipliers to compile a sorting value for each archivefile """ @@ -483,7 +483,7 @@ class PackageStat(defaultdict): def addPackage(self, sourceFile, package): if self.packetHandler.decider(package): self.packetHandler.adder(package, self) - + @classmethod def configD(cls, key, value): i = { 'rrdName': cls.generate_rrd_name_from(key), @@ -514,8 +514,8 @@ class PackageStat(defaultdict): print "{rrdName}.draw AREASTACK".format(**i) def optionIsDpkgStatus(self, details, options=None): - """ - give it details and options and it tells you whether the datails looks like they come from + """ + give it details and options and it tells you whether the datails looks like they come from a 'Debian dpkg status file'. """ # setting defaults @@ -530,7 +530,7 @@ class PackageStat(defaultdict): return isNow def printValues(self): - print "\nmultigraph packages_{option}_{type}".format(option=self.generate_rrd_name_from(self.option), + print "\nmultigraph packages_{option}_{type}".format(option=self.generate_rrd_name_from(self.option), type=self.packetHandler.type) for options, item in self.options_sorted: if not self.packetHandler.includeNow and self.optionIsDpkgStatus(details=options): @@ -555,7 +555,7 @@ packetHandlerD = {} class PacketHandler(object): """ - Baseclass, that represents the Interface which is used + Baseclass, that represents the Interface which is used """ type = None @@ -591,7 +591,7 @@ class PacketHandler(object): return weightOfPackageFile(details, options) class PacketHandlerUpgradable(PacketHandler): - + type='upgradable' includeNow = False extInfoItemString = " {i[0].name} <{i[1]} -> {i[2]}>" @@ -628,7 +628,7 @@ class PacketHandlerInstalled(PacketHandler): # this item (as i) is used for input in extInfoItemString item = package packageStat[keys].append(item) - + # registering PackageHandler for Usage packetHandlerD[PacketHandlerInstalled.type] = PacketHandlerInstalled @@ -637,7 +637,7 @@ class Munin(object): def __init__(self, commandLineArgs=None): self.commandLineArgs = commandLineArgs self.argParser = self._argParser() - self.executionMatrix = { + self.executionMatrix = { 'config': self.config, 'run' : self.run, 'autoconf' : self.autoconf, @@ -685,7 +685,7 @@ class Munin(object): else: raise Exception('DPKG-statusfile %r not found, really strange!!!'%dpkgStatusFile) newestFileTimestamp = max(timeL) - age = newestFileTimestamp - cacheMTime + age = newestFileTimestamp - cacheMTime if age > 0: return True else: @@ -709,7 +709,7 @@ class Munin(object): # cacheNeedUpdate = True if self._cacheIsOutdated() or self.args.nocache: - # save stdout + # save stdout stdoutDef = sys.stdout try: out = StringIO.StringIO() @@ -765,7 +765,7 @@ class Munin(object): def _argParser(self): parser = argparse.ArgumentParser(description="Show some statistics "\ "about debian packages installed on system by archive", - ) + ) parser.set_defaults(command='run', debug=True, nocache=True) parser.add_argument('--nocache', '-n', default=False, action='store_true', @@ -775,7 +775,7 @@ class Munin(object): run ........ munin run (writes values) autoconf ... writes 'yes' """ - parser.add_argument('command', nargs='?', + parser.add_argument('command', nargs='?', choices=['config', 'run', 'autoconf', 'drun'], help='mode munin wants to use. "run" is default' + helpCommand) return parser @@ -783,10 +783,10 @@ class Munin(object): def _envParser(self): """ reads environVars from [deb_packages] and generate - a list of dicts, each dict holds a set of settings made in + a list of dicts, each dict holds a set of settings made in munin config. - [ - { 'type' = 'installed', + [ + { 'type' = 'installed', 'sort_by' = ['label', 'archive'], 'show_ext' = ['origin', 'site'], }, @@ -816,7 +816,7 @@ class Munin(object): configPart['show_ext'][m.group('optNumber')] = os.getenv(var) else: print >> sys.stderr, "configuration option %r was ignored" % (var) - # we have now dicts for 'sort_by' and 'show_ext' keys + # we have now dicts for 'sort_by' and 'show_ext' keys # changing them to lists for graphConfig in config.itervalues(): graphConfig['sort_by'] = [val for key, val in sorted(graphConfig['sort_by'].items())] @@ -839,13 +839,13 @@ class Munin(object): "Graph must be sorted by anything" raise EnvironmentConfigBroken("Environment Config broken") # check for valid options for sort_by - unusableOptions = set(graph['sort_by']) - PackageStat.viewSet - if unusableOptions: + unusableOptions = set(graph['sort_by']) - PackageStat.viewSet + if unusableOptions: print >> sys.stderr, \ "%r are not valid options for 'sort_by'" % (unusableOptions) raise EnvironmentConfigBroken("Environment Config broken") # check for valid options for sort_by - unusableOptions = set(graph['show_ext']) - PackageStat.viewSet + unusableOptions = set(graph['show_ext']) - PackageStat.viewSet if unusableOptions: print >> sys.stderr, \ "%r are not valid options for 'show_ext'" % (x) diff --git a/plugins/arangodb/arangodb_ b/plugins/arangodb/arangodb_ index a90863af..4ee21e92 100755 --- a/plugins/arangodb/arangodb_ +++ b/plugins/arangodb/arangodb_ @@ -1,7 +1,7 @@ #!/usr/bin/python """ -Plugin to monitor ArangoDB servers. It works with the new server statistics +Plugin to monitor ArangoDB servers. It works with the new server statistics interface of ArangoDB 1.3. Not every value seems senseful, but there are nice graphs generated... @@ -30,19 +30,19 @@ Usage: Links possible: arangodb_conn HTTP client connections arangodb_time_total Total request/queue/connection time - arangodb_bytes_total Total sent/received bytes + arangodb_bytes_total Total sent/received bytes Configuration: - No configuration required. Just enable the admin interface of ArangoDB. -Thanks to the authors of other Python munin plugins. I've used some of -them as inspiring example. +Thanks to the authors of other Python munin plugins. I've used some of +them as inspiring example. Possible todos: - support of munin-like configuration parameters - add more statistics - + """ from os.path import basename @@ -57,7 +57,7 @@ except ImportError: def getServerStatus(group): raw = urllib2.urlopen( "http://127.0.0.1:8529/_admin/statistics" ).read() - + return json.loads( raw )[group] def doData(plugin_name): @@ -66,26 +66,26 @@ def doData(plugin_name): elif plugin_name== 'arangodb_time_total': data = getServerStatus('client') - timeTotal = data['totalTime']['sum'] - timeConnection = data['connectionTime']['sum'] - timeRequest = data['requestTime']['sum'] - timeQueue = data['queueTime']['sum'] - + timeTotal = data['totalTime']['sum'] + timeConnection = data['connectionTime']['sum'] + timeRequest = data['requestTime']['sum'] + timeQueue = data['queueTime']['sum'] + print "total.value " + str(int(round(timeTotal))) print "connection.value " + str(int(round(timeConnection))) print "request.value " + str(int(round(timeRequest))) print "queue.value " + str(int(round(timeQueue))) - + elif plugin_name== 'arangodb_bytes_total': data = getServerStatus('client') bytesReceived = data['bytesReceived']['sum'] bytesSent = data['bytesSent']['sum'] print "received.value " + str(int(round(bytesReceived))) print "sent.value " + str(int(round(bytesSent))) - + else: pass - + def doConfig(plugin_name): if plugin_name == 'arangodb_conn': print "graph_title ArangoDB current connections" @@ -103,7 +103,7 @@ def doConfig(plugin_name): print "connection.label connection" print "request.label request" print "queue.label queue" - + elif plugin_name == 'arangodb_bytes_total': print "graph_title ArangoDB total bytes" print "graph_args --base 1024" @@ -125,7 +125,7 @@ def doConfig(plugin_name): else: pass - + plugin_name = basename(sys.argv[0]) diff --git a/plugins/aris/aris_players b/plugins/aris/aris_players index b783f92c..95e95cc2 100755 --- a/plugins/aris/aris_players +++ b/plugins/aris/aris_players @@ -18,7 +18,7 @@ # Parameters: # # config (required) -# +# # #%# family=manual diff --git a/plugins/assp/assp-envelope-recipient-statistics b/plugins/assp/assp-envelope-recipient-statistics index 98366914..e21af08b 100755 --- a/plugins/assp/assp-envelope-recipient-statistics +++ b/plugins/assp/assp-envelope-recipient-statistics @@ -73,13 +73,13 @@ unless( defined(@ARGV) ){ # =============== THE GET ==================== if( $ARGV[0] eq "" ){ my $agent = LWP::UserAgent->new(); - $agent->agent("$agentname"); + $agent->agent("$agentname"); $response = $agent->get( $url ); &response_error() unless $response->is_success; @content = split( /\n/, $response->content ); my $line = ""; - my $count = $index{from}; + my $count = $index{from}; my $label; my( $key, $value, $last ); while( 1 ){ diff --git a/plugins/assp/assp-general-runtime-information b/plugins/assp/assp-general-runtime-information index 931b0ed9..32aa0349 100755 --- a/plugins/assp/assp-general-runtime-information +++ b/plugins/assp/assp-general-runtime-information @@ -12,7 +12,7 @@ use strict; use warnings; -use File::Basename; +use File::Basename; use LWP; use Mail::Sendmail; @@ -53,11 +53,11 @@ unless( defined(@ARGV) ){ # =============== THE GET ==================== if( $ARGV[0] eq "" ){ my $agent = LWP::UserAgent->new(); - $agent->agent("$agentname"); + $agent->agent("$agentname"); $response = $agent->get( $url ); &response_error() unless $response->is_success; @content = split( /\n/, $response->content ); - + my $line = ""; my $count = $index{from}; my $label; diff --git a/plugins/assp/assp-message-statistics b/plugins/assp/assp-message-statistics index 0657dbd0..78032338 100755 --- a/plugins/assp/assp-message-statistics +++ b/plugins/assp/assp-message-statistics @@ -17,23 +17,23 @@ use LWP; use Mail::Sendmail; # -------------------------- DEBUG VARS --------------------------------- -my $DEBUG = 0; # for debugging purpose -my $EMAILDEBUG = 0; # for email debugging -my $pluginname = &basename( "$0" ); # get the basename of the plugin -my @to = qw( webmaster@bguel.info ); # the list of admins receivced messages on an -my $from = "$pluginname-at-host\@guel.info"; # the host from where it comes -my $muninnodename = "mail.guel.info"; # the Node from where it comes -my $smtp = "mail.guel.info"; # the smtp relay to send the mail +my $DEBUG = 0; # for debugging purpose +my $EMAILDEBUG = 0; # for email debugging +my $pluginname = &basename( "$0" ); # get the basename of the plugin +my @to = qw( webmaster@bguel.info ); # the list of admins receivced messages on an +my $from = "$pluginname-at-host\@guel.info"; # the host from where it comes +my $muninnodename = "mail.guel.info"; # the Node from where it comes +my $smtp = "mail.guel.info"; # the smtp relay to send the mail # ------------------------- GLOBAL VARS --------------------------------- -my $version = "1.0"; # UA Version -my $agentname = "$pluginname Munin Plugin V$version"; # UA String -my $url = "http://localhost:55553/"; # (defaults to localhost) -my $response = 0; # the server output -my @content = (); # the content we're retrive from $response +my $version = "1.0"; # UA Version +my $agentname = "$pluginname Munin Plugin V$version"; # UA String +my $url = "http://localhost:55553/"; # (defaults to localhost) +my $response = 0; # the server output +my @content = (); # the content we're retrive from $response my %index = ( # for Version 2 - 'from' => 66, # <-- index frame from ( a tweak for other ASSP Versions ) - 'to' => 100 # <-- index frame to ( "" ) + 'from' => 66, # <-- index frame from ( a tweak for other ASSP Versions ) + 'to' => 100 # <-- index frame to ( "" ) ); @@ -85,13 +85,13 @@ unless( defined(@ARGV) ){ # =============== THE GET ==================== if( $ARGV[0] eq "" ){ my $agent = LWP::UserAgent->new(); - $agent->agent("$agentname"); + $agent->agent("$agentname"); $response = $agent->get( $url ); &response_error() unless $response->is_success; @content = split( /\n/, $response->content ); my $line = ""; - my $count = $index{from}; + my $count = $index{from}; my $label; my( $key, $value, $last ); while( 1 ){ diff --git a/plugins/assp/assp-smtp-connection-statistics b/plugins/assp/assp-smtp-connection-statistics index 4caabb9f..ddddd1e0 100755 --- a/plugins/assp/assp-smtp-connection-statistics +++ b/plugins/assp/assp-smtp-connection-statistics @@ -63,13 +63,13 @@ unless( defined(@ARGV) ){ # =============== THE GET ==================== if( $ARGV[0] eq "" ){ my $agent = LWP::UserAgent->new(); - $agent->agent("$agentname"); + $agent->agent("$agentname"); $response = $agent->get( $url ); &response_error() unless $response->is_success; @content = split( /\n/, $response->content ); my $line = ""; - my $count = $index{from}; + my $count = $index{from}; my $label; my( $key, $value, $last ); while( 1 ){ diff --git a/plugins/assp/assp-smtp-handler-statistics b/plugins/assp/assp-smtp-handler-statistics index c43570f6..c80e5083 100755 --- a/plugins/assp/assp-smtp-handler-statistics +++ b/plugins/assp/assp-smtp-handler-statistics @@ -12,7 +12,7 @@ use strict; use warnings; -use File::Basename; +use File::Basename; use LWP; use Mail::Sendmail; @@ -53,11 +53,11 @@ unless( defined(@ARGV) ){ # =============== THE GET ==================== if( $ARGV[0] eq "" ){ my $agent = LWP::UserAgent->new(); - $agent->agent("$agentname"); + $agent->agent("$agentname"); $response = $agent->get( $url ); &response_error() unless $response->is_success; @content = split( /\n/, $response->content ); - + my $line = ""; my $count = $index{from}; my $label; diff --git a/plugins/asterisk/asterisk b/plugins/asterisk/asterisk index abd87f2c..1810fbb9 100755 --- a/plugins/asterisk/asterisk +++ b/plugins/asterisk/asterisk @@ -193,7 +193,7 @@ multigraph asterisk_codecs graphs_title Asterisk channels per codec graph_args --base 1000 -l 0 graph_vlabel channels -graph_category voip +graph_category voip END foreach my $codec (@CODECS) { diff --git a/plugins/asterisk/asterisk_14_fax_ffa/asterisk_fax_cancelled b/plugins/asterisk/asterisk_14_fax_ffa/asterisk_fax_cancelled index 9351eb4a..7139f770 100755 --- a/plugins/asterisk/asterisk_14_fax_ffa/asterisk_fax_cancelled +++ b/plugins/asterisk/asterisk_14_fax_ffa/asterisk_fax_cancelled @@ -77,7 +77,7 @@ address with the copyright notice upgrade with your name. use strict; use Asterisk::AMI; - eval "use Asterisk::AMI"; + eval "use Asterisk::AMI"; print "Asterisk::AMI not found. Exiting...\n" if $@; exit( 0 ) if $@; diff --git a/plugins/asterisk/asterisk_14_fax_ffa/asterisk_fax_current_sessions b/plugins/asterisk/asterisk_14_fax_ffa/asterisk_fax_current_sessions index f3155b21..421c7e5f 100755 --- a/plugins/asterisk/asterisk_14_fax_ffa/asterisk_fax_current_sessions +++ b/plugins/asterisk/asterisk_14_fax_ffa/asterisk_fax_current_sessions @@ -77,7 +77,7 @@ address with the copyright notice upgrade with your name. use strict; use Asterisk::AMI; - eval "use Asterisk::AMI"; + eval "use Asterisk::AMI"; print "Asterisk::AMI not found. Exiting...\n" if $@; exit( 0 ) if $@; diff --git a/plugins/asterisk/asterisk_14_fax_ffa/asterisk_fax_failed_completed b/plugins/asterisk/asterisk_14_fax_ffa/asterisk_fax_failed_completed index 1b115136..9fd45f1f 100755 --- a/plugins/asterisk/asterisk_14_fax_ffa/asterisk_fax_failed_completed +++ b/plugins/asterisk/asterisk_14_fax_ffa/asterisk_fax_failed_completed @@ -77,7 +77,7 @@ address with the copyright notice upgrade with your name. use strict; use Asterisk::AMI; - eval "use Asterisk::AMI"; + eval "use Asterisk::AMI"; print "Asterisk::AMI not found. Exiting...\n" if $@; exit( 0 ) if $@; diff --git a/plugins/asterisk/asterisk_14_fax_ffa/asterisk_fax_iofail b/plugins/asterisk/asterisk_14_fax_ffa/asterisk_fax_iofail index ef31b90d..b3c84623 100755 --- a/plugins/asterisk/asterisk_14_fax_ffa/asterisk_fax_iofail +++ b/plugins/asterisk/asterisk_14_fax_ffa/asterisk_fax_iofail @@ -77,7 +77,7 @@ address with the copyright notice upgrade with your name. use strict; use Asterisk::AMI; - eval "use Asterisk::AMI"; + eval "use Asterisk::AMI"; print "Asterisk::AMI not found. Exiting...\n" if $@; exit( 0 ) if $@; diff --git a/plugins/asterisk/asterisk_14_fax_ffa/asterisk_fax_iopartial b/plugins/asterisk/asterisk_14_fax_ffa/asterisk_fax_iopartial index d94a0d85..67f2604d 100755 --- a/plugins/asterisk/asterisk_14_fax_ffa/asterisk_fax_iopartial +++ b/plugins/asterisk/asterisk_14_fax_ffa/asterisk_fax_iopartial @@ -77,7 +77,7 @@ address with the copyright notice upgrade with your name. use strict; use Asterisk::AMI; - eval "use Asterisk::AMI"; + eval "use Asterisk::AMI"; print "Asterisk::AMI not found. Exiting...\n" if $@; exit( 0 ) if $@; diff --git a/plugins/asterisk/asterisk_14_fax_ffa/asterisk_fax_licensed_channels b/plugins/asterisk/asterisk_14_fax_ffa/asterisk_fax_licensed_channels index 5b779350..863e9c2d 100755 --- a/plugins/asterisk/asterisk_14_fax_ffa/asterisk_fax_licensed_channels +++ b/plugins/asterisk/asterisk_14_fax_ffa/asterisk_fax_licensed_channels @@ -77,7 +77,7 @@ address with the copyright notice upgrade with your name. use strict; use Asterisk::AMI; - eval "use Asterisk::AMI"; + eval "use Asterisk::AMI"; print "Asterisk::AMI not found. Exiting...\n" if $@; exit( 0 ) if $@; diff --git a/plugins/asterisk/asterisk_14_fax_ffa/asterisk_fax_max_concurrent b/plugins/asterisk/asterisk_14_fax_ffa/asterisk_fax_max_concurrent index 998bd139..7fa2e46c 100755 --- a/plugins/asterisk/asterisk_14_fax_ffa/asterisk_fax_max_concurrent +++ b/plugins/asterisk/asterisk_14_fax_ffa/asterisk_fax_max_concurrent @@ -77,7 +77,7 @@ address with the copyright notice upgrade with your name. use strict; use Asterisk::AMI; - eval "use Asterisk::AMI"; + eval "use Asterisk::AMI"; print "Asterisk::AMI not found. Exiting...\n" if $@; exit( 0 ) if $@; diff --git a/plugins/asterisk/asterisk_14_fax_ffa/asterisk_fax_negotiations_failed b/plugins/asterisk/asterisk_14_fax_ffa/asterisk_fax_negotiations_failed index fd402f63..102c44e2 100755 --- a/plugins/asterisk/asterisk_14_fax_ffa/asterisk_fax_negotiations_failed +++ b/plugins/asterisk/asterisk_14_fax_ffa/asterisk_fax_negotiations_failed @@ -77,7 +77,7 @@ address with the copyright notice upgrade with your name. use strict; use Asterisk::AMI; - eval "use Asterisk::AMI"; + eval "use Asterisk::AMI"; print "Asterisk::AMI not found. Exiting...\n" if $@; exit( 0 ) if $@; diff --git a/plugins/asterisk/asterisk_14_fax_ffa/asterisk_fax_nofax b/plugins/asterisk/asterisk_14_fax_ffa/asterisk_fax_nofax index b284676b..658d126f 100755 --- a/plugins/asterisk/asterisk_14_fax_ffa/asterisk_fax_nofax +++ b/plugins/asterisk/asterisk_14_fax_ffa/asterisk_fax_nofax @@ -77,7 +77,7 @@ address with the copyright notice upgrade with your name. use strict; use Asterisk::AMI; - eval "use Asterisk::AMI"; + eval "use Asterisk::AMI"; print "Asterisk::AMI not found. Exiting...\n" if $@; exit( 0 ) if $@; diff --git a/plugins/asterisk/asterisk_14_fax_ffa/asterisk_fax_partial b/plugins/asterisk/asterisk_14_fax_ffa/asterisk_fax_partial index 81ede198..4f09016d 100755 --- a/plugins/asterisk/asterisk_14_fax_ffa/asterisk_fax_partial +++ b/plugins/asterisk/asterisk_14_fax_ffa/asterisk_fax_partial @@ -77,7 +77,7 @@ address with the copyright notice upgrade with your name. use strict; use Asterisk::AMI; - eval "use Asterisk::AMI"; + eval "use Asterisk::AMI"; print "Asterisk::AMI not found. Exiting...\n" if $@; exit( 0 ) if $@; diff --git a/plugins/asterisk/asterisk_14_fax_ffa/asterisk_fax_protocol_error b/plugins/asterisk/asterisk_14_fax_ffa/asterisk_fax_protocol_error index 5ee5c896..11d13afc 100755 --- a/plugins/asterisk/asterisk_14_fax_ffa/asterisk_fax_protocol_error +++ b/plugins/asterisk/asterisk_14_fax_ffa/asterisk_fax_protocol_error @@ -77,7 +77,7 @@ address with the copyright notice upgrade with your name. use strict; use Asterisk::AMI; - eval "use Asterisk::AMI"; + eval "use Asterisk::AMI"; print "Asterisk::AMI not found. Exiting...\n" if $@; exit( 0 ) if $@; diff --git a/plugins/asterisk/asterisk_14_fax_ffa/asterisk_fax_success b/plugins/asterisk/asterisk_14_fax_ffa/asterisk_fax_success index 15ce0d71..6060d919 100755 --- a/plugins/asterisk/asterisk_14_fax_ffa/asterisk_fax_success +++ b/plugins/asterisk/asterisk_14_fax_ffa/asterisk_fax_success @@ -77,7 +77,7 @@ address with the copyright notice upgrade with your name. use strict; use Asterisk::AMI; - eval "use Asterisk::AMI"; + eval "use Asterisk::AMI"; print "Asterisk::AMI not found. Exiting...\n" if $@; exit( 0 ) if $@; diff --git a/plugins/asterisk/asterisk_14_fax_ffa/asterisk_fax_switched2t38 b/plugins/asterisk/asterisk_14_fax_ffa/asterisk_fax_switched2t38 index 7980aa00..1be0f3a8 100755 --- a/plugins/asterisk/asterisk_14_fax_ffa/asterisk_fax_switched2t38 +++ b/plugins/asterisk/asterisk_14_fax_ffa/asterisk_fax_switched2t38 @@ -77,7 +77,7 @@ address with the copyright notice upgrade with your name. use strict; use Asterisk::AMI; - eval "use Asterisk::AMI"; + eval "use Asterisk::AMI"; print "Asterisk::AMI not found. Exiting...\n" if $@; exit( 0 ) if $@; diff --git a/plugins/asterisk/asterisk_14_fax_ffa/asterisk_fax_train_failure b/plugins/asterisk/asterisk_14_fax_ffa/asterisk_fax_train_failure index 9252ff75..c41ab216 100755 --- a/plugins/asterisk/asterisk_14_fax_ffa/asterisk_fax_train_failure +++ b/plugins/asterisk/asterisk_14_fax_ffa/asterisk_fax_train_failure @@ -77,7 +77,7 @@ address with the copyright notice upgrade with your name. use strict; use Asterisk::AMI; - eval "use Asterisk::AMI"; + eval "use Asterisk::AMI"; print "Asterisk::AMI not found. Exiting...\n" if $@; exit( 0 ) if $@; diff --git a/plugins/asterisk/asterisk_14_fax_ffa/asterisk_fax_txrx_attempts b/plugins/asterisk/asterisk_14_fax_ffa/asterisk_fax_txrx_attempts index cd495ea9..55767225 100755 --- a/plugins/asterisk/asterisk_14_fax_ffa/asterisk_fax_txrx_attempts +++ b/plugins/asterisk/asterisk_14_fax_ffa/asterisk_fax_txrx_attempts @@ -77,7 +77,7 @@ address with the copyright notice upgrade with your name. use strict; use Asterisk::AMI; - eval "use Asterisk::AMI"; + eval "use Asterisk::AMI"; print "Asterisk::AMI not found. Exiting...\n" if $@; exit( 0 ) if $@; diff --git a/plugins/asterisk/asterisk_14_fax_ffa/fax_show_stats.txt b/plugins/asterisk/asterisk_14_fax_ffa/fax_show_stats.txt index a85a9ffe..300f8926 100644 --- a/plugins/asterisk/asterisk_14_fax_ffa/fax_show_stats.txt +++ b/plugins/asterisk/asterisk_14_fax_ffa/fax_show_stats.txt @@ -31,7 +31,7 @@ Receive Attempts : 0 Completed FAXes : 0 Failed FAXes : 0 -Digium G.711 +Digium G.711 Licensed Channels : 1 Max Concurrent : 0 Success : 0 diff --git a/plugins/asterisk/asterisk_channels b/plugins/asterisk/asterisk_channels index a69c4af4..fde261ff 100755 --- a/plugins/asterisk/asterisk_channels +++ b/plugins/asterisk/asterisk_channels @@ -5,7 +5,7 @@ # Converted to /bin/sh by Steve Schnepp # June 2012 # Version 1.0 -# +# # Run as root or make sure munin user can run 'asterisk -r' command # # [asterisk_channels] diff --git a/plugins/asterisk/asterisk_inuse b/plugins/asterisk/asterisk_inuse index f782bf24..837890e1 100755 --- a/plugins/asterisk/asterisk_inuse +++ b/plugins/asterisk/asterisk_inuse @@ -1,7 +1,7 @@ #!/bin/sh # # add this into munin/plugin-conf.d/plugins.conf: -# +# # [asterisk_inuse] # user root # diff --git a/plugins/audit/portaudit b/plugins/audit/portaudit index f067e1eb..f7cced66 100755 --- a/plugins/audit/portaudit +++ b/plugins/audit/portaudit @@ -16,7 +16,7 @@ PORTAUDIT=/usr/local/sbin/portaudit if [ "$1" = "autoconf" ]; then if [ -x $PORTAUDIT ]; then - echo yes + echo yes exit 0 else echo no '(portaudit not found)' diff --git a/plugins/battery/acpi_batt_ b/plugins/battery/acpi_batt_ index a03e4b1c..3e625809 100755 --- a/plugins/battery/acpi_batt_ +++ b/plugins/battery/acpi_batt_ @@ -1,5 +1,5 @@ #!/usr/bin/perl -w -# -*- perl -*- +# -*- perl -*- =head1 NAME @@ -41,8 +41,8 @@ The plugin shows: #%# family=power -=head1 VERSION -=head1 BUGS +=head1 VERSION +=head1 BUGS None known. @@ -99,7 +99,7 @@ sub read_data $val = "unknown"; } elsif ( $var ne "batery type" or $var ne "serial number" or $var ne "OEM info" ) - { + { @tmp = split(" " ,$val); $val = trim($tmp[0]); } diff --git a/plugins/battery/acpi_sys_batt_ b/plugins/battery/acpi_sys_batt_ index e8937610..40c8d127 100755 --- a/plugins/battery/acpi_sys_batt_ +++ b/plugins/battery/acpi_sys_batt_ @@ -1,5 +1,5 @@ #!/usr/bin/perl -w -# -*- perl -*- +# -*- perl -*- =head1 NAME @@ -36,8 +36,8 @@ The plugin shows: #%# family=power -=head1 VERSION -=head1 BUGS +=head1 VERSION +=head1 BUGS None known. diff --git a/plugins/battery/batteries b/plugins/battery/batteries index 197e9b7c..05aa480c 100755 --- a/plugins/battery/batteries +++ b/plugins/battery/batteries @@ -1,5 +1,5 @@ #!/usr/bin/perl -w -# -*- perl -*- +# -*- perl -*- =head1 NAME @@ -35,11 +35,11 @@ The plugin shows: #%# family=power #%# capabilities=autoconf -=head1 VERSION +=head1 VERSION 1.0 -=head1 BUGS +=head1 BUGS None known. @@ -219,7 +219,7 @@ sub read_data } -my $graphs = +my $graphs = { 'batteryes_capacity' => { 'vlabel' => 'Capacity, Ah', 'title' => '%s capacity', 'args' => '--base 1000', 'fields' => [qw/design_capacity last_full_capacity design_capacity_low design_capacity_warning capacity_granularity_1 capacity_granularity_2 remaining_capacity/] }, @@ -231,7 +231,7 @@ my $graphs = 'fields' => [qw/present_rate/] } }; -my $fields = +my $fields = { 'design_capacity' => { 'source' => 'both', 'draw' => 'AREA' , 'label' => 'Design capacity' , 'info' => 'Battery design capacity' }, 'last_full_capacity' => { 'source' => 'both', 'draw' => 'AREA' , 'label' => 'Last full capacity' , 'info' => 'Battery full charge capacity' }, @@ -250,7 +250,7 @@ my $fields = # ------------------------------------ start here ----------------------------------- -if (defined($ARGV[0]) and ($ARGV[0] eq 'autoconf')) +if (defined($ARGV[0]) and ($ARGV[0] eq 'autoconf')) { printf("%s\n", (-e $proc_path or -e $sys_path) ? "yes" : "no ($proc_path and $sys_path not exists)"); exit (0); diff --git a/plugins/bigbrother/b3error_ b/plugins/bigbrother/b3error_ index 23741fe2..853bb544 100755 --- a/plugins/bigbrother/b3error_ +++ b/plugins/bigbrother/b3error_ @@ -23,7 +23,7 @@ STATEFILE=$MUNIN_PLUGSTATE/${B3NAME}.offset mktempfile () { mktemp -t $1 -} +} if [ "$1" = "autoconf" ]; then @@ -49,7 +49,7 @@ fi if [ "$1" = "config" ]; then echo "graph_title BigBrotherBot errors - ${B3NAME}" - cat <<'EOM' + cat <<'EOM' graph_args --base 1000 -l 0 graph_vlabel Errors graph_category Games diff --git a/plugins/bind/bind9_rr b/plugins/bind/bind9_rr index 1e29be03..e510f556 100755 --- a/plugins/bind/bind9_rr +++ b/plugins/bind/bind9_rr @@ -84,7 +84,7 @@ sub do_stats { if ($3 eq 'IN' and $4 !~ /^TYPE/) { my $crr = lc $2; $IN{$crr}++; - } + } } } close(Q); diff --git a/plugins/boinc/boinc_estwk b/plugins/boinc/boinc_estwk index 0042f19e..47d4cb00 100755 --- a/plugins/boinc/boinc_estwk +++ b/plugins/boinc/boinc_estwk @@ -288,7 +288,7 @@ Linux machines running BOINC and munin-node - or - -Linux servers (running munin-node) used to collect data from other systems +Linux servers (running munin-node) used to collect data from other systems which are running BOINC, but not running munin-node (e.g. non-Linux systems) =head1 CONFIGURATION @@ -319,48 +319,48 @@ Warning level - minimum estimated work (default: 24.00 hours) =item B -Password for BOINC (default: none) +Password for BOINC (default: none) =back =head2 B -Using of variable B poses a security risk. Even if the Munin -configuration file for this plugin containing BOINC-password is properly -protected, the password is exposed as environment variable and finally passed -to boinccmd as a parameter. It is therefore possible for local users of the -machine running this plugin to eavesdrop the BOINC password. +Using of variable B poses a security risk. Even if the Munin +configuration file for this plugin containing BOINC-password is properly +protected, the password is exposed as environment variable and finally passed +to boinccmd as a parameter. It is therefore possible for local users of the +machine running this plugin to eavesdrop the BOINC password. -Using of variable password is therefore strongly discouraged and is left here +Using of variable password is therefore strongly discouraged and is left here as a legacy option and for testing purposes. -It should be always possible to use B variable instead - in such case -the file gui_rpc_auth.cfg is read by boinccmd binary directly. -If this plugin is used to fetch data from remote system, the gui_rpc_auth.cfg -can be copied to special directory in a secure way (e.g. via scp) and properly +It should be always possible to use B variable instead - in such case +the file gui_rpc_auth.cfg is read by boinccmd binary directly. +If this plugin is used to fetch data from remote system, the gui_rpc_auth.cfg +can be copied to special directory in a secure way (e.g. via scp) and properly protected by file permissions. =head1 INTERPRETATION -This plugin shows the estimated remaining computation time for all CPUs of +This plugin shows the estimated remaining computation time for all CPUs of the machine and the estimated remaining computation time of longest workunit. -The estimation is based on assumption that the workunits of different lengths +The estimation is based on assumption that the workunits of different lengths will be distributed to the CPUs evenly (which is not always the case). -The warning level can be used to warn in forward about the risk of workunits +The warning level can be used to warn in forward about the risk of workunits local cache depletion and BOINC client running out of the work. -Although such warning can be achieved by configuring Munin master, there is +Although such warning can be achieved by configuring Munin master, there is also this option to configure it on munin-node side. =head1 EXAMPLES =head2 Local BOINC Example -BOINC is running on local machine. The BOINC binaries are installed in +BOINC is running on local machine. The BOINC binaries are installed in F, the BOINC is running in directory -F under username boinc, group boinc and the password is used +F under username boinc, group boinc and the password is used to protect access to BOINC. -Warning will be set when estimated work for any of CPUs will decrease under +Warning will be set when estimated work for any of CPUs will decrease under 48 hours: [boinc_*] @@ -371,17 +371,17 @@ Warning will be set when estimated work for any of CPUs will decrease under =head2 Remote BOINC Example -BOINC is running on 2 remote machines C and C. -On the local machine the binary of command-line interface is installed in +BOINC is running on 2 remote machines C and C. +On the local machine the binary of command-line interface is installed in directory F. -The BOINC password used on the remote machine C is stored in file +The BOINC password used on the remote machine C is stored in file F. -The BOINC password used on the remote machine C is stored in file +The BOINC password used on the remote machine C is stored in file F. -These files are owned and readable by root, readable by group munin and not -readable by others. -There are 2 symbolic links to this plugin created in the munin plugins -directory (usually F): F and +These files are owned and readable by root, readable by group munin and not +readable by others. +There are 2 symbolic links to this plugin created in the munin plugins +directory (usually F): F and F [snmp_foo_boinc*] @@ -396,33 +396,33 @@ F env.host bar env.boincdir /etc/munin/boinc/bar -This way the plugin can be used by Munin the same way as the Munin plugins +This way the plugin can be used by Munin the same way as the Munin plugins utilizng SNMP (although this plugin itself does not use SNMP). =head1 BUGS -The estimation is based on simple assumption, that longest workunits will be -processed first. This is the case when work is distributed evenly among CPUs. -But this is not always the case, because various deadlines for various -workunits may fire the "panic mode" of BOINC and scheduling could be much -different. -For example, there can be 4 CPUs, and BOINC having downloaded 4 workunits -with estimated run-time 1 hour each and 3 workunits with estimated run-time -4 hours each. +The estimation is based on simple assumption, that longest workunits will be +processed first. This is the case when work is distributed evenly among CPUs. +But this is not always the case, because various deadlines for various +workunits may fire the "panic mode" of BOINC and scheduling could be much +different. +For example, there can be 4 CPUs, and BOINC having downloaded 4 workunits +with estimated run-time 1 hour each and 3 workunits with estimated run-time +4 hours each. This Munin plugin will report estimated work 4 hours for each CPU. -But if deadline of those 1-hour workunits will be much shorter than deadline -of those 4-hours workunits, BOINC will schedule short workunits first (for all +But if deadline of those 1-hour workunits will be much shorter than deadline +of those 4-hours workunits, BOINC will schedule short workunits first (for all 4 CPUs) and after finishing them it will schedule those long workunits. This will result in real computation for 5 hours on 3 CPUs but only 1 hour on -remaining 4th CPU. So after 1 hour of computation 1 of CPUs will run out of +remaining 4th CPU. So after 1 hour of computation 1 of CPUs will run out of work. -There is no C capability at the moment. This is due to the fact, that -BOINC installations may vary over different systems, sometimes using default -directory from distribution (e.g. F in Debian or Ubuntu), but +There is no C capability at the moment. This is due to the fact, that +BOINC installations may vary over different systems, sometimes using default +directory from distribution (e.g. F in Debian or Ubuntu), but often running in user directories or in other separate directories. -Also the user-ID under which BOINC runs often differs. -Under these circumstances the C would be either lame or too +Also the user-ID under which BOINC runs often differs. +Under these circumstances the C would be either lame or too complicated. =head1 AUTHOR diff --git a/plugins/boinc/boinc_processes b/plugins/boinc/boinc_processes index adf6f584..d0e05f74 100755 --- a/plugins/boinc/boinc_processes +++ b/plugins/boinc/boinc_processes @@ -5,12 +5,12 @@ # Parameters: # # password -- The password for RPC authentication -# (default: boinc_cmd will look for a file +# (default: boinc_cmd will look for a file # 'gui_rpc_auth.cfg' and use the password in it) # host -- the host to connect to (default: localhost) # port -- optional (default: 31416) # -# This plugin can monitor boinc processes running on local/remote machines. +# This plugin can monitor boinc processes running on local/remote machines. # You can see the progress on various projects. # # Author: Petr Ruzicka @@ -49,14 +49,14 @@ sub autoconf { $reply =~ /(.*)<\/nonce>/; $hash = md5_hex($1, $password); - + print $client "$hash\003"; - + { local $/ = "\003"; $reply = <$client>; } - + if ($reply =~ //) { print "yes\n"; exit 0; @@ -70,29 +70,29 @@ sub config { my $client = IO::Socket::INET->new ( PeerAddr => $host, PeerPort => $port, Proto => 'tcp' ) - or die "Can't bind : $@\n"; + or die "Can't bind : $@\n"; print $client "\003"; - { + { local $/ = "\003"; $reply = <$client>; } $reply =~ /(.*)<\/nonce>/; my $hash = md5_hex($1, $password); - + print $client "$hash\003"; - + { local $/ = "\003"; $reply = <$client>; } - + if ($reply !~ //) { die "Wrong password: $_"; } - + print $client ""; while (chomp($reply = <$client>) && ($reply ne "")) { @@ -101,7 +101,7 @@ sub config { print "graph_category htc\n"; print "graph_args -l 0\n"; print "graph_vlabel %\n"; - } + } if ($reply =~ /(.*)<\/project_name>/) { my $boinc_munin_name=$1; $boinc_munin_name =~ /(\w+).*/; @@ -115,31 +115,31 @@ sub report { my $client = IO::Socket::INET->new ( PeerAddr => $host, PeerPort => $port, Proto => 'tcp' ) - or die "Can't bind : $@\n"; + or die "Can't bind : $@\n"; print $client "\003"; - { + { local $/ = "\003"; $reply = <$client>; } $reply =~ /(.*)<\/nonce>/; my $hash = md5_hex($1, $password); - + print $client "$hash\003"; - + { local $/ = "\003"; $reply = <$client>; } - + if ($reply !~ //) { die "Wrong password: $_"; } - + print $client ""; - + while (chomp($reply = <$client>) && ($reply ne "")) { if ($reply =~ /(\w+).*<\/project_name>/) { $project = $1; diff --git a/plugins/boinc/boinc_projs b/plugins/boinc/boinc_projs index 25ee64b6..352397c1 100755 --- a/plugins/boinc/boinc_projs +++ b/plugins/boinc/boinc_projs @@ -279,7 +279,7 @@ Linux machines running BOINC and munin-node - or - -Linux servers (running munin-node) used to collect data from other systems +Linux servers (running munin-node) used to collect data from other systems which are running BOINC, but not running munin-node (e.g. non-Linux systems) =head1 CONFIGURATION @@ -306,40 +306,40 @@ Directory containing appropriate file gui_rpc_auth.cfg (default: none) =item B -Password for BOINC (default: none) +Password for BOINC (default: none) =back =head2 B -Using of variable B poses a security risk. Even if the Munin -configuration file for this plugin containing BOINC-password is properly -protected, the password is exposed as environment variable and finally passed -to boinccmd as a parameter. It is therefore possible for local users of the -machine running this plugin to eavesdrop the BOINC password. +Using of variable B poses a security risk. Even if the Munin +configuration file for this plugin containing BOINC-password is properly +protected, the password is exposed as environment variable and finally passed +to boinccmd as a parameter. It is therefore possible for local users of the +machine running this plugin to eavesdrop the BOINC password. -Using of variable password is therefore strongly discouraged and is left here +Using of variable password is therefore strongly discouraged and is left here as a legacy option and for testing purposes. -It should be always possible to use B variable instead - in such case -the file gui_rpc_auth.cfg is read by boinccmd binary directly. -If this plugin is used to fetch data from remote system, the gui_rpc_auth.cfg -can be copied to special directory in a secure way (e.g. via scp) and properly +It should be always possible to use B variable instead - in such case +the file gui_rpc_auth.cfg is read by boinccmd binary directly. +If this plugin is used to fetch data from remote system, the gui_rpc_auth.cfg +can be copied to special directory in a secure way (e.g. via scp) and properly protected by file permissions. =head1 INTERPRETATION -This plugin shows the number of currently running BOINC tasks on the machine. -If machine is attached to several BOINC projects, data for all these projects +This plugin shows the number of currently running BOINC tasks on the machine. +If machine is attached to several BOINC projects, data for all these projects are displayed. =head1 EXAMPLES =head2 Local BOINC Example -BOINC is running on local machine. The BOINC binaries are installed in +BOINC is running on local machine. The BOINC binaries are installed in F, the BOINC is running in directory -F under username boinc, group boinc and the password is used +F under username boinc, group boinc and the password is used to protect access to BOINC: [boinc_*] @@ -349,17 +349,17 @@ to protect access to BOINC: =head2 Remote BOINC Example -BOINC is running on 2 remote machines C and C. -On the local machine the binary of command-line interface is installed in +BOINC is running on 2 remote machines C and C. +On the local machine the binary of command-line interface is installed in directory F. -The BOINC password used on the remote machine C is stored in file +The BOINC password used on the remote machine C is stored in file F. -The BOINC password used on the remote machine C is stored in file +The BOINC password used on the remote machine C is stored in file F. -These files are owned and readable by root, readable by group munin and not -readable by others. -There are 2 symbolic links to this plugin created in the munin plugins -directory (usually F): F and +These files are owned and readable by root, readable by group munin and not +readable by others. +There are 2 symbolic links to this plugin created in the munin plugins +directory (usually F): F and F [boincprojs_foo] @@ -379,12 +379,12 @@ SNMP and IPMI plugins. =head1 BUGS -There is no C capability at the moment. This is due to the fact, that -BOINC installations may vary over different systems, sometimes using default -directory from distribution (e.g. F in Debian or Ubuntu), but +There is no C capability at the moment. This is due to the fact, that +BOINC installations may vary over different systems, sometimes using default +directory from distribution (e.g. F in Debian or Ubuntu), but often running in user directories or in other separate directories. -Also the user-ID under which BOINC runs often differs. -Under these circumstances the C would be either lame or too +Also the user-ID under which BOINC runs often differs. +Under these circumstances the C would be either lame or too complicated. =head1 AUTHOR diff --git a/plugins/boinc/boinc_wus b/plugins/boinc/boinc_wus index 3c9515cc..d5a4b5dd 100755 --- a/plugins/boinc/boinc_wus +++ b/plugins/boinc/boinc_wus @@ -317,7 +317,7 @@ Linux machines running BOINC and munin-node - or - -Linux servers (running munin-node) used to collect data from other systems +Linux servers (running munin-node) used to collect data from other systems which are running BOINC, but not running munin-node (e.g. non-Linux systems) =head1 CONFIGURATION @@ -348,45 +348,45 @@ Display unusual states details (default: 0 = Summarize unusual states as C -Password for BOINC (default: none) +Password for BOINC (default: none) =back =head2 B -Using of variable B poses a security risk. Even if the Munin -configuration file for this plugin containing BOINC-password is properly -protected, the password is exposed as environment variable and finally passed -to boinccmd as a parameter. It is therefore possible for local users of the -machine running this plugin to eavesdrop the BOINC password. +Using of variable B poses a security risk. Even if the Munin +configuration file for this plugin containing BOINC-password is properly +protected, the password is exposed as environment variable and finally passed +to boinccmd as a parameter. It is therefore possible for local users of the +machine running this plugin to eavesdrop the BOINC password. -Using of variable password is therefore strongly discouraged and is left here +Using of variable password is therefore strongly discouraged and is left here as a legacy option and for testing purposes. -It should be always possible to use B variable instead - in such case -the file gui_rpc_auth.cfg is read by boinccmd binary directly. -If this plugin is used to fetch data from remote system, the gui_rpc_auth.cfg -can be copied to special directory in a secure way (e.g. via scp) and properly +It should be always possible to use B variable instead - in such case +the file gui_rpc_auth.cfg is read by boinccmd binary directly. +If this plugin is used to fetch data from remote system, the gui_rpc_auth.cfg +can be copied to special directory in a secure way (e.g. via scp) and properly protected by file permissions. =head1 INTERPRETATION -This plugin shows how many BOINC workunits are in all the various states. -The most important states C, C, C, -C, C, C and C are always +This plugin shows how many BOINC workunits are in all the various states. +The most important states C, C, C, +C, C, C and C are always displayed. All other states are shown as C. -If the variable B is used, additionally also states -C and C are shown separately (they are included in -C otherwise). +If the variable B is used, additionally also states +C and C are shown separately (they are included in +C otherwise). =head1 EXAMPLES =head2 Local BOINC Example -BOINC is running on local machine. The BOINC binaries are installed in +BOINC is running on local machine. The BOINC binaries are installed in F, the BOINC is running in directory -F under username boinc, group boinc and the password is used +F under username boinc, group boinc and the password is used to protect access to BOINC: [boinc_*] @@ -397,17 +397,17 @@ to protect access to BOINC: =head2 Remote BOINC Example -BOINC is running on 2 remote machines C and C. -On the local machine the binary of command-line interface is installed in +BOINC is running on 2 remote machines C and C. +On the local machine the binary of command-line interface is installed in directory F. -The BOINC password used on the remote machine C is stored in file +The BOINC password used on the remote machine C is stored in file F. -The BOINC password used on the remote machine C is stored in file +The BOINC password used on the remote machine C is stored in file F. -These files are owned and readable by root, readable by group munin and not -readable by others. -There are 2 symbolic links to this plugin created in the munin plugins -directory (usually F): F and +These files are owned and readable by root, readable by group munin and not +readable by others. +There are 2 symbolic links to this plugin created in the munin plugins +directory (usually F): F and F [snmp_foo_boinc*] @@ -422,17 +422,17 @@ F env.host bar env.boincdir /etc/munin/boinc/bar -This way the plugin can be used by Munin the same way as the Munin plugins +This way the plugin can be used by Munin the same way as the Munin plugins utilizng SNMP (although this plugin itself does not use SNMP). =head1 BUGS -There is no C capability at the moment. This is due to the fact, that -BOINC installations may vary over different systems, sometimes using default -directory from distribution (e.g. F in Debian or Ubuntu), but +There is no C capability at the moment. This is due to the fact, that +BOINC installations may vary over different systems, sometimes using default +directory from distribution (e.g. F in Debian or Ubuntu), but often running in user directories or in other separate directories. -Also the user-ID under which BOINC runs often differs. -Under these circumstances the C would be either lame or too +Also the user-ID under which BOINC runs often differs. +Under these circumstances the C would be either lame or too complicated. =head1 AUTHOR diff --git a/plugins/bsd/df_abs_bsd b/plugins/bsd/df_abs_bsd index 1c40bd57..ecbe233a 100755 --- a/plugins/bsd/df_abs_bsd +++ b/plugins/bsd/df_abs_bsd @@ -57,7 +57,7 @@ graph_info Filesystem usage for i in range(1,len(rawdata)): dataline=rawdata[i].split() self.parsed_data[re.sub('/', '_', dataline[0])] = (int(dataline[1]), int(dataline[2]), dataline[5]) - + if __name__ == "__main__": processor = checker() processor.get_data() diff --git a/plugins/bsd/df_bsd b/plugins/bsd/df_bsd index 49390ab5..a2119c37 100755 --- a/plugins/bsd/df_bsd +++ b/plugins/bsd/df_bsd @@ -55,7 +55,7 @@ graph_info Filesystem usage for i in range(1,len(rawdata)): dataline=rawdata[i].split() self.parsed_data[re.sub('/', '_', dataline[0])] = (re.sub('%', '', dataline[4]), dataline[5]) - + if __name__ == "__main__": processor = checker() processor.get_data() diff --git a/plugins/bsd/spamd-blacklist-bsd b/plugins/bsd/spamd-blacklist-bsd index 257f980c..f95f344b 100755 --- a/plugins/bsd/spamd-blacklist-bsd +++ b/plugins/bsd/spamd-blacklist-bsd @@ -77,4 +77,4 @@ black.label Blacklisted""" processor = checker(blacklists) processor.process_lines(logfile) print processor - + diff --git a/plugins/bsd/spamd-tarpit-bsd b/plugins/bsd/spamd-tarpit-bsd index 6989aea5..d547b03c 100755 --- a/plugins/bsd/spamd-tarpit-bsd +++ b/plugins/bsd/spamd-tarpit-bsd @@ -68,4 +68,4 @@ tarpit.label Average tarpit delay""" processor = checker() processor.process_lines(logfile) print processor - + diff --git a/plugins/celery/celery_tasks b/plugins/celery/celery_tasks index ee65d17f..668e2524 100755 --- a/plugins/celery/celery_tasks +++ b/plugins/celery/celery_tasks @@ -79,7 +79,7 @@ def get_data(what, api_url, *args): except IOError: print 'Could not connect to the celerymon webserver' sys.exit(-1) - + def check_web_server_status(api_url): try: request = urllib.urlopen(api_url) @@ -104,25 +104,25 @@ def print_config(task_names): print '%s.type DERIVE' % (clean_task_name(name)) print '%s.min 0' % (clean_task_name(name)) print '%s.info number of %s tasks' % (clean_task_name(name), name) - + # Values def print_values(task_names = None, api_url = None): for task_name in task_names: count = len(get_data('task_details', api_url, task_name)) print '%s.value %d' % (clean_task_name(task_name), count) - + if __name__ == '__main__': task_names = os.environ.get('tasks', None) api_url = os.environ.get('api_url', API_URL) - + check_web_server_status(api_url) - + if not task_names: print 'You need to define at least one task name' sys.exit(-1) - + task_names = task_names.split(',') - + if len(sys.argv) > 1: if sys.argv[1] == 'config': print_config(task_names) diff --git a/plugins/celery/celery_tasks_states b/plugins/celery/celery_tasks_states index e62ab1c4..cf978076 100755 --- a/plugins/celery/celery_tasks_states +++ b/plugins/celery/celery_tasks_states @@ -82,7 +82,7 @@ def get_data(what, api_url, *args): except IOError: print 'Could not connect to the celerymon webserver' sys.exit(-1) - + def check_web_server_status(api_url): try: request = urllib.urlopen(api_url) @@ -115,33 +115,33 @@ def print_config(workers = None): # Values def print_values(workers = None, api_url = None): data = get_data('tasks', api_url) - + counters = dict([(key, 0) for key in TASK_STATES]) for task_name, task_data in data: state = task_data['state'] hostname = task_data['worker']['hostname'] - + if workers and hostname not in workers: continue - + counters[state] += 1 - + for name in TASK_STATES: name_cleaned = clean_state_name(name) value = counters[name] print '%s.value %d' % (name_cleaned, value) - + if __name__ == '__main__': workers = os.environ.get('workers', 'all') api_url = os.environ.get('api_url', API_URL) - + check_web_server_status(api_url) - + if workers in [None, '', 'all']: workers = None else: workers = workers.split(',') - + if len(sys.argv) > 1: if sys.argv[1] == 'config': print_config(workers) @@ -149,4 +149,4 @@ if __name__ == '__main__': print 'yes' else: print_values(workers, api_url) - + diff --git a/plugins/ceph/ceph-osd-info b/plugins/ceph/ceph-osd-info index 96933ce2..d4dd4e8c 100755 --- a/plugins/ceph/ceph-osd-info +++ b/plugins/ceph/ceph-osd-info @@ -31,7 +31,7 @@ Jort Bloem This is one of the first programs I wrote in Python. I got carried away by Python's powerful one-line commands. Just because you can, doesn't -mean you should. +mean you should. This program needs a rewrite, and if there were any problems with it, I probably would. @@ -102,7 +102,7 @@ def read_osd(filename): return json.loads(result) except: pass - + return None def osd_list(): diff --git a/plugins/ceph/ceph_capacity b/plugins/ceph/ceph_capacity index 42a9685c..05e45b38 100755 --- a/plugins/ceph/ceph_capacity +++ b/plugins/ceph/ceph_capacity @@ -36,7 +36,7 @@ WARNING_LEVEL=${warning_level:-"80"} CRITICAL_LEVEL=${critical_level:-"90"} if [ "$1" = "config" ]; then - + echo 'graph_title CEPH capacity' echo 'graph_category fs' echo 'graph_vlabel GB' diff --git a/plugins/ceph/ceph_osd b/plugins/ceph/ceph_osd index 9d208b53..de8a0fd2 100755 --- a/plugins/ceph/ceph_osd +++ b/plugins/ceph/ceph_osd @@ -28,7 +28,7 @@ fi if [ "$1" = "config" ]; then - + echo 'graph_title CEPH OSDs' echo 'graph_category fs' echo 'graph_vlabel nr' diff --git a/plugins/change.org/changeorg_signature_count b/plugins/change.org/changeorg_signature_count index b9e7ab8a..775c8af7 100755 --- a/plugins/change.org/changeorg_signature_count +++ b/plugins/change.org/changeorg_signature_count @@ -65,7 +65,7 @@ for i in environ.get('petitions').split(): continue # NB: user-agent's tweak is needed to avoid a 403 req = urllib.request.Request("https://api.change.org/v1/petitions/{}?api_key={}&fields=title".format(i, environ.get('APIkey')), - data=None, + data=None, headers={ 'User-Agent': 'curl/7.38.0' }) response = urllib.request.urlopen(req).read().decode('utf-8') petition_titles[i] = json.loads(response) diff --git a/plugins/chat/tinychat_users_ b/plugins/chat/tinychat_users_ index b9c8d258..4e0a1fbb 100755 --- a/plugins/chat/tinychat_users_ +++ b/plugins/chat/tinychat_users_ @@ -4,7 +4,7 @@ ######################### # Munin Plugin to track monitor the number of users a tinychat room gets. # Author Phil Wray ( http://www.infjs.com ) -# +# # # # Usage: @@ -40,7 +40,7 @@ echo "graph_title Tinychat Users for $room" echo 'total_count.label Room Users' echo 'total_count.draw AREA' echo 'broadcaster_count.draw STACK' - echo 'broadcaster_count.label Broadcasting' + echo 'broadcaster_count.label Broadcasting' exit 0 fi diff --git a/plugins/cherokee/munin-plugin-for-cherokee b/plugins/cherokee/munin-plugin-for-cherokee index 17e878bf..157ff744 100755 --- a/plugins/cherokee/munin-plugin-for-cherokee +++ b/plugins/cherokee/munin-plugin-for-cherokee @@ -82,7 +82,7 @@ def get_data(): base64string = base64.standard_b64encode('%s:%s' % (http_user, http_pass)) if len(http_user) > 0 and len(http_pass) > 0: #print "DEBUG: AUTH: " + base64string - request.add_header("Authorization", "Basic %s" % base64string) + request.add_header("Authorization", "Basic %s" % base64string) #print "DEBUG: GET: " + url raw_data = urllib2.urlopen(request).read() #print "DEBUG: " + raw_data @@ -129,7 +129,7 @@ def munin_config(response): for key in section: print key + '.label ' + key.capitalize() print key + '.draw AREASTACK' - + if len(sys.argv) > 1 and sys.argv[1] == "config": munin_config(get_data()) else: diff --git a/plugins/chilli/chilli_sessions_ b/plugins/chilli/chilli_sessions_ index 1e73f349..6c3dd9b0 100755 --- a/plugins/chilli/chilli_sessions_ +++ b/plugins/chilli/chilli_sessions_ @@ -80,7 +80,7 @@ case "$1" in done echo "total" - + exit 0 ;; config) diff --git a/plugins/clamav/clamav b/plugins/clamav/clamav index 042a3d4e..16f9979c 100755 --- a/plugins/clamav/clamav +++ b/plugins/clamav/clamav @@ -4,7 +4,7 @@ log=/var/log/clamav/clamd.log if [ "$1" = "autoconf" ]; then - if [ -r $log ]; then + if [ -r $log ]; then echo "yes" else echo "no (cannot read $log)" @@ -16,7 +16,7 @@ if [ "$1" = "config" ]; then cat < /dev/null || rm -f $pidfile } @@ -33,7 +33,7 @@ run_daemon() { run_watchdog if [ -f $pidfile ]; then touch $pidfile - else + else $pluginfull acquire & fi } @@ -54,9 +54,9 @@ graph_title $graph graph_category 1sec graph_vlabel average cpu use % graph_scale no -graph_total All CPUs +graph_total All CPUs update_rate 1 -graph_data_size custom 1d, 10s for 1w, 1m for 1t, 5m for 1y +graph_data_size custom 1d, 10s for 1w, 1m for 1t, 5m for 1y EOF cpun=0 for ((i=0; i<$cpus; i++)); do diff --git a/plugins/cpu/process_count b/plugins/cpu/process_count index 0802c8cd..166a02dd 100755 --- a/plugins/cpu/process_count +++ b/plugins/cpu/process_count @@ -26,7 +26,7 @@ -if [ "$1" = "autoconf" ] ; then +if [ "$1" = "autoconf" ] ; then if [ -n "$procs" ] ; then echo "yes" else @@ -49,23 +49,23 @@ if [ "$1" = "config" ] ; then echo 'graph_scale no' echo 'graph_period second' echo "graph_order $cprocs" - - for proc in $procs; do + + for proc in $procs; do cproc=${proc//[^A-Za-z0-9_]/_} echo "${cproc}.label $proc" echo "${cproc}.info CPU used by process $proc" done ; - + exit fi for proc in $procs ; do { cproc=${proc//[^A-Za-z0-9_]/_} ps axo '%mem,comm,command' | grep -v grep | grep "$proc" | LC_ALL=us_US awk ' - BEGIN { - SUM=0 + BEGIN { + SUM=0 } - { + { SUM+=1 COMM=$2 } diff --git a/plugins/cpu/process_cpushare b/plugins/cpu/process_cpushare index d6ee3dc2..029ac9d0 100755 --- a/plugins/cpu/process_cpushare +++ b/plugins/cpu/process_cpushare @@ -26,7 +26,7 @@ -if [ "$1" = "autoconf" ] ; then +if [ "$1" = "autoconf" ] ; then if [ -n "$procs" ] ; then echo "yes" else @@ -49,13 +49,13 @@ if [ "$1" = "config" ] ; then echo 'graph_scale no' echo 'graph_period second' echo "graph_order $cprocs" - - for proc in $procs; do + + for proc in $procs; do cproc=${proc//[^A-Za-z0-9_]/_} echo "${cproc}.label $proc" echo "${cproc}.info CPU used by process $proc" done ; - + exit fi @@ -64,14 +64,14 @@ fi for proc in $procs ; do { cproc=${proc//[^A-Za-z0-9_]/_} ps axo 'pcpu,comm,command' | grep -v grep | grep "$proc" | LC_ALL=us_US awk ' - BEGIN { - SUM=0 + BEGIN { + SUM=0 } - { - SUM+=$1 + { + SUM+=$1 } - END { - print "'${cproc}'.value "SUM + END { + print "'${cproc}'.value "SUM } ' } diff --git a/plugins/currency/nanopool/nanopool_ b/plugins/currency/nanopool/nanopool_ index 3bc8bed0..7338734a 100755 --- a/plugins/currency/nanopool/nanopool_ +++ b/plugins/currency/nanopool/nanopool_ @@ -75,7 +75,7 @@ except: from urllib2 import Request from urllib2 import urlopen from urllib2 import URLError - + def define_graph_types(): @@ -131,7 +131,7 @@ def request_data(): print("API request error: {0}". format(err), file=sys.stderr) exit(1) except: - print("Unhandled error:", sys.exc_info()[0]) + print("Unhandled error:", sys.exc_info()[0]) exit(1) try: result = json.loads(txt.decode("utf-8")) @@ -158,7 +158,7 @@ def write_config_worker(): print("worker_{0}_hashrate.info Hashrate of worker '{1}'".format(worker_name, val["id"])) print("worker_{0}_hashrate.min 0".format(worker_name)) print("worker_{0}_hashrate.draw LINE1".format(worker_name)) - + for val in worker_data: print("") worker_name = "_".join(val["id"].split()) @@ -234,7 +234,7 @@ def write_data_worker(data): print("") print("multigraph worker_shares_{0}.worker_{1}".format(account_address, worker_name)) print("wshares.value {0} ".format(val["rating"])) - + def write_config(): diff --git a/plugins/cyrus/cyrus-imapd b/plugins/cyrus/cyrus-imapd index 4492b7a1..dbb28a50 100755 --- a/plugins/cyrus/cyrus-imapd +++ b/plugins/cyrus/cyrus-imapd @@ -25,7 +25,7 @@ cyrus-imapd - Munin plugin to monitor the load on a cyrus imapd server =head1 CONFIGURATION The user running this plugin needs read and write access to the -cyrus-imapd proc directory. You will need to add the following to the +cyrus-imapd proc directory. You will need to add the following to the munin-node/plugin configuration: [cyrus-imapd] @@ -87,8 +87,8 @@ if [ "x${PROCDIR}x" = "xx" ]; then fi # If run with the "config"-parameter, give out information on how the -# graphs should look. - +# graphs should look. + if [ "$1" = "config" ]; then echo 'graph_title Cyrus IMAPd Load' echo 'graph_args --base 1000 -l 0' diff --git a/plugins/darwin/dar_cpuusage b/plugins/darwin/dar_cpuusage index 788cbfeb..056dba02 100755 --- a/plugins/darwin/dar_cpuusage +++ b/plugins/darwin/dar_cpuusage @@ -91,7 +91,7 @@ for ( $i = 1; ($i < $#top and $quit == 0); $i++ ) { print "sys.value " . $sys . "\n"; print "user.value " . $usr . "\n"; print "idle.value " . $idl . "\n"; - $quit = 1; + $quit = 1; } } diff --git a/plugins/darwin/dar_uptime b/plugins/darwin/dar_uptime index 5271d453..2a49173d 100755 --- a/plugins/darwin/dar_uptime +++ b/plugins/darwin/dar_uptime @@ -1,4 +1,4 @@ -#!/usr/bin/perl +#!/usr/bin/perl # -*- perl -*- =head1 NAME @@ -69,10 +69,10 @@ if ( defined($ARGV[0])) { } } -@uptime = `/usr/bin/uptime`; +@uptime = `/usr/bin/uptime`; foreach(@uptime) { $_ =~ m/^.+up (.+?), \d+ us.+$/; - $timestr = $1; + $timestr = $1; if ( $timestr =~ m/^(\d+) day.+?$/ ) { $days = $1; } else { $days = 0; } diff --git a/plugins/darwin/dar_vpnd b/plugins/darwin/dar_vpnd index f454429b..ab1e9f73 100755 --- a/plugins/darwin/dar_vpnd +++ b/plugins/darwin/dar_vpnd @@ -32,12 +32,12 @@ my $cmd = "ps -ef | awk '/[p]ppd/ {print substr(\$NF,2);}' | wc -l"; if ( exists $ARGV[0] and $ARGV[0] eq "config" ) { print "graph_category network\n"; - print "graph_args --base 1024 -r --lower-limit 0\n"; + print "graph_args --base 1024 -r --lower-limit 0\n"; print "graph_title Number of VPN Connections\n"; print "graph_vlabel VPN Connections\n"; - print "graph_info The Graph shows the Number of VPN Connections\n"; + print "graph_info The Graph shows the Number of VPN Connections\n"; print "connections.label Number of VPN Connections\n"; - print "connections.type GAUGE\n"; + print "connections.type GAUGE\n"; } else { my $output = `$cmd`; print "connections.value $output"; diff --git a/plugins/dhcp/dhcp-pool b/plugins/dhcp/dhcp-pool index 14874d99..09f39666 100755 --- a/plugins/dhcp/dhcp-pool +++ b/plugins/dhcp/dhcp-pool @@ -51,7 +51,7 @@ elsif ( defined $ARGV[0] and $ARGV[0] eq "config" ) { # Determine the available IP pools %pools = determine_pools(); - + # Print a label for each pool foreach $start (keys %pools) { $label = ip2string($start); @@ -63,10 +63,10 @@ elsif ( defined $ARGV[0] and $ARGV[0] eq "config" ) { } else { my (@activeleases, %pools, $start, $end, $size, $free, $label, $lease); - - # Determine all leased IP addresses + + # Determine all leased IP addresses @activeleases = determine_active_leases(); - + # Determine the available IP pools %pools = determine_pools(); @@ -109,14 +109,14 @@ sub determine_pools { # The range statement gives the lowest and highest IP addresses in a range. $size = $end - $start + 1; - + $pools{$start} = $size; } } return %pools; } -# Very simple parser for dhcpd.leases. This will break very easily if dhcpd decides to +# Very simple parser for dhcpd.leases. This will break very easily if dhcpd decides to # format the file differently. Ideally a simple recursive-descent parser should be used. # # Returns an array with currently leased IP's @@ -155,7 +155,7 @@ sub determine_active_leases { } } - + # Set TZ back to its original setting if (defined($mytz)) { $ENV{'TZ'} = $mytz; @@ -186,9 +186,9 @@ sub string2ip { } return undef; } - + # -# Returns a dotted quad notation of an +# Returns a dotted quad notation of an # sub ip2string { my $ip = shift; diff --git a/plugins/disk/btrfs_subvol_usage b/plugins/disk/btrfs_subvol_usage index 887eacc6..cba66d98 100755 --- a/plugins/disk/btrfs_subvol_usage +++ b/plugins/disk/btrfs_subvol_usage @@ -19,8 +19,8 @@ env.fsroot /path/to/btrfs/filesystem =head1 USAGE -Link/Copy this plugin to /etc/munin/plugins/ and restart the munin-node. - +Link/Copy this plugin to /etc/munin/plugins/ and restart the munin-node. + =head1 AUTHOR Alexander Knöbel diff --git a/plugins/disk/df_with_nfs b/plugins/disk/df_with_nfs index 08f25b3f..d1a19697 100755 --- a/plugins/disk/df_with_nfs +++ b/plugins/disk/df_with_nfs @@ -60,7 +60,7 @@ if [ "$1" = "autoconf" ]; then fi clean_name() { - echo $1 $7 $2 | sed 's/[\/.-]/_/g'| awk "{ + echo $1 $7 $2 | sed 's/[\/.-]/_/g'| awk "{ if (\$3 == \"tmpfs\") n=\$1\$2 else @@ -80,12 +80,12 @@ if [ "$1" = "config" ]; then df -T -P -l -x none -x unknown -x udf -x iso9660 -x romfs -x ramfs -x tmpfs | sed 1d | grep -v "//" | sort | while read i; do name=`clean_name $i` echo -n "$name.label " - echo $i | awk "{ + echo $i | awk "{ dir=\$7 if (length(dir) <= $MAXLABEL) print dir else - printf (\"...%s\n\", substr (dir, length(dir)-$MAXLABEL+4, $MAXLABEL-3)) + printf (\"...%s\n\", substr (dir, length(dir)-$MAXLABEL+4, $MAXLABEL-3)) print \"$name.info \" \$7 \" (\" \$2 \") -> \" \$1; }" echo "$name.warning 92" diff --git a/plugins/disk/du b/plugins/disk/du index f0133d49..4f125077 100755 --- a/plugins/disk/du +++ b/plugins/disk/du @@ -16,10 +16,10 @@ # Requirements # - bash (or change first line to sh instead of bash or any other shell) # - existing and readable directory to scan -# - du command, it exists on most of the *nix operating systems +# - du command, it exists on most of the *nix operating systems # ################################################################# -# +# # Configuration # # directory to check @@ -44,8 +44,8 @@ ID=1; # Changelog # # Revision 0.1 Tue 03 Feb 2009 02:16:02 PM CET _KaszpiR_ -# - initial release, -# +# - initial release, +# ################################################################# # Magick markers (optional - used by munin-config and som installation # scripts): diff --git a/plugins/disk/e2 b/plugins/disk/e2 index 4eaed72e..ea6a0d3c 100755 --- a/plugins/disk/e2 +++ b/plugins/disk/e2 @@ -33,7 +33,7 @@ print_details() { val=`echo ${line#*:}` val1=${val%% *} [ -z "$line" ] && break - + case "$key" in "Mount count") myname=$1; mc=$val ;; "Maximum mount count") mmc=$val ;; @@ -90,7 +90,7 @@ if [ "$1" = "config" ]; then echo "graph_category disk" args="-l 0" case "$plugin" in - mounts) + mounts) echo "graph_vlabel times" echo "graph_title Ext2 Filesystem mount details" ;; @@ -98,14 +98,14 @@ if [ "$1" = "config" ]; then echo "graph_vlabel days" echo "graph_title Ext2 Filesystem fsck interval" ;; - writes) + writes) args="$args --base 1024" echo "graph_vlabel bytes" echo "graph_title Ext2 Filesystem lifetime writes$blkdevAppend" ;; esac echo "graph_args $args" - + if [ -z "$blkdev" ]; then lse2 else diff --git a/plugins/disk/file_age b/plugins/disk/file_age index 29636d14..52743de3 100755 --- a/plugins/disk/file_age +++ b/plugins/disk/file_age @@ -8,23 +8,23 @@ case $1 in COUNTER=1 while [ $COUNTER -gt 0 ]; do FILE_PATH="file${COUNTER}_path" - + # Is the path for this file specified? eval FILE=\$$FILE_PATH if [ "$FILE" == "" ]; then break; fi - + # It is! Add it to the graphs. GRAPH_ORDER="$GRAPH_ORDER file_$COUNTER" - + # Does this file have a specified label? LABEL_COUNTER="file${COUNTER}_label" eval LABEL=\$$LABEL_COUNTER if [ "$LABEL" == "" ]; then LABEL=`basename $FILE` fi - + # Associated warning level? WARNING="file${COUNTER}_warning" eval WARNING=\$$WARNING @@ -44,7 +44,7 @@ case $1 in echo "file_$COUNTER.min 0" let COUNTER=COUNTER+1 done; - + echo "graph_order $GRAPH_ORDER" echo "graph_title File age" echo 'graph_args --base 1000 -l 0' @@ -63,14 +63,14 @@ while [ $COUNTER -gt 0 ]; do if [ "$FILE" == "" ]; then break; fi - - # If the file isn't readable, say it's zero. + + # If the file isn't readable, say it's zero. if [ ! -r "$FILE" ]; then VALUE=0 else VALUE=$(($(date +%s) - $(stat -c '%Y' "$FILE"))) fi - + echo "file_$COUNTER.value $VALUE" let COUNTER=COUNTER+1 done; diff --git a/plugins/disk/hdsentinel b/plugins/disk/hdsentinel index dfb1dc36..f4bd3735 100755 --- a/plugins/disk/hdsentinel +++ b/plugins/disk/hdsentinel @@ -1,7 +1,7 @@ #!/bin/bash # -*- sh -*- # -# Multigraph plugin to monitor harddrive temperature, condition, +# Multigraph plugin to monitor harddrive temperature, condition, # performance and estimated remaining lifetime through HDSentinel. # # To use, download the latest HDSentinel for Linux x86 or x64 from diff --git a/plugins/disk/hp_temp b/plugins/disk/hp_temp index 3c524f81..373231b9 100755 --- a/plugins/disk/hp_temp +++ b/plugins/disk/hp_temp @@ -77,7 +77,7 @@ while () $name =~ s/\ /_/g; # add the ID to be 100% unique $name .= '_'.$id; - + if ($mode eq 'config') { # only needed here in config @@ -95,7 +95,7 @@ while () } # calc warning from threshold, 5% less my $warning = sprintf("%.0f", $threshold * 95 / 100); - + print $name.".label ".$location."\n"; print $name.".warning ".$warning."\n"; print $name.".critical ".$threshold."\n"; diff --git a/plugins/disk/lvm_snap_used b/plugins/disk/lvm_snap_used index 91a34012..aabbe460 100755 --- a/plugins/disk/lvm_snap_used +++ b/plugins/disk/lvm_snap_used @@ -3,7 +3,7 @@ # Plugin to monitor the % of allocated area of a LVM snapshot # # Parameters: -# +# # config # autoconf # @@ -12,7 +12,7 @@ # #%# family=auto #%# capabilities=autoconf -# +# # 2011/05/20 - pmoranga - initial version # # 2012/01/27 - Sébastien Gross @@ -35,7 +35,7 @@ fi if [ "$1" = "config" ]; then - echo 'graph_title Allocated space for snapshot' + echo 'graph_title Allocated space for snapshot' echo 'graph_vlabel %' echo 'graph_category disk' echo 'graph_args -l 0 -u 100 -r' @@ -48,7 +48,7 @@ ${lvdisplay} -C | awk '$3 ~ /^s/{print}' | while read line; do origin="$(echo $line | awk '{print $5}')" origin="$(clean_fieldname "$origin")" percent="$(echo $line | awk '{print $6}')" - + if [ "$1" = "config" ]; then echo "$id.label $name snapshot of $origin" else diff --git a/plugins/disk/megaraid-controller-information b/plugins/disk/megaraid-controller-information index fdb19eec..6b18b4d5 100755 --- a/plugins/disk/megaraid-controller-information +++ b/plugins/disk/megaraid-controller-information @@ -1,72 +1,72 @@ #!/usr/bin/perl -w # -# Munin plugin for MegaRAID +# Munin plugin for MegaRAID # This plugin can graph:- Currently Drive Temperature and Error Count -# +# #--------------------- # Examples # Create a symbolic link to MegaRaid__ # ln -s /usr/share/munin/plugins/MegaRaid_ /etc/munin/plugins/MegaRaid_0_temp # graph temperature on adapter 0 -# +# # ln -s /usr/share/munin/plugins/MegaRaid_ /etc/munin/plugins/MegaRaid_0_error # graph media errors on adapter 0 -# +# # ln -s /usr/share/munin/plugins/MegaRaid_ /etc/munin/plugins/MegaRaid_1_temp # graph temperature on adapter 1 -# +# #--------------------- # Log # Revision 0.1 2011/04/16 idobson # -First version only basic support of the MegaRaid controller -# +# # Revision 0.2 2011/04/17 fkatzenb # -Added bash statement to remove the log file created each time MegaCli64 is ran # -Added a few comments and visual changes -# +# # Revision 1.0 2011/04/17 fkatzenb # -Revamped Code to symbolic link for sensor type and future growth -# +# # Revision 1.1 2011/04/17 fkatzenb # -Revised scalling -# +# # Revision 1.2 2011/04/28 fkatzenb # -Added support for graph_info support # -Added warning & critical alerts support # -Added data info -# +# # Revision 2.0 2011/04/29 fkatzenb # -Added remaining support for SMART Errors -# +# # Revision 2.1 2011/04/29 fkatzenb # -Added version information for in the graph description -# -# +# +# #--------------------- -# +# # Add the following to your /etc/munin/plugin-conf.d/munin-node: -# +# # [MegaRaid_*] # user root -# +# #--------------------- -# -# +# +# # Magic markers (optional - used by munin-config and installation scripts): -# +# #%# family=auto #%# capabilities=autoconf -# +# my $DisplayVer=2.1; use strict; use warnings; my $DevID=0; #Device Number found -my $DevData=0; #Device Data found +my $DevData=0; #Device Data found # Parse out Adapter number and parameter desired from file name and remove whitespace -my $Parameters=`basename $0 | sed 's/^MegaRaid_//g' | tr '_' '-'` ; +my $Parameters=`basename $0 | sed 's/^MegaRaid_//g' | tr '_' '-'` ; chomp $Parameters; my ($Adapter,$Type)=split(/-/,$Parameters); @@ -128,13 +128,13 @@ if ($ARGV[0] and $ARGV[0] eq "autoconf" ) { print "yes\n"; exit 0; } else { - print "no\n"; + print "no\n"; exit 1 } } #Read Output of MegaRaid command -$Command.=" -PDList -a".$Adapter; +$Command.=" -PDList -a".$Adapter; my @Output=qx($Command); #Munin Config Options @@ -145,14 +145,14 @@ if ($ARGV[0] and $ARGV[0] eq "config"){ print "graph_scale yes\n"; print "graph_category disk\n"; print "graph_info $config{$Type}->{description}
Generated by MegaRaid_, Version $DisplayVer
\n"; - + foreach my $Line (@Output) { $Line=~ s/\r//g; $Line=~ s/\n//g; - + #Find the device ID - if ( $Line=~ m/Slot Number: /i ) { - $DevID=$Line; + if ( $Line=~ m/Slot Number: /i ) { + $DevID=$Line; $DevID=~ s/Slot Number: //; print "A".$Adapter."_D".$DevID."_$Type.label A$Adapter:D$DevID $config{$Type}->{label}\n"; print "A".$Adapter."_D".$DevID."_$Type.info Adapter: $Adapter / Drive: $DevID - $config{$Type}->{info_tag}\n"; @@ -161,9 +161,9 @@ if ($ARGV[0] and $ARGV[0] eq "config"){ } if ($config{$Type}->{critical} ne '') { print "A".$Adapter."_D".$DevID."_$Type.critical $config{$Type}->{critical}\n"; - } + } } - } + } exit 0; } @@ -176,7 +176,7 @@ foreach my $Line (@Output) { if ( $Line=~ m/Slot Number: /i ) { $DevID=$Line; $DevID=~ s/Slot Number: //; chomp $DevID; } #Find the data and print it out - if ( $Line=~ m/$config{$Type}->{lookfor}/i ) { + if ( $Line=~ m/$config{$Type}->{lookfor}/i ) { $DevData=$Line; $DevData=~s/$config{$Type}->{lookfor}//; $DevData=~s/C.*//; diff --git a/plugins/disk/megaraid-hdd-temperature-using-megacli b/plugins/disk/megaraid-hdd-temperature-using-megacli index bb45ee9c..261ba7c4 100755 --- a/plugins/disk/megaraid-hdd-temperature-using-megacli +++ b/plugins/disk/megaraid-hdd-temperature-using-megacli @@ -1,8 +1,8 @@ #!/bin/bash # Plugin to monitor harddrive temperatures connected to a MegaRAID controller -# -# Plugin must be ran as root so add these configuration in +# +# Plugin must be ran as root so add these configuration in # /etc/munin/plugin-conf.d/munin-node. # # [megacli*] diff --git a/plugins/disk/quota2percent_ b/plugins/disk/quota2percent_ index 6b3e6c62..91e16315 100755 --- a/plugins/disk/quota2percent_ +++ b/plugins/disk/quota2percent_ @@ -28,18 +28,18 @@ You could define two alert levels, the graph language, min. human UID and dealin env.humanuid [value] (default: 1000, only need if there is an other value define for UID_MIN in /etc/login.defs) env.low_uid [never|no|yes] (default: never) set to no for producing rrd files for system user, but don't show those graphs (e.g. for later analyses) - if set to yes system user graphs are drawn + if set to yes system user graphs are drawn =head1 DESCRIPTION -Wild card Plugin for monitoring the utilization of devices with quota rules. -A graph is drawn for each user, which shows the usage as a percentage of his hard limit. System accounts (UID <1000) are suppressed. -In addition, a graph is displayed which indicates the ratio device size to device coverage. -The script repqutoa, usually part of the package quota, is needed. +Wild card Plugin for monitoring the utilization of devices with quota rules. +A graph is drawn for each user, which shows the usage as a percentage of his hard limit. System accounts (UID <1000) are suppressed. +In addition, a graph is displayed which indicates the ratio device size to device coverage. +The script repqutoa, usually part of the package quota, is needed. The plugin itself can be stored in any directory. For example, the device sdb1 shell be monitored, a symbolic link must be created -in the /etc/munin/plugins/ directory as follows: +in the /etc/munin/plugins/ directory as follows: -=over +=over I<<< ln -s //quota2percent_ quota2percent_sdb1 >>> @@ -72,7 +72,7 @@ V17.0214 add example graph for Munin Plugin Gallery remove setting a PATH - remove German comments + remove German comments V17.0124 @@ -83,7 +83,7 @@ V17.0124 Jo Hartmann =head1 LICENSE - + GPLv2 (L) =cut @@ -142,7 +142,7 @@ GPLv2 (L) ################################################### # Reading the quotes for the selected device, using repquota - if repquota "/dev/$Id" &> /dev/null; then + if repquota "/dev/$Id" &> /dev/null; then readarray Quotas < <( repquota "/dev/$Id" | grep " -- " ) else echo "No limitations administered via 'quota' for $Id" >&2 @@ -151,13 +151,13 @@ GPLv2 (L) # the avoidance of a divide-by-zero error Quotas[0]="root -- 1 1 1 1 1 1" - # no rrd file need + # no rrd file need Low_UID="never" fi readarray Totals < <( df "/dev/$Id" ) -# Get the count of Users +# Get the count of Users Users=${#Quotas[@]} @@ -167,7 +167,7 @@ GPLv2 (L) if [ "$1" = "config" ]; then - # Localisation of the graphic texts + # Localisation of the graphic texts case $Language in de) echo "graph_title Quota-Hard-Limit von $Id" @@ -176,9 +176,9 @@ GPLv2 (L) Total_txt="Su. aller Nutzer" Total_info="Inklusive Systemnutzer (UID < $Min_UID)" ;; - es) - echo "graph_title Cuota de límite absoluto de $Id" - echo "graph_vlabel el % de uso del límite duro" + es) + echo "graph_title Cuota de límite absoluto de $Id" + echo "graph_vlabel el % de uso del límite duro" echo "graph_info El gráfico muestra la disponibilidad de espacio regulado por cuotas para todos los usuarios regulares (UID >= $Min_UID) como porcentaje de límites duros." Total_txt="Suma de todos los usuarios " Total_info="La inclusión de usuario del sistema (UID < $Min_UID) " @@ -188,11 +188,11 @@ GPLv2 (L) echo "graph_vlabel Usage in %" echo "graph_info The graphic shows the allocation of the quota-regulated storage space for all regular users (UID >= $Min_UID) as a percentage of the hard limit ." Total_txt="all users" - Total_info="system users (UID < $Min_UID) included" + Total_info="system users (UID < $Min_UID) included" ;; esac - # Defaults configuration + # Defaults configuration echo "graph_category disk" echo "graph_args --lower-limit 0 --upper-limit 100" echo "graph_printf %5.2lf %%" @@ -208,9 +208,9 @@ GPLv2 (L) # Determine the currently processing UID Cur_UID="$(id -u "$User")" - # skip if actual user a system user und low_uid ist set to never + # skip if actual user a system user und low_uid ist set to never [ "$Cur_UID" -lt "$Min_UID" ] && [ "$Low_UID" = "never" ] && continue - + # No graph for none human uid if low_uid ist set to no [ "$Cur_UID" -lt "$Min_UID" ] && echo "$Fieldname.graph $Low_UID" @@ -218,7 +218,7 @@ GPLv2 (L) echo "$Fieldname.label $User" echo "$Fieldname.warning $Warning" echo "$Fieldname.critical $Critical" - + done # configure the total line and send exit code NO ERROR happens @@ -238,15 +238,15 @@ GPLv2 (L) Quota=( ${Quotas[$i]} ) Fieldname="$(clean_fieldname "${Quota[0]}")" - # skip if actual user a system user und low_uid ist set to never + # skip if actual user a system user und low_uid ist set to never [ "$Cur_UID" -lt "$Min_UID" ] && [ "$Low_UID" = "never" ] && continue - # write the result zu munin + # write the result zu munin echo "${Quota[2]} ${Quota[4]} $Fieldname.value" | awk '{printf "%s %f\n",$3,$1*100/$2}' done -# the value for the total line +# the value for the total line Total=( ${Totals[1]} ) echo "${Total[2]} ${Total[1]} total.value" | awk '{printf "%s %f\n",$3,$1*100/$2}' diff --git a/plugins/disk/raid b/plugins/disk/raid index c835757a..bbfc0e8a 100755 --- a/plugins/disk/raid +++ b/plugins/disk/raid @@ -1,11 +1,11 @@ #!/usr/bin/perl -w -# +# # (c) 2007 Nathan Rutman nathan@clusterfs.com -# -# Plugin to monitor RAID status +# +# Plugin to monitor RAID status # # Results are % of healthy drives in a raid device -# and % rebuilt of devices that are resyncing. +# and % rebuilt of devices that are resyncing. # #%# family=contrib #%# capabilities=autoconf @@ -54,7 +54,7 @@ while (@text) { $failed = $members; $failed =~ s/[^F]+//g; $failed = length($failed); - + $line = shift @text; if ($line =~ /$devstat_re/) { # second line should like "123456 blocks super 1.2 [2/2] [UU]" @@ -66,7 +66,7 @@ while (@text) { # second line did not exist on /proc/mdstat next; } - + $line = shift @text; if ($line =~ /$action_re/) { # third line should like " [==>..................] check = 10.0% (12345/123456) finish=123min speed=12345/sec" diff --git a/plugins/disk/raid-mismatch-count b/plugins/disk/raid-mismatch-count index e84c1dd1..5979b53f 100755 --- a/plugins/disk/raid-mismatch-count +++ b/plugins/disk/raid-mismatch-count @@ -3,22 +3,22 @@ # Copyright (C) 2011 Rory Jaffe # derived from md_sync_speed by Kristian Lyngstøl # Copyright (C) 2010 Kristian Lyngstøl -# +# # 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 Street, Fifth Floor, Boston, MA 02110-1301 USA. ##### -# +# # Magic Markers: # #%# family=auto # #%# capabilities=autoconf diff --git a/plugins/disk/scsi_queue b/plugins/disk/scsi_queue index e1c14cf2..0cbf165b 100755 --- a/plugins/disk/scsi_queue +++ b/plugins/disk/scsi_queue @@ -1,7 +1,7 @@ #!/usr/bin/env python """ -Munin plugin which reports queue busy-values per online SCSI +Munin plugin which reports queue busy-values per online SCSI device on Linux, as seen in /proc/scsi/sg/devices If the busy-values often reach the queue depth of the device, @@ -11,7 +11,7 @@ plugin. Wildcard use: If your system has many SCSI-like devices, filtering may be needed to make the resulting graphs readable. -If you symlink the plugin, so that it's executed as +If you symlink the plugin, so that it's executed as scsi_queue_X_through_Y then the plugin will only look at devices /dev/sdX .. /dev/sdY @@ -27,7 +27,7 @@ X and Y are translated into a regular expression like: # Released according to the "New BSD License" AKA the 3-clause # BSD License: -# ==================================================================== +# ==================================================================== # Copyright (c) 2010, Danish National Board of Health. # All rights reserved. # @@ -52,7 +52,7 @@ X and Y are translated into a regular expression like: # ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT # (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS # SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -# ==================================================================== +# ==================================================================== # $Id: scsi_queue 13630 2010-08-31 15:29:14Z tra $ @@ -144,10 +144,10 @@ def map_procentries_to_devices(list_of_dicts,devfilter_regex): # 2:0:0:0 # 3:0:0:0 # - # The colon-separated values map to the first four parts + # The colon-separated values map to the first four parts # of /proc/scsi/sg/devices - # And the directory entries are symlinks which point to directories - # in /sys/devices. By following a symlink, we may end up in + # And the directory entries are symlinks which point to directories + # in /sys/devices. By following a symlink, we may end up in # a directory which contains directory entries like: # - block:sdb # ... @@ -162,7 +162,7 @@ def map_procentries_to_devices(list_of_dicts,devfilter_regex): # Search for dirent called block:SOMETHING # Put SOMETHING into blockdev_name - # Couldn't make glob.glob() work: The length of the result + # Couldn't make glob.glob() work: The length of the result # of glob() returned TypeError: len() of unsized object on # RHEL 5's python... dirents = os.listdir(sys_pathname) diff --git a/plugins/disk/snmp__areca_ b/plugins/disk/snmp__areca_ index dbb41454..e694fd79 100755 --- a/plugins/disk/snmp__areca_ +++ b/plugins/disk/snmp__areca_ @@ -189,7 +189,7 @@ def snmpwalk(root): # Decode SNMP response rsp.decode(answer) - + # Make sure response matches request (request IDs, communities, etc) if req != rsp: raise 'Unmatched response: %s vs %s' % (str(req), str(rsp)) diff --git a/plugins/disk/snmp__hp_temp b/plugins/disk/snmp__hp_temp index c943ef58..8716370e 100755 --- a/plugins/disk/snmp__hp_temp +++ b/plugins/disk/snmp__hp_temp @@ -4,7 +4,7 @@ # # Munin-plugin to monitor temperature on HP-servers. # Uses SNMP, and needs hpasmd. -# +# # 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; version 2 dated June, diff --git a/plugins/disk/xfs b/plugins/disk/xfs index 7f32746c..8a06a555 100755 --- a/plugins/disk/xfs +++ b/plugins/disk/xfs @@ -94,7 +94,7 @@ while () { close(IN); foreach my $func ( keys %config ) { - print "multigraph xfs_$func\n"; + print "multigraph xfs_$func\n"; if (defined $ARGV[0] and $ARGV[0] eq 'config') { print "graph_title $config{$func}->{title}\n"; diff --git a/plugins/disk/xfs_frag b/plugins/disk/xfs_frag index 7218934a..d41d4fcc 100755 --- a/plugins/disk/xfs_frag +++ b/plugins/disk/xfs_frag @@ -37,7 +37,7 @@ shopt -s nocasematch case $1 in config) - cat <<'EOF' + cat <<'EOF' graph_title XFS fragmentation graph_vlabel Percent graph_category disk @@ -64,4 +64,4 @@ do echo $FIELDNAME.value $FRAG fi done - + diff --git a/plugins/dkim/dkimproxy_mails b/plugins/dkim/dkimproxy_mails index 8fe7cfe6..b68e4890 100755 --- a/plugins/dkim/dkimproxy_mails +++ b/plugins/dkim/dkimproxy_mails @@ -10,7 +10,7 @@ # autoconf (optional) # # Gives the result of the verification. The following values are possible: -# +# # pass # Returned if a valid DKIM-Signature header was found, and the signature contains a correct value for the message. # @@ -22,9 +22,9 @@ # # none # Returned if no DKIM-Signature headers (valid or invalid) were found. -# +# # In case of multiple signatures, the "best" result will be returned. Best is defined as "pass", followed by "fail", "invalid", and "none". -# +# mktempfile () { mktemp -t @@ -59,7 +59,7 @@ if [ "$1" = "config" ]; then echo 'dkiminvalid.label Invalid DKIM-Sigs' echo 'dkiminvalid.min 0' echo 'dkimfail.label Failed DKIM-Sigs' - echo 'dkimfail.min 0' + echo 'dkimfail.min 0' exit 0 fi diff --git a/plugins/docker/docker_cpu b/plugins/docker/docker_cpu index e25b7e95..cb56fa90 100755 --- a/plugins/docker/docker_cpu +++ b/plugins/docker/docker_cpu @@ -79,7 +79,7 @@ for my $i (1 .. $#containers) } } } - + if (defined $ARGV[0] and $ARGV[0] eq "config") { my $nanoSecondsInSecond=1000000000; @@ -88,7 +88,7 @@ if (defined $ARGV[0] and $ARGV[0] eq "config") if ($$_{'ncpu'} > $graphlimit){ $graphlimit = $$_{'ncpu'}; } - } + } $graphlimit = $graphlimit * 100; print "graph_title Docker container CPU usage\n"; print "graph_args --base 1000 -r --lower-limit 0 --upper-limit $graphlimit\n"; @@ -97,7 +97,7 @@ if (defined $ARGV[0] and $ARGV[0] eq "config") print "graph_period second\n"; print "graph_category virtualization\n"; print "graph_info This graph shows docker container CPU usage.\n"; - + foreach(@result) { print "$$_{'name'}.label $$_{'name'}\n"; diff --git a/plugins/docker/docker_memory b/plugins/docker/docker_memory index 6e43c0b7..6fba71b4 100755 --- a/plugins/docker/docker_memory +++ b/plugins/docker/docker_memory @@ -81,7 +81,7 @@ if (defined $ARGV[0] and $ARGV[0] eq "config") print "graph_vlabel Bytes\n"; print "graph_category virtualization\n"; print "graph_info This graph shows docker container memory usage.\n"; - + foreach(@result) { print "$$_{'name'}.label $$_{'name'}\n"; diff --git a/plugins/dovecot/dovecot b/plugins/dovecot/dovecot index 303b3ab1..a9e3de10 100755 --- a/plugins/dovecot/dovecot +++ b/plugins/dovecot/dovecot @@ -2,18 +2,18 @@ # # Munin Plugin # to count logins to your dovecot mailserver -# +# # Created by Dominik Schulz # http://developer.gauner.org/munin/ # Contributions by: # - Stephane Enten # - Steve Schnepp -# +# # Parameters understood: # # config (required) # autoconf (optional - used by munin-config) -# +# # Config variables: # # logfile - Where to find the syslog file diff --git a/plugins/drbd/drbd b/plugins/drbd/drbd index 4216902e..49644f9d 100755 --- a/plugins/drbd/drbd +++ b/plugins/drbd/drbd @@ -96,7 +96,7 @@ open (IN, $file ) || die "Could not open $file for reading: $!"; my ($changed) = $_ =~ /changed:(\d*)/; $store->{ $temp }->{'act_log'}->{changed} = $changed if $changed ne undef; } - + my ($ns) = $_ =~ /ns:(\d*)/; $store->{ $temp }->{'ns'} = $ns if $ns ne undef; diff --git a/plugins/drbd/drbd-stat b/plugins/drbd/drbd-stat index 2a6e7259..16e0cae4 100755 --- a/plugins/drbd/drbd-stat +++ b/plugins/drbd/drbd-stat @@ -85,7 +85,7 @@ open (IN, $file ) || die "Could not open $file for reading: $!"; my ($changed) = $_ =~ /changed:(\d*)/; $store->{ $temp }->{'act_log'}->{changed} = $changed if $changed ne undef; } - + my ($ns) = $_ =~ /ns:(\d*)/; $store->{ $temp }->{'ns'} = $ns if $ns ne undef; diff --git a/plugins/dspam/dspam_ b/plugins/dspam/dspam_ index 78e0f390..b301373e 100755 --- a/plugins/dspam/dspam_ +++ b/plugins/dspam/dspam_ @@ -71,7 +71,7 @@ should be in the format: dspam__, where: a total of all uids, or for a list of all uids (depending on the graph type). NB For advanced uid selection such as 'all users of domain - example.org', please see the environment variable 'pattern' + example.org', please see the environment variable 'pattern' under CONFIGURATION. =head1 INTERPRETATION diff --git a/plugins/dvb/2wcomdsr_ b/plugins/dvb/2wcomdsr_ index 86c43265..273d1cc5 100755 --- a/plugins/dvb/2wcomdsr_ +++ b/plugins/dvb/2wcomdsr_ @@ -2,7 +2,7 @@ ################################################################################################### # -# Multigraph munin plugin to monitor 2wcom DSR01/DSR02 Professional Audio Satellite-Receivers +# Multigraph munin plugin to monitor 2wcom DSR01/DSR02 Professional Audio Satellite-Receivers # through their web interface status page. # # To use this plugin, copy it to the munin's plugin directory (eg. /usr/share/munin/plugins) @@ -140,7 +140,7 @@ echo "graph_info Detected bit error rate (BER) before the Reed Solomon error cor echo "ber_rs.label RS/BCH BER" echo "ber_rs.critical 0.0002" echo "ber_rs.info BER before Reed Solomon error correction" -echo +echo exit 0;; esac diff --git a/plugins/dvb/femon b/plugins/dvb/femon index b51a17fb..7d64e106 100755 --- a/plugins/dvb/femon +++ b/plugins/dvb/femon @@ -2,8 +2,8 @@ # -*- encoding: iso-8859-1 -*- # # Wildcard-plugin to monitor DVB signal information via femon command line utility, -# -# To monitor a dvb device, link femon_ to this file. +# +# To monitor a dvb device, link femon_ to this file. # E.g. # ln -s /usr/share/munin/plugins/femon_ /etc/munin/plugins/femon_adapter0 # ...will monitor /dev/dvb/adapter0. @@ -15,13 +15,13 @@ # Parameters # femonpath - Specify path to femon program (Default: /usr/bin/femon) # graph_args - Specify graph args (Default: --lower-limit 0 --upper-limit 100 --rigid) -# +# # Author: Nicolas Knotzer -# +# # v1.0 02/10/2011 # v1.1 20/10/2011 - Prints OSError.strerror in verbose mode, uses rsplit instead of split for parsing femon output # v1.2 21/10/2011 - Uses subprocess.Popen instead of subprocess.check_output for better compatibility with older python versions (i.e. works with python version >= 2.4) -# v1.3 25/10/2011 - Configure upper and lower graph limits with graph_args environment variable. +# v1.3 25/10/2011 - Configure upper and lower graph limits with graph_args environment variable. # # Copyright (c) 2011 Nicolas Knotzer. # @@ -70,7 +70,7 @@ def find_dvb_adapters() : adapters.append(adapter) except : continue - except : + except : verboselog('Failed to list adapters in /dev/dvb') return(adapters) @@ -78,7 +78,7 @@ def get_dvb_adapter_name() : global plugin_name try : name=[plugin_name[string.rindex(plugin_name,'_')+1:]] - + # Check that the adapter exists in /dev/dvb if not os.path.exists('/dev/dvb/'+name[0]): verboselog('/dev/dvb/'+name[0]+' not found!') @@ -117,7 +117,7 @@ def print_dvb_adapter_values(dvb_adapter) : try : verboselog('Reading values from '+dvb_adapter[0]) mypipe = subprocess.Popen([os.getenv('femonpath','/usr/bin/femon'), '-H', '-c 1', '-a '+dvb_adapter[0].replace('adapter','')], stdout=subprocess.PIPE) - femon_output = mypipe.communicate()[0] + femon_output = mypipe.communicate()[0] verboselog(femon_output) except OSError, e: verboselog('Cannot access femon values! Check user rights or proper femon installation.') @@ -145,13 +145,13 @@ if len(sys.argv)>1 : print_adapter_config (dvb_adapter) sys.exit(0) elif sys.argv[1]=="autoconf" : - if os.path.exists(os.getenv('femonpath','/usr/bin/femon')) : + if os.path.exists(os.getenv('femonpath','/usr/bin/femon')) : if not find_dvb_adapters(): print('no (no dvb adapters accessible)') else : print('yes') sys.exit(0) - else : + else : print('no (femon not found)') sys.exit(0) elif sys.argv[1]=="suggest" : @@ -179,16 +179,16 @@ femon_ - Munin wildcard-plugin to monitor dvb signal information attribute value =head1 APPLICABLE SYSTEMS -Node with B interpreter and B +Node with B interpreter and B installed and in function. =head1 CONFIGURATION - + =head2 Create link in service directory To monitor a dvb device, create a link in the service directory of the munin-node named femon_, which is pointing to this file. - + E.g. ln -s /usr/share/munin/plugins/femon_ /etc/munin/plugins/femon_adapter0 @@ -211,7 +211,7 @@ So following minimal configuration in plugin-conf.d/munin-node is needed. =head2 Set Parameter if needed femonpath - Specify path to femon program (Default: /usr/bin/femon) - + =head1 INTERPRETATION diff --git a/plugins/ejabberd/ejabberd_stats_ b/plugins/ejabberd/ejabberd_stats_ index dac2b196..9eb7c184 100755 --- a/plugins/ejabberd/ejabberd_stats_ +++ b/plugins/ejabberd/ejabberd_stats_ @@ -33,7 +33,7 @@ graph_title ejabberd stats - connected users graph_args --base 1000 --lower-limit 0 graph_vlabel users graph_info The number of currently connected users, as of ejabberd report -graph_category chat +graph_category chat graph_order active connected.label Connected users connected.draw AREA diff --git a/plugins/emc/emc_vnx_block_lun_perfdata b/plugins/emc/emc_vnx_block_lun_perfdata index 99a5a440..5520c6e3 100755 --- a/plugins/emc/emc_vnx_block_lun_perfdata +++ b/plugins/emc/emc_vnx_block_lun_perfdata @@ -2,7 +2,7 @@ : <<=cut -=head1 NAME +=head1 NAME emc_vnx_block_lun_perfdata - Plugin to monitor Block statistics of EMC VNX 5300 Unified Storage Processors @@ -23,16 +23,16 @@ =head1 DESCRIPTION The plugin monitors LUN of EMC Unified Storage FLARE SP's. Probably it can also - be compatible with other Clariion systems. It uses SSH to connect to Control - Stations, then remotely executes /nas/sbin/navicli and fetches and parses data + be compatible with other Clariion systems. It uses SSH to connect to Control + Stations, then remotely executes /nas/sbin/navicli and fetches and parses data from it. Obviously, it's easy to reconfigure plugin not to use Control Stations' - navicli in favor of using locally installed /opt/Navisphere's cli. There is no - difference which Storage Processor to use to gather data, so this plugin tries - both of them and uses the first active one. This plugin also automatically - chooses Primary Control Station from the list by calling /nasmcd/sbin/getreason + navicli in favor of using locally installed /opt/Navisphere's cli. There is no + difference which Storage Processor to use to gather data, so this plugin tries + both of them and uses the first active one. This plugin also automatically + chooses Primary Control Station from the list by calling /nasmcd/sbin/getreason and /nasmcd/sbin/t2slot. - - I left some parts of this plugin as rudimental to make easy to reconfigure it + + I left some parts of this plugin as rudimental to make easy to reconfigure it to draw more (or less) data. The plugin has been tested in the following Operating Environment (OE): @@ -41,15 +41,15 @@ =head1 COMPATIBILITY - The plugin has been written for being compatible with EMC VNX5300 Storage - system, as this is the only EMC storage which i have. By the way, i am pretty - sure it can also work with other VNX1 storages, like VNX5100 and VNX5500, and + The plugin has been written for being compatible with EMC VNX5300 Storage + system, as this is the only EMC storage which i have. By the way, i am pretty + sure it can also work with other VNX1 storages, like VNX5100 and VNX5500, and old-style Clariion systems. - About VNX2 series, i don't know whether the plugin will be able to work with - them. Maybe it would need some corrections in command-line backend. The same - situation is with other EMC systems, so i encourage you to try and fix the - plugin. - + About VNX2 series, i don't know whether the plugin will be able to work with + them. Maybe it would need some corrections in command-line backend. The same + situation is with other EMC systems, so i encourage you to try and fix the + plugin. + =head1 LIST OF GRAPHS Graph category Disk: @@ -70,68 +70,68 @@ First of all, be sure that statistics collection is turned on. You can do this by typing: navicli -h spa setstats -on - on your Control Station or locally through /opt/Navisphere + on your Control Station or locally through /opt/Navisphere - Also, the plugin actively uses buggy "cdef" feature of Munin 2.0, and here we + Also, the plugin actively uses buggy "cdef" feature of Munin 2.0, and here we can be hit by the following bugs: - http://munin-monitoring.org/ticket/1017 - Here I have some workarounds in the + http://munin-monitoring.org/ticket/1017 - Here I have some workarounds in the plugin, be sure that they are working. - http://munin-monitoring.org/ticket/1352 - Metrics in my plugin can be much + http://munin-monitoring.org/ticket/1352 - Metrics in my plugin can be much longer than 15 characters. Without these workarounds "Load" and "Queue Length" would not work. =head2 Installation - The plugin uses SSH to connect to Control Stations. It's possible to use + The plugin uses SSH to connect to Control Stations. It's possible to use 'nasadmin' user, but it would be better if you create read-only global user by - Unisphere Client. The user should have only Operator role. - I created "operator" user but due to the fact that Control Stations already - had one internal "operator" user, the new one was called "operator1". So be + Unisphere Client. The user should have only Operator role. + I created "operator" user but due to the fact that Control Stations already + had one internal "operator" user, the new one was called "operator1". So be careful. After that, copy .bash_profile from /home/nasadmin to a newly created /home/operator1. - - On munin-node side choose a user which will be used to connect through SSH. - Generally user "munin" is ok. Then, execute "sudo su munin -s /bin/bash", - "ssh-keygen" and "ssh-copy-id" to both Control Stations with newly created + + On munin-node side choose a user which will be used to connect through SSH. + Generally user "munin" is ok. Then, execute "sudo su munin -s /bin/bash", + "ssh-keygen" and "ssh-copy-id" to both Control Stations with newly created user. - - Make a link from /usr/share/munin/plugins/emc_vnx_dm_basic_stats to - /etc/munin/plugins/emc_vnx_dm_basic_stats_, where is any - arbitrary name of your storage system. The plugin will return in its + + Make a link from /usr/share/munin/plugins/emc_vnx_dm_basic_stats to + /etc/munin/plugins/emc_vnx_dm_basic_stats_, where is any + arbitrary name of your storage system. The plugin will return in its answer as "host_name" field. - + For example, assume your storage system is called "VNX5300". - Make a configuration file at + Make a configuration file at /etc/munin/plugin-conf.d/emc_vnx_block_lun_perfdata_VNX5300. For example: - + [emc_vnx_block_lun_perfdata_VNX5300] - user munin + user munin env.username operator1 - env.cs_addr 192.168.1.1 192.168.1.2 + env.cs_addr 192.168.1.1 192.168.1.2 or: [emc_vnx_block_lun_perfdata_VNX5300] - user munin + user munin env.username operator1 env.localcli /opt/Navisphere/bin/naviseccli env.sp_addr 192.168.0.3 192.168.0.4 env.blockpw foobar - Where: + Where: user - SSH Client local user env.username - Remote user with Operator role for Block or File part env.cs_addr - Control Stations addresses for remote (indirect) access. - env.localcli - Optional. Path of localhost 'Naviseccli' binary. If this + env.localcli - Optional. Path of localhost 'Naviseccli' binary. If this variable is set, env.cs_addr is ignored, and local 'navicli' is used. Requires env.blockpw variable. - env.sp_addr - Default is "SPA SPB". In case of "direct" connection to + env.sp_addr - Default is "SPA SPB". In case of "direct" connection to Storage Processors, their addresses/hostnames are written here. env.blockpw - Password for connecting to Storage Processors =head1 ERRATA - It counts Queue Length in not fully correct way. We take parameters totally + It counts Queue Length in not fully correct way. We take parameters totally from both SP's, but after we divide them independently by load of SPA and SPB. Anyway, in most AAA / ALUA cases the formula is correct. @@ -165,7 +165,7 @@ else NAVICLI="/nas/sbin/navicli" fi -# Prints "10" on stdout if found Primary Online control station. "11" - for Secondary Online control station. +# Prints "10" on stdout if found Primary Online control station. "11" - for Secondary Online control station. ssh_check_cmd() { ssh -q "$username@$1" "/nasmcd/sbin/getreason | grep -w \"slot_\$(/nasmcd/sbin/t2slot)\" | cut -d- -f1 | awk '{print \$1}' " } @@ -253,7 +253,7 @@ echo "host_name ${TARGET}" echo if [ "$1" = "config" ] ; then - cat <<-EOF + cat <<-EOF multigraph emc_vnx_block_blocks graph_category disk graph_title EMC VNX 5300 LUN Blocks @@ -263,7 +263,7 @@ if [ "$1" = "config" ] ; then while read -r LUN ; do LUN="$(clean_fieldname "$LUN")" - cat <<-EOF + cat <<-EOF ${LUN}_read.label none ${LUN}_read.graph no ${LUN}_read.min 0 @@ -304,8 +304,8 @@ if [ "$1" = "config" ] ; then multigraph emc_vnx_block_ticks graph_category disk graph_title EMC VNX 5300 Counted Load per LUN - graph_vlabel Load, % * Number of LUNs - graph_args --base 1000 -l 0 -r + graph_vlabel Load, % * Number of LUNs + graph_args --base 1000 -l 0 -r EOF echo -n "graph_order " while read -r LUN ; do @@ -332,7 +332,7 @@ if [ "$1" = "config" ] ; then ${LUN}_idleticks_spb.label $LUN Idle Ticks SPB ${LUN}_idleticks_spb.type COUNTER ${LUN}_idleticks_spb.graph no - ${LUN}_load_spa.label $LUN load SPA + ${LUN}_load_spa.label $LUN load SPA ${LUN}_load_spa.draw AREASTACK ${LUN}_load_spb.label $LUN load SPB ${LUN}_load_spb.draw AREASTACK @@ -342,7 +342,7 @@ if [ "$1" = "config" ] ; then done <<< "$LUNLIST" cat <<-EOF - + multigraph emc_vnx_block_outstanding graph_category disk graph_title EMC VNX 5300 Sum of Outstanding Requests @@ -351,14 +351,14 @@ if [ "$1" = "config" ] ; then EOF while read -r LUN ; do LUN="$(clean_fieldname "$LUN")" - cat <<-EOF + cat <<-EOF ${LUN}_outstandsum.label $LUN ${LUN}_outstandsum.type COUNTER EOF done <<< "$LUNLIST" cat <<-EOF - + multigraph emc_vnx_block_nonzeroreq graph_category disk graph_title EMC VNX 5300 Non-Zero Request Count Arrivals @@ -392,7 +392,7 @@ if [ "$1" = "config" ] ; then multigraph emc_vnx_block_queue graph_category disk - graph_title EMC VNX 5300 Counted Block Queue Length + graph_title EMC VNX 5300 Counted Block Queue Length graph_vlabel Length EOF while read -r LUN ; do @@ -451,10 +451,10 @@ if [ "$1" = "config" ] ; then cat <<-EOF ${SPclean}_total_busyticks.label ${SP} ${SPclean}_total_busyticks.graph no - ${SPclean}_total_busyticks.type COUNTER + ${SPclean}_total_busyticks.type COUNTER ${SPclean}_total_bt.label ${SP} ${SPclean}_total_bt.graph no - ${SPclean}_total_bt.type COUNTER + ${SPclean}_total_bt.type COUNTER ${SPclean}_total_idleticks.label ${SP} ${SPclean}_total_idleticks.graph no ${SPclean}_total_idleticks.type COUNTER @@ -469,8 +469,8 @@ fi #BIGCMD="$SSH" while read -r LUN ; do FILTERLUN="$(clean_fieldname "$LUN")" - BIGCMD+="$NAVICLI lun -list -name $LUN -perfData | - sed -ne 's/^Blocks Read\:\ */${FILTERLUN}_read.value /p; + BIGCMD+="$NAVICLI lun -list -name $LUN -perfData | + sed -ne 's/^Blocks Read\:\ */${FILTERLUN}_read.value /p; s/^Blocks Written\:\ */${FILTERLUN}_write.value /p; s/Read Requests\:\ */${FILTERLUN}_readreq.value /p; s/Write Requests\:\ */${FILTERLUN}_writereq.value /p; diff --git a/plugins/emc/emc_vnx_file_ b/plugins/emc/emc_vnx_file_ index 45bda578..32a1c26a 100755 --- a/plugins/emc/emc_vnx_file_ +++ b/plugins/emc/emc_vnx_file_ @@ -2,9 +2,9 @@ : <<=cut -=head1 NAME +=head1 NAME - emc_vnx_file_stats - Plugin to monitor Basic, NFSv3 and NFSv4 statistics of + emc_vnx_file_stats - Plugin to monitor Basic, NFSv3 and NFSv4 statistics of EMC VNX 5300 Unified Storage system's Datamovers =head1 AUTHOR @@ -22,24 +22,24 @@ =head1 DESCRIPTION - The plugin monitors basic statistics of EMC Unified Storage system Datamovers - and NFS statistics of EMC VNX5300 Unified Storage system. Probably it can + The plugin monitors basic statistics of EMC Unified Storage system Datamovers + and NFS statistics of EMC VNX5300 Unified Storage system. Probably it can also be compatible with other Isilon or Celerra systems. It uses SSH to connect - to Control Stations, then remotely executes '/nas/sbin/server_stats' and - fetches and parses data from it. It supports gathering data both from - active/active and active/passive Datamover configurations, ignoring offline or - standby Datamovers. + to Control Stations, then remotely executes '/nas/sbin/server_stats' and + fetches and parses data from it. It supports gathering data both from + active/active and active/passive Datamover configurations, ignoring offline or + standby Datamovers. If all Datamovers are offline or absent, the plugin returns error. This plugin also automatically chooses Primary Control Station from the list by calling '/nasmcd/sbin/getreason' and '/nasmcd/sbin/t2slot'. - + At the moment data is gathered from the following statistics sources: * nfs.v3.op - Tons of timings about NFSv3 RPC calls * nfs.v4.op - Tons of timings about NFSv4 RPC calls * nfs.client - Here new Client addresses are rescanned and added automatically. * basic-std Statistics Group - Basic Statistics of Datamovers (eg. CPU, Memory etc.) - + It's quite easy to comment out unneeded data to make graphs less overloaded or to add new statistics sources. @@ -78,48 +78,48 @@ =head1 COMPATIBILITY - The plugin has been written for being compatible with EMC VNX5300 Storage + The plugin has been written for being compatible with EMC VNX5300 Storage system, as this is the only EMC storage which i have. By the way, i am pretty sure it can also work with other VNX1 storages, like VNX5100 and VNX5500. - About VNX2 series, i don't know whether the plugin will be able to work with + About VNX2 series, i don't know whether the plugin will be able to work with them. Maybe it would need some corrections in command-line backend. The same - situation is with other EMC systems, so i encourage you to try and fix the - plugin. + situation is with other EMC systems, so i encourage you to try and fix the + plugin. =head1 CONFIGURATION - The plugin uses SSH to connect to Control Stations. It's possible to use + The plugin uses SSH to connect to Control Stations. It's possible to use 'nasadmin' user, but it would be better if you create read-only global user by Unisphere Client. The user should have only Operator role. I created "operator" user but due to the fact that Control Stations already - had one internal "operator" user, the new one was called "operator1". So be + had one internal "operator" user, the new one was called "operator1". So be careful. After that, copy .bash_profile from /home/nasadmin to a newly created /home/operator1 - + On munin-node side choose a user which will be used to connect through SSH. - Generally user "munin" is ok. Then, execute "sudo su munin -s /bin/bash", - "ssh-keygen" and "ssh-copy-id" to both Control Stations with newly created + Generally user "munin" is ok. Then, execute "sudo su munin -s /bin/bash", + "ssh-keygen" and "ssh-copy-id" to both Control Stations with newly created user. - - Make a link from /usr/share/munin/plugins/emc_vnx_file_stats to - /etc/munin/plugins/. If you want to get NFS statistics, name the link as + + Make a link from /usr/share/munin/plugins/emc_vnx_file_stats to + /etc/munin/plugins/. If you want to get NFS statistics, name the link as "emc_vnx_file_nfs_stats_", otherwise to get Basic Datamover statistics you have to name it "emc_vnx_file_basicdm_stats_", where is any - arbitrary name of your storage system. The plugin will return in its + arbitrary name of your storage system. The plugin will return in its answer as "host_name" field. For example, assume your storage system is called "VNX5300". - Make a configuration file at + Make a configuration file at /etc/munin/plugin-conf.d/emc_vnx_file_stats_VNX5300 - - [emc_vnx_file_*] - user munin - env.username operator1 - env.cs_addr 192.168.1.1 192.168.1.2 - env.nas_servers server_2 server_3 - Where: + [emc_vnx_file_*] + user munin + env.username operator1 + env.cs_addr 192.168.1.1 192.168.1.2 + env.nas_servers server_2 server_3 + + Where: user - SSH Client local user env.username - Remote user with Operator role env.cs_addr - Control Stations addresses @@ -143,7 +143,7 @@ cs_addr=${cs_addr:=""} username=${username:=""} nas_servers=${nas_servers:="server_2 server_3"} -# Prints "10" on stdout if found Primary Online control station. "11" - for Secondary Online control station. +# Prints "10" on stdout if found Primary Online control station. "11" - for Secondary Online control station. ssh_check_cmd() { ssh -q "$username@$1" "/nasmcd/sbin/getreason | grep -w \"slot_\$(/nasmcd/sbin/t2slot)\" | cut -d- -f1 | awk '{print \$1}' " @@ -192,7 +192,7 @@ if [ "$1" = "suggest" ]; then fi STATSTYPE=$(echo "${0##*/}" | cut -d _ -f 1-5) -if [ "$STATSTYPE" = "emc_vnx_file_nfs_stats" ]; then STATSTYPE=NFS; +if [ "$STATSTYPE" = "emc_vnx_file_nfs_stats" ]; then STATSTYPE=NFS; elif [ "$STATSTYPE" = "emc_vnx_file_basicdm_stats" ]; then STATSTYPE=BASICDM; else echo "Do not know what to do. Name the plugin as 'emc_vnx_file_nfs_stats_' or 'emc_vnx_file_basicdm_stats_'" >&2; exit 1; fi @@ -213,9 +213,9 @@ if [ "$1" = "config" ] ; then run_remote nas_server -i "$server" | grep -q 'type *= nas' || continue nas_server_ok=TRUE filtered_server="$(clean_fieldname "$server")" - + if [ "$STATSTYPE" = "BASICDM" ] ; then - cat <<-EOF + cat <<-EOF multigraph emc_vnx_cpu_percent graph_title EMC VNX 5300 Datamover CPU Util % graph_vlabel % @@ -259,7 +259,7 @@ if [ "$1" = "config" ] ; then ${server}_total.label ${server} Total ${server}_freebuffer.label ${server} Free Buffer ${server}_encumbered.label ${server} Encumbered - + multigraph emc_vnx_filecache graph_title EMC VNX 5300 File Buffer Cache graph_vlabel per second @@ -272,7 +272,7 @@ if [ "$1" = "config" ] ; then ${server}_w_hits.label Watermark Hits ${server}_hits.label Hits ${server}_lookups.label Lookups - + multigraph emc_vnx_fileresolve graph_title EMC VNX 5300 FileResolve graph_vlabel Entries @@ -286,8 +286,8 @@ if [ "$1" = "config" ] ; then if [ "$STATSTYPE" = "NFS" ] ; then #nfs.v3.op data # [nasadmin@mnemonic0 ~]$ server_stats server_2 -info nfs.v3.op -# server_2 : -# +# server_2 : +# # name = nfs.v3.op # description = NFS V3 per operation statistics # type = Set @@ -296,7 +296,7 @@ if [ "$1" = "config" ] ; then # member_of = nfs.v3 member_elements_by_line=$(run_remote server_stats "$server" -info nfs.v3.op | grep member_elements | sed -ne 's/^.*= //p') IFS=',' read -ra graphs <<< "$member_elements_by_line" - cat <<-EOF + cat <<-EOF multigraph vnx_emc_v3_calls_s graph_title EMC VNX 5300 NFSv3 Calls per second graph_vlabel Calls @@ -309,7 +309,7 @@ if [ "$1" = "config" ] ; then done cat <<-EOF - + multigraph vnx_emc_v3_usec_call graph_title EMC VNX 5300 NFSv3 uSeconds per call graph_vlabel uSec / call @@ -362,7 +362,7 @@ if [ "$1" = "config" ] ; then echo "${server}_$field.label $server $field" done cat <<-EOF - + multigraph vnx_emc_v4_op_percent graph_title EMC VNX 5300 NFSv4 Op % graph_vlabel % @@ -376,7 +376,7 @@ if [ "$1" = "config" ] ; then done #nfs.client data -# Total Read Write Suspicious Total Read Write Avg +# Total Read Write Suspicious Total Read Write Avg # Ops/s Ops/s Ops/s Ops diff KiB/s KiB/s KiB/s uSec/call member_elements_by_line=$(run_remote server_stats server_2 -monitor nfs.client -count 1 -terminationsummary no -titles never | sed -ne 's/^.*id=//p' | cut -d' ' -f1) #Somewhy readarray adds extra \n in the end of each variable. So, we use read() with a workaround @@ -437,8 +437,8 @@ if [ "$1" = "config" ] ; then done #nfs-std -# Timestamp NFS Read Read Read Size Write Write Write Size Active -# Ops/s Ops/s KiB/s Bytes Ops/s KiB/s Bytes Threads +# Timestamp NFS Read Read Read Size Write Write Write Size Active +# Ops/s Ops/s KiB/s Bytes Ops/s KiB/s Bytes Threads cat <<-EOF multigraph vnx_emc_nfs_std_nfs_ops @@ -451,7 +451,7 @@ if [ "$1" = "config" ] ; then echo "${filtered_server}_wops.label $server Write Ops/s" echo "${filtered_server}_wops.draw STACK" echo "${filtered_server}_tops.label $server Total Ops/s" - + cat <<-EOF multigraph vnx_emc_nfs_std_nfs_b_s @@ -465,7 +465,7 @@ if [ "$1" = "config" ] ; then echo "${filtered_server}_wbs.draw STACK" echo "${filtered_server}_tbs.label $server Total B/s" echo "${filtered_server}_tbs.cdef ${filtered_server}_rbs,${filtered_server}_wbs,+" - + cat <<-EOF multigraph vnx_emc_nfs_std_nfs_avg @@ -499,10 +499,10 @@ for server in $nas_servers; do if [ "$STATSTYPE" = "BASICDM" ] ; then #basicdm data -# [nasadmin@mnemonic0 ~]$ server_stats server_2 -count 1 -terminationsummary no -# server_2 CPU Network Network dVol dVol -# Timestamp Util In Out Read Write -# % KiB/s KiB/s KiB/s KiB/s +# [nasadmin@mnemonic0 ~]$ server_stats server_2 -count 1 -terminationsummary no +# server_2 CPU Network Network dVol dVol +# Timestamp Util In Out Read Write +# % KiB/s KiB/s KiB/s KiB/s # 20:42:26 9 16432 3404 1967 24889 member_elements_by_line=$(run_remote server_stats "$server" -count 1 -terminationsummary no -titles never | grep '^[^[:space:]]') @@ -519,10 +519,10 @@ for server in $nas_servers; do echo "${server}_stor_read.value $((graphs[4] * 1024))" echo "${server}_stor_write.value $((graphs[5] * 1024))" -# [nasadmin@mnemonic0 ~]$ server_stats server_2 -monitor kernel.memory -count 1 -terminationsummary no -# server_2 Free Buffer Buffer Buffer Buffer Buffer Buffer Cache Encumbered FileResolve FileResolve FileResolve Free KiB Page Total Used KiB Memory -# Timestamp Buffer Cache High Cache Cache Cache Cache Low Watermark Memory Dropped Max Used Size Memory Util -# KiB Watermark Hits/s Hit % Hits/s Lookups/s Watermark Hits/s Hits/s KiB Entries Limit Entries KiB KiB % +# [nasadmin@mnemonic0 ~]$ server_stats server_2 -monitor kernel.memory -count 1 -terminationsummary no +# server_2 Free Buffer Buffer Buffer Buffer Buffer Buffer Cache Encumbered FileResolve FileResolve FileResolve Free KiB Page Total Used KiB Memory +# Timestamp Buffer Cache High Cache Cache Cache Cache Low Watermark Memory Dropped Max Used Size Memory Util +# KiB Watermark Hits/s Hit % Hits/s Lookups/s Watermark Hits/s Hits/s KiB Entries Limit Entries KiB KiB % # 20:44:14 3522944 0 96 11562 12010 0 0 3579268 0 0 0 3525848 8 6291456 2765608 44 member_elements_by_line=$(run_remote server_stats "$server" -monitor kernel.memory -count 1 -terminationsummary no -titles never | grep '^[^[:space:]]') @@ -530,7 +530,7 @@ for server in $nas_servers; do echo -e "\nmultigraph emc_vnx_memory" #Reserved for math - echo "${server}_total.value $((graphs[14] / 1))" + echo "${server}_total.value $((graphs[14] / 1))" echo "${server}_used.value $((graphs[15] / 1))" echo "${server}_free.value $((graphs[12] / 1))" echo "${server}_freebuffer.value $((graphs[1] / 1))" @@ -553,9 +553,9 @@ for server in $nas_servers; do if [ "$STATSTYPE" = "NFS" ] ; then #nfs.v3.op data # [nasadmin@mnemonic0 ~]$ server_stats server_2 -monitor nfs.v3.op -count 1 -terminationsummary no -# server_2 NFS Op NFS NFS Op NFS NFS Op % -# Timestamp Op Errors Op -# Calls/s diff uSec/Call +# server_2 NFS Op NFS NFS Op NFS NFS Op % +# Timestamp Op Errors Op +# Calls/s diff uSec/Call # 22:14:41 v3GetAttr 30 0 23 21 # v3Lookup 40 0 98070 27 # v3Access 50 0 20 34 @@ -571,7 +571,7 @@ for server in $nas_servers; do while IFS=$'\n' read -ra graphs ; do elements_array+=( $graphs ) done <<< "$member_elements_by_line" - + if [ "${#elements_array[@]}" -eq "0" ]; then LINES=0; fi echo "multigraph vnx_emc_v3_calls_s" @@ -593,9 +593,9 @@ for server in $nas_servers; do #nfs.v4.op data # [nasadmin@mnemonic0 ~]$ server_stats server_2 -monitor nfs.v4.op -count 1 -terminationsummary no -# server_2 NFS Op NFS NFS Op NFS NFS Op % -# Timestamp Op Errors Op -# Calls/s diff uSec/Call +# server_2 NFS Op NFS NFS Op NFS NFS Op % +# Timestamp Op Errors Op +# Calls/s diff uSec/Call # 22:13:14 v4Compound 2315 0 7913 30 # v4Access 246 0 5 3 # v4Close 133 0 11 2 @@ -643,9 +643,9 @@ for server in $nas_servers; do elements_array=() #nfs.client data -# [nasadmin@mnemonic0 ~]$ server_stats server_2 -monitor nfs.client -count 1 -terminationsummary no -# server_2 Client NFS NFS NFS NFS NFS NFS NFS NFS -# Timestamp Total Read Write Suspicious Total Read Write Avg +# [nasadmin@mnemonic0 ~]$ server_stats server_2 -monitor nfs.client -count 1 -terminationsummary no +# server_2 Client NFS NFS NFS NFS NFS NFS NFS NFS +# Timestamp Total Read Write Suspicious Total Read Write Avg # Ops/s Ops/s Ops/s Ops diff KiB/s KiB/s KiB/s uSec/call # 20:26:38 id=192.168.1.223 2550 20 2196 13 4673 159 4514 1964 # id=192.168.1.2 691 4 5 1 1113 425 688 2404 @@ -687,9 +687,9 @@ for server in $nas_servers; do #nfs-std # bash-3.2$ server_stats server_2 -monitor nfs-std -# server_2 Total NFS NFS NFS Avg NFS NFS NFS Avg NFS -# Timestamp NFS Read Read Read Size Write Write Write Size Active -# Ops/s Ops/s KiB/s Bytes Ops/s KiB/s Bytes Threads +# server_2 Total NFS NFS NFS Avg NFS NFS NFS Avg NFS +# Timestamp NFS Read Read Read Size Write Write Write Size Active +# Ops/s Ops/s KiB/s Bytes Ops/s KiB/s Bytes Threads # 18:14:52 688 105 6396 62652 1 137 174763 3 member_elements_by_line=$(run_remote server_stats "$server" -monitor nfs-std -count 1 -terminationsummary no -titles never | grep '^[^[:space:]]') IFS=$' ' read -ra graphs <<< "$member_elements_by_line" @@ -700,12 +700,12 @@ for server in $nas_servers; do echo "${filtered_server}_rops.value ${graphs[2]}" echo "${filtered_server}_wops.value ${graphs[5]}" echo "${filtered_server}_tops.value ${graphs[1]}" - + echo -e "\nmultigraph vnx_emc_nfs_std_nfs_b_s" echo "${filtered_server}_rbs.value $((graphs[3] * 1024))" echo "${filtered_server}_wbs.value $((graphs[6] * 1024))" echo "${filtered_server}_tbs.value 0" - + echo -e "\nmultigraph vnx_emc_nfs_std_nfs_avg" echo "${filtered_server}_avg_readsize.value ${graphs[4]}" diff --git a/plugins/fan/ibmfan b/plugins/fan/ibmfan index 95d147a2..bba537b5 100755 --- a/plugins/fan/ibmfan +++ b/plugins/fan/ibmfan @@ -1,10 +1,10 @@ #!/bin/sh -# +# # Plugin to monitor fan speed on an IBM/Lenovo Laptop # # This plugin reads the current speed of the system fan from # the /proc file system. As it queries specific files provided -# by kernel modules for IBM/Lenovo Laptops, it probably only +# by kernel modules for IBM/Lenovo Laptops, it probably only # works for those, but it should be easy to adapt to others # if similar information is available for other types of laptops. # @@ -26,7 +26,7 @@ if [ "$1" = "autoconf" ]; then fi fi - + if [ "$1" = "config" ]; then echo 'graph_title Fan speed' echo 'graph_args --base 1000 -l 0' diff --git a/plugins/firebird/firebird b/plugins/firebird/firebird index 1e70bd79..7eabb3fe 100755 --- a/plugins/firebird/firebird +++ b/plugins/firebird/firebird @@ -7,7 +7,7 @@ # # "employee" must be an alias configured in the firebird aliases.conf file # -# You will also need to set +# You will also need to set # # [firebird_employee] # user root @@ -53,24 +53,24 @@ gstat=$(which gstat 2> /dev/null) ${gstat:=/opt/firebird/bin/gstat} -h ${db} | awk -F'[\t]+' \ '{ sub(/^ */,""); - if ($2 == "Oldest transaction") - { + if ($2 == "Oldest transaction") + { oldest_trans=$3; print "oldest_transaction.value " $3 } if ($2 == "Oldest active") { - oldest_active=$3 + oldest_active=$3 print "oldest_active.value " $3 } - if ($2 == "Oldest snapshot") + if ($2 == "Oldest snapshot") { - oldest_snapshot=$3 + oldest_snapshot=$3 print "oldest_snapshot.value " $3 } if ($2 == "Next transaction") { - next_transaction=$3 + next_transaction=$3 print "next_transaction.value " $3 print "oldest_trans_gap1.value " $3 - oldest_trans print "oldest_trans_gap2.value " $3 - oldest_snapshot diff --git a/plugins/freeradius/freeradius b/plugins/freeradius/freeradius index ae5e3016..b0c97422 100755 --- a/plugins/freeradius/freeradius +++ b/plugins/freeradius/freeradius @@ -42,7 +42,7 @@ fi if [ "$1" = "config" ]; then echo 'graph_title freeradius requests' echo 'graph_args --base 1000 -l 0 ' - if [ -n ${graph_period} ]; then + if [ -n ${graph_period} ]; then echo 'graph_period '${graph_period} fi echo 'graph_vlabel requests / ${graph_period}' diff --git a/plugins/ftp/proftpd_count b/plugins/ftp/proftpd_count index b0f10b50..f48e06a3 100755 --- a/plugins/ftp/proftpd_count +++ b/plugins/ftp/proftpd_count @@ -17,7 +17,7 @@ mktempfile () { mktemp -t "$1" -} +} LOGFILE=${logfile:-/var/log/proftpd/xferlog} LOGTAIL=${logtail:-$(which logtail)} diff --git a/plugins/ftp/pure-ftpd b/plugins/ftp/pure-ftpd index 2a699778..b77ed934 100755 --- a/plugins/ftp/pure-ftpd +++ b/plugins/ftp/pure-ftpd @@ -20,7 +20,7 @@ # # Configuration: # Maybe need to add following lines to plugins config file -# (e.g. /etc/munin/plugin-conf.d/pure-ftpd) to run pure-ftpwho +# (e.g. /etc/munin/plugin-conf.d/pure-ftpd) to run pure-ftpwho # as user with apropirate privilegs then restart munin-node. # # [pure-ftpd] diff --git a/plugins/ftp/pure-ftpd-bw b/plugins/ftp/pure-ftpd-bw index aa9112d2..10ef8e73 100755 --- a/plugins/ftp/pure-ftpd-bw +++ b/plugins/ftp/pure-ftpd-bw @@ -11,7 +11,7 @@ # # Configuration: # Maybe need to add following lines to plugins config file -# (e.g. /etc/munin/plugin-conf.d/pure-ftpd) to run pure-ftpwho +# (e.g. /etc/munin/plugin-conf.d/pure-ftpd) to run pure-ftpwho # as user with apropirate privilegs then restart munin-node. # # [pure-ftpd-bw] diff --git a/plugins/ftp/pureftpd_traffic b/plugins/ftp/pureftpd_traffic index c9ec4c73..d96898e5 100755 --- a/plugins/ftp/pureftpd_traffic +++ b/plugins/ftp/pureftpd_traffic @@ -54,7 +54,7 @@ if (!(-e $logfile)) { open LOG, "<$logfile" or print "Can't open logfile!\n"; my $last_line; while() { - $last_line = $_ if eof; + $last_line = $_ if eof; } close LOG; @em = split(/ /,$last_line); @@ -77,33 +77,33 @@ if (!(-e $logfile)) { $put=0, $mti=0, $dsm=0; - + open LOG, "<$logfile"; @log=; foreach $row (@log) { @parts=split(/ /,$row); $curr_ts = "$parts[3] $parts[4]"; $curr_ts =~ s/\[//g; - $curr_ts =~ s/\]//g; + $curr_ts =~ s/\]//g; if ( Date_Cmp($curr_ts,$last_ts) > 0 ) { if ( $parts[5]=~ /GET/ ) { $get+=int($parts[8]); if ($parts[2] eq "mti") { $mti+=int($parts[8]); - } + } if ($parts[2] eq "dsm") { $dsm+=int($parts[8]); - } + } } if ( $parts[5]=~ /PUT/ ) { $put-=int($parts[8]); if ($parts[2] eq "mti") { $mti-=int($parts[8]); - } + } if ($parts[2] eq "dsm") { $dsm-=int($parts[8]); - } + } } } } diff --git a/plugins/funkytown/denon_x311_volume b/plugins/funkytown/denon_x311_volume index 4dfd2e98..78fdc3e7 100755 --- a/plugins/funkytown/denon_x311_volume +++ b/plugins/funkytown/denon_x311_volume @@ -1,17 +1,17 @@ #!/usr/bin/gawk -f # Denon x311 volume-plugin for munin # Copyright (C) 2010 Kristian Lyngstol -# +# # 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 Street, Fifth Floor, Boston, MA 02110-1301 USA. diff --git a/plugins/games/game b/plugins/games/game index 9cb182ad..f248b5bd 100755 --- a/plugins/games/game +++ b/plugins/games/game @@ -45,7 +45,7 @@ function printMultigraph($ini_array, $machine_name, $title, $info, $max) { p("graph_category games"); p("graph_info $info"); p("graph_printf %6.0lf"); - + if (isset($ini_array['settings'][$machine_name . '_colour'])) p("players.colour " . $ini_array['settings'][$machine_name . '_colour']); @@ -106,8 +106,8 @@ if (isset($_SERVER['argv'][1])) { // Query the game servers $results = queryServers($ini_array); // Cache the query in the state file - $fp = fopen($state, 'w+') or die("I could not open state file."); - fwrite($fp, serialize($results)); + $fp = fopen($state, 'w+') or die("I could not open state file."); + fwrite($fp, serialize($results)); fclose($fp); @@ -175,7 +175,7 @@ $ini_array = parse_ini_file($config, true); // Load games.ini so we can show pretty game names $games = parse_ini_file('gameq/GameQ/games.ini', true); -$results = unserialize(file_get_contents($state)); +$results = unserialize(file_get_contents($state)); // Print individual game values foreach ($results as $name => $server){ diff --git a/plugins/geowebcache/geowebcache-bandwidth b/plugins/geowebcache/geowebcache-bandwidth index d2f9c0ce..3863510b 100755 --- a/plugins/geowebcache/geowebcache-bandwidth +++ b/plugins/geowebcache/geowebcache-bandwidth @@ -3,7 +3,7 @@ # Author Rodolphe Quiédeville # Licence : GPLv2 -# Code based on tomcat_volume plugin by +# Code based on tomcat_volume plugin by # Rune Nordbøe Skillingstad =head1 NAME diff --git a/plugins/geowebcache/geowebcache-blankitems b/plugins/geowebcache/geowebcache-blankitems index a3c80a2f..68d00da6 100755 --- a/plugins/geowebcache/geowebcache-blankitems +++ b/plugins/geowebcache/geowebcache-blankitems @@ -3,7 +3,7 @@ # Author Rodolphe Quiédeville # Licence : GPLv2 -# Code based on tomcat_volume plugin by +# Code based on tomcat_volume plugin by # Rune Nordbøe Skillingstad =head1 NAME diff --git a/plugins/geowebcache/geowebcache-cache-hits-ratio b/plugins/geowebcache/geowebcache-cache-hits-ratio index 270c846e..a14f4d5c 100755 --- a/plugins/geowebcache/geowebcache-cache-hits-ratio +++ b/plugins/geowebcache/geowebcache-cache-hits-ratio @@ -3,7 +3,7 @@ # Author Rodolphe Quiédeville # Licence : GPLv2 -# Code based on tomcat_volume plugin by +# Code based on tomcat_volume plugin by # Rune Nordbøe Skillingstad =head1 NAME diff --git a/plugins/glance/glance_status b/plugins/glance/glance_status index 95917a3c..26a83e36 100755 --- a/plugins/glance/glance_status +++ b/plugins/glance/glance_status @@ -18,9 +18,9 @@ import sys import os -try: +try: from sqlalchemy.orm import exc, joinedload - + from glance.common.cfg import CommonConfigOpts from glance.registry.db import models from glance.registry.db.api import get_session, configure_db @@ -32,7 +32,7 @@ else: def load_conf(): CONF = CommonConfigOpts(project="glance", prog="glance-registry") CONF() - + # Hide missing logger warning message sys.stderr = open(os.devnull, 'w') configure_db(CONF) @@ -76,7 +76,7 @@ def print_values(): for image in images: n_image_by_status[image["status"]] = n_image_by_status.get(image["status"], 0) + 1 - for status in possible_status: + for status in possible_status: print '%s.value %s' % (status, n_image_by_status.get(status, 0)) if __name__ == '__main__': @@ -86,7 +86,7 @@ if __name__ == '__main__': if argv[1] == 'config': print_config() elif argv[1] == 'autoconf': - if not successful_import: + if not successful_import: print 'no (failed import glance and/or sqlachemy module)' sys.exit(0) try: diff --git a/plugins/google/google-rank b/plugins/google/google-rank index 00cafdba..9c6cba45 100755 --- a/plugins/google/google-rank +++ b/plugins/google/google-rank @@ -2,10 +2,10 @@ # Simple munin plugin to find the google rank for a URL/WORD combination # # THIS SCRIPT BREAKS THE TOS OF GOOGLE SO USE WITH CARE AND DON'T BLAME ME IF THINGS GO WRONG -# +# # (c) 2009 i.dobson@planet-ian.com # -# For each url/words that you want to watch you need to create a variable/word pair in your +# For each url/words that you want to watch you need to create a variable/word pair in your # munin-node configuration file for example # #[google_rank] @@ -19,18 +19,18 @@ # Version 0.5 24.1.2009 # Added loop to check the first 500 pages. Note the script sleeps 5 seconds between each page grab so # If the word/url your looking for is in the higher positions then you need to increase the timeout -# +# # Version 0.5 21.1.2009 -# Dump each page grabbed from google into separate files (helps with debugging) +# Dump each page grabbed from google into separate files (helps with debugging) # # Version 0.4 19.1.2009 # Fixed corrupt then empty cache file bug # -# Version 0.3 19.1.2009 +# Version 0.3 19.1.2009 # The script now grabs the google page based on the LASTHIT counter. # The script grabs the google page for URL1, then the next time it's called URL2 etc. If the url/word pair doesn't exist for LASTHIT then the script just dumps the cached data # -# Version 0.2 18.01.2009 +# Version 0.2 18.01.2009 # Cache added, the script only grabs the pages from google every 10 calls # The script still only checks to first 100 pages returned by google # @@ -70,7 +70,7 @@ if [ "$1" = "config" ]; then fi if [ "$WORD" = "" ]; then exit 0 - fi + fi VAR=`echo $URL.$WORD | sed -e "s/http:\/\///g"| sed -e "s/ /_/g"| sed -e "s/\./_/g"| sed -e "s/\-/_/g"` URL=`echo $URL| sed -e "s/http:\/\///g"` echo $VAR.label Pagerank $URL - $WORD @@ -108,7 +108,7 @@ if [ "$URL" != "" ]; then SEARCHWORD=`echo $WORD| sed -e "s/ /%20/g"` until [ "$FOUND" -ne "0" ]; do -#Grab page from google for the WORD/PAGE combination.Pipe it into awk to pull out the url's only, one per line. Then dump only the lines containing the URL defined +#Grab page from google for the WORD/PAGE combination.Pipe it into awk to pull out the url's only, one per line. Then dump only the lines containing the URL defined wget -q --user-agent=Firefox -O - http://www.google.com/search?q=$SEARCHWORD\&num=100\&hl=en\&safe=off\&pwst=1\&start=$start\&sa=N > /tmp/google_rank.$LASTHIT.data VALUE=`cat /tmp/google_rank.$LASTHIT.data|sed 's//\n\1\n/g'|awk -v num=$num -v base=$base '{ if ( $1 ~ /^http/ ) print base,num++,$NF }'|awk '{ print $2 " " $3}'|grep -i $URL| awk '{ print $1}'` VALUE=`echo $VALUE| awk '{ print $1}'` @@ -117,7 +117,7 @@ until [ "$FOUND" -ne "0" ]; do let start="start + 100" sleep 5 else - FOUND=1 + FOUND=1 let VALUE="$VALUE + $start" fi ### echo Start=$start Value=$VALUE Found=$FOUND @@ -139,12 +139,12 @@ done #write data back rm /tmp/google_rank.cache - for iLoop in `seq 1 10`; do + for iLoop in `seq 1 10`; do echo ${Data[$iLoop]} >> /tmp/google_rank.cache done fi -#Reset counter to start +#Reset counter to start if [ "$LASTHIT" -gt 30 ]; then echo 0 > /tmp/google_rank.status fi diff --git a/plugins/google/googlecode b/plugins/google/googlecode index fed13890..7a419572 100755 --- a/plugins/google/googlecode +++ b/plugins/google/googlecode @@ -12,7 +12,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. # @@ -42,7 +42,7 @@ if [ "$1" = "autoconf" ]; then exit 0 fi -# Config. +# Config. if [ "$1" = "config" ]; then echo "graph_title Number of downloads of $PROJECTNAME from Google Code " echo "graph_args --base 1000 --lower-limit 0" diff --git a/plugins/gpu/amd_gpu_ b/plugins/gpu/amd_gpu_ index 3bbc2ae8..efdff9dc 100755 --- a/plugins/gpu/amd_gpu_ +++ b/plugins/gpu/amd_gpu_ @@ -8,13 +8,13 @@ amd_gpu_ - Wildcard plugin to monitor AMD GPUs. Uses aticonfig utility, usually bundled with AMD GPU driver, to obtain information. To use this plugin you have to make sure aticonfig will run without an active X -server (i.e. without anyone being logged in via the GUI). For more -information about this issue visit the link below: +server (i.e. without anyone being logged in via the GUI). For more +information about this issue visit the link below: http://www.mayankdaga.com/running-opencl-applications-remotely-on-amd-gpus/ =head1 CONFIGURATION -This is a wildcard plugin. The wildcard prefix link name should be the +This is a wildcard plugin. The wildcard prefix link name should be the value to monitor. This plugin uses the following configuration variables: @@ -54,7 +54,7 @@ faken@fakenmc.com =head1 LICENSE GNU General Public License, version 2 - http://www.gnu.org/licenses/gpl-2.0.html + http://www.gnu.org/licenses/gpl-2.0.html =head1 MAGIC MARKERS @@ -71,7 +71,7 @@ atiConfigExec=${aticonfexec:-'/usr/bin/aticonfig'} # Check if autoconf was requested if [ "$1" = "autoconf" ]; then - # Autoconf only returns yes if aticonfig exists and is executable + # Autoconf only returns yes if aticonfig exists and is executable if [ -x $atiConfigExec ]; then echo yes exit 0 @@ -122,7 +122,7 @@ if [ "$1" = "config" ]; then echo "temp${nGpusCounter}.info Temperature information for $gpuName" echo "temp${nGpusCounter}.label Temperature ($gpuName)" : $(( nGpusCounter = $nGpusCounter + 1 )) - done + done ;; clocks) # First determine max clock for each GPU... @@ -149,7 +149,7 @@ if [ "$1" = "config" ]; then echo "coreclock${nGpusCounter}.info Core clock information for $gpuName" echo "coreclock${nGpusCounter}.label Core clock ($gpuName)" : $(( nGpusCounter = $nGpusCounter + 1 )) - done + done ;; fan) echo 'graph_title GPU fan speed' @@ -164,14 +164,14 @@ if [ "$1" = "config" ]; then echo "fan${nGpusCounter}.info Fan speed information for $gpuName" echo "fan${nGpusCounter}.label Fan speed ($gpuName)" : $(( nGpusCounter = $nGpusCounter + 1 )) - done + done ;; load) echo 'graph_title GPU load' echo 'graph_args -l 0 -u 100' echo 'graph_vlabel Percentage' echo 'graph_category htc' - echo "graph_info GPU load" + echo "graph_info GPU load" nGpusCounter=0 while [ $nGpusCounter -lt $nGpus ] do @@ -179,7 +179,7 @@ if [ "$1" = "config" ]; then echo "load${nGpusCounter}.info Load information for $gpuName" echo "load${nGpusCounter}.label Load ($gpuName)" : $(( nGpusCounter = $nGpusCounter + 1 )) - done + done ;; vcore) echo 'graph_title GPU core voltage' @@ -193,7 +193,7 @@ if [ "$1" = "config" ]; then echo "vcore${nGpusCounter}.info Vcore information for $gpuName" echo "vcore${nGpusCounter}.label Core voltage ($gpuName)" : $(( nGpusCounter = $nGpusCounter + 1 )) - done + done ;; *) echo "Can't run without a proper symlink. Exiting." diff --git a/plugins/gpu/nvidia_gpu_ b/plugins/gpu/nvidia_gpu_ index f50d1d26..839b4986 100755 --- a/plugins/gpu/nvidia_gpu_ +++ b/plugins/gpu/nvidia_gpu_ @@ -10,7 +10,7 @@ usually bundled with NVIDIA GPU driver, to obtain information. =head1 CONFIGURATION -This is a wildcard plugin. The wildcard prefix link name should be the +This is a wildcard plugin. The wildcard prefix link name should be the value to monitor. This plugin uses the following configuration variables: @@ -53,7 +53,7 @@ faken@fakenmc.com =head1 LICENSE GNU General Public License, version 2 - http://www.gnu.org/licenses/gpl-2.0.html + http://www.gnu.org/licenses/gpl-2.0.html =head1 MAGIC MARKERS @@ -70,7 +70,7 @@ nvSmiExec=${smiexec:-'/usr/bin/nvidia-smi'} # Check if autoconf was requested if [ "$1" = "autoconf" ]; then - # Autoconf only returns yes if nvidia-smi exists and is executable + # Autoconf only returns yes if nvidia-smi exists and is executable if [ -x "$nvSmiExec" ]; then echo yes exit 0 @@ -188,7 +188,7 @@ if [ "$1" = "config" ]; then gpuName=$(echo "$nGpusOutput" | sed -n $((nGpusCounter+1))p | cut -d \( -f 1) echo "${name}${nGpusCounter}.info GPU utilization information for $gpuName" : $((nGpusCounter=nGpusCounter+1)) - done + done ;; *) echo "Can't run without a proper symlink. Exiting." diff --git a/plugins/gpu/nvidia_smi_ b/plugins/gpu/nvidia_smi_ index f5395d5e..052dda07 100755 --- a/plugins/gpu/nvidia_smi_ +++ b/plugins/gpu/nvidia_smi_ @@ -38,7 +38,7 @@ my $runType = "normal"; my @runTypes = qw( normal config autoconf ); if ($#ARGV + 1 == 1) { - if (grep $_ eq $ARGV[0], @runTypes) + if (grep $_ eq $ARGV[0], @runTypes) { $runType = $ARGV[0]; } @@ -63,10 +63,10 @@ for (my $i = 0; $i < $gpuCount; $i++) { ($ret, my $handle) = nvmlDeviceGetHandleByIndex($i); next if $ret != $NVML_SUCCESS; - + ($ret, my $pciInfo) = nvmlDeviceGetPciInfo($handle); my $gpuName = $pciInfo->{'busId'} if $ret == $NVML_SUCCESS; - + if ($runType eq "config") { # only print the graph information once @@ -78,7 +78,7 @@ for (my $i = 0; $i < $gpuCount; $i++) print "graph_category sensors\n"; print "graph_info Information for NVIDIA GPUs using driver version $driverVersion\n"; } - + # metrics are collected for all the GPUs to a single graph print "GPU_UTIL_$i.label GPU$i - $gpuName : GPU utilization\n"; print "GPU_FANSPEED_$i.label GPU$i - $gpuName : fan speed\n"; diff --git a/plugins/groupwise/snmp__gwia_bytes_ b/plugins/groupwise/snmp__gwia_bytes_ index 8f2f3782..1f750992 100755 --- a/plugins/groupwise/snmp__gwia_bytes_ +++ b/plugins/groupwise/snmp__gwia_bytes_ @@ -23,8 +23,8 @@ # ------------------------------------------------------------ # Plugin to monitor Novell Groupwise Internet Agent (GWIA) # ------------------------------------------------------------ -# -# Management Information Base (MIB) GWIAMIB +# +# Management Information Base (MIB) GWIAMIB # # Naming Tree: 1.3.6.1.4.1.23 # iso(1) org(3) dod(6) internet(1) private(4) enterprises(1) novell(23) @@ -32,7 +32,7 @@ # To see all values available for your GWIA, type # snmpwalk -v1 -c public -m GWIAMIB gwia # -# This plugin fetches: +# This plugin fetches: # # * gwiaGatewayName - 1.3.6.1.4.1.23.2.70.1.1. # * gwiaStatBytesIn - 1.3.6.1.4.1.23.2.70.1.6. @@ -40,31 +40,31 @@ # # Usage: # -------------- -# Link this file snmp__gwia_bytes_ to your nodes servicedir [/etc/munin/plugins] +# Link this file snmp__gwia_bytes_ to your nodes servicedir [/etc/munin/plugins] # -# as: -# snmp__gwia_bytes_ +# as: +# snmp__gwia_bytes_ # # with: -# = Name or IP-Number of host +# = Name or IP-Number of host # = table index of the GWIA Object -# +# # E.g. # ln -s /usr/share/munin/plugins/snmp__gwia_bytes_ \ # /etc/munin/plugins/snmp_foo.example.com_gwia_bytes_0 -# ...will monitor a single GWIA object on host foo.example.com. +# ...will monitor a single GWIA object on host foo.example.com. # # Parameters # community - Specify wich community string to use (Default: public) # port - Specify which port to read from (Default: 161) # host - Specify which host to monitor (Default: Read from link in servicedir) -# pos - Specify which table Object to read (Default: Read from link in servicedir, -# +# pos - Specify which table Object to read (Default: Read from link in servicedir, +# # You may adjust settings to your need via configuration in plugin-conf.d/munin-node: # [snmp_*_gwia_bytes_*] # env.port # env.community -# env.pos +# env.pos # env.host # # Parameters can also be specified on a per GWIA basis, eg: @@ -96,8 +96,8 @@ my $GRAPH_VLABEL = "bytes per $GRAPH_PERIOD in(-) / out(+)"; my $BYTES_LABEL='Bytes'; if (defined $ARGV[0] and $ARGV[0] eq "snmpconf") -{ - print "require 1.3.6.1.4.1.23.2.70.1.1. [.*]\n"; # gwiaGatewayName +{ + print "require 1.3.6.1.4.1.23.2.70.1.1. [.*]\n"; # gwiaGatewayName print "require 1.3.6.1.4.1.23.2.70.1.6. [\\d*]\n"; # gwiaStatBytesIn print "require 1.3.6.1.4.1.23.2.70.1.5. [\\d*]\n"; # gwiaStatBytesOut @@ -129,8 +129,8 @@ if (!defined ($session)) if (defined $ARGV[0] and $ARGV[0] eq "config") { - # get name of Internet Agent - my $gwname = &get_single ($session, "1.3.6.1.4.1.23.2.70.1.1.$pos"); # gwiaGatewayName + # get name of Internet Agent + my $gwname = &get_single ($session, "1.3.6.1.4.1.23.2.70.1.1.$pos"); # gwiaGatewayName # output to munin print "host_name $host graph_category mail diff --git a/plugins/groupwise/snmp__gwia_msgs_ b/plugins/groupwise/snmp__gwia_msgs_ index 4fb7d9ec..14a8c4fd 100755 --- a/plugins/groupwise/snmp__gwia_msgs_ +++ b/plugins/groupwise/snmp__gwia_msgs_ @@ -23,8 +23,8 @@ # ------------------------------------------------------------ # Plugin to monitor Novell Groupwise Internet Agent (GWIA) # ------------------------------------------------------------ -# -# Management Information Base (MIB) GWIAMIB +# +# Management Information Base (MIB) GWIAMIB # # Naming Tree: 1.3.6.1.4.1.23 # iso(1) org(3) dod(6) internet(1) private(4) enterprises(1) novell(23) @@ -32,43 +32,43 @@ # To see all values available for your GWIA, type # snmpwalk -v1 -c public -m GWIAMIB gwia # -# This plugin fetches: +# This plugin fetches: # # * gwiaGatewayName - 1.3.6.1.4.1.23.2.70.1.1. # * gwiaStatMsgsOut - 1.3.6.1.4.1.23.2.70.1.7. # * gwiaStatMsgsIn - 1.3.6.1.4.1.23.2.70.1.8. # * gwiaStatStatusesOut - 1.3.6.1.4.1.23.2.70.1.9. -# * gwiaStatStatusesIn - 1.3.6.1.4.1.23.2.70.1.10. -# * gwiaStatErrorsOut - 1.3.6.1.4.1.23.2.70.1.11. +# * gwiaStatStatusesIn - 1.3.6.1.4.1.23.2.70.1.10. +# * gwiaStatErrorsOut - 1.3.6.1.4.1.23.2.70.1.11. # * gwiaStatErrorsIn - 1.3.6.1.4.1.23.2.70.1.12. # # Usage: # -------------- -# Link this file snmp__gwia_msgs_ to your nodes servicedir [/etc/munin/plugins] +# Link this file snmp__gwia_msgs_ to your nodes servicedir [/etc/munin/plugins] # -# as: -# snmp__gwia_msgs_ +# as: +# snmp__gwia_msgs_ # # with: -# = Name or IP-Number of host +# = Name or IP-Number of host # = table index of the GWIA Object -# +# # E.g. # ln -s /usr/share/munin/plugins/snmp__gwia_msgs_ \ # /etc/munin/plugins/snmp_foo.example.com_gwia_msgs_0 -# ...will monitor a single GWIA object on host foo.example.com. +# ...will monitor a single GWIA object on host foo.example.com. # # Parameters # community - Specify wich community string to use (Default: public) # port - Specify which port to read from (Default: 161) # host - Specify which host to monitor (Default: Read from link in servicedir) -# pos - Specify which table Object to read (Default: Read from link in servicedir, -# +# pos - Specify which table Object to read (Default: Read from link in servicedir, +# # You may adjust settings to your need via configuration in plugin-conf.d/munin-node: # [snmp_*_gwia_msgs_*] # env.port # env.community -# env.pos +# env.pos # env.host # # Parameters can also be specified on a per GWIA basis, eg: @@ -104,8 +104,8 @@ my $ERRORS_LABEL='Errors'; my $ERRORS_CRITICAL=10; if (defined $ARGV[0] and $ARGV[0] eq "snmpconf") -{ - print "require 1.3.6.1.4.1.23.2.70.1.1. [.*]\n"; # gwiaGatewayName +{ + print "require 1.3.6.1.4.1.23.2.70.1.1. [.*]\n"; # gwiaGatewayName print "require 1.3.6.1.4.1.23.2.70.1.7. [\\d*]\n"; # gwiaStatMsgsOut print "require 1.3.6.1.4.1.23.2.70.1.8. [\\d*]\n"; # gwiaStatMsgsIn print "require 1.3.6.1.4.1.23.2.70.1.11. [\\d*]\n"; # gwiaStatErrorsOut @@ -141,8 +141,8 @@ if (!defined ($session)) if (defined $ARGV[0] and $ARGV[0] eq "config") { - # get name of Internet Agent - my $gwname = &get_single ($session, "1.3.6.1.4.1.23.2.70.1.1.$pos"); # gwiaGatewayName + # get name of Internet Agent + my $gwname = &get_single ($session, "1.3.6.1.4.1.23.2.70.1.1.$pos"); # gwiaGatewayName # output to munin print "host_name $host diff --git a/plugins/groupwise/snmp__gwmta_msgs_ b/plugins/groupwise/snmp__gwmta_msgs_ index ee74f06a..184af277 100755 --- a/plugins/groupwise/snmp__gwmta_msgs_ +++ b/plugins/groupwise/snmp__gwmta_msgs_ @@ -23,8 +23,8 @@ # ------------------------------------------------------------ # Plugin to monitor Novell Groupwise MTA (GWMTA) # ------------------------------------------------------------ -# -# Management Information Base (MIB) GWMTA-MIB +# +# Management Information Base (MIB) GWMTA-MIB # # Naming Tree: 1.3.6.1.4.1.23 # iso(1) org(3) dod(6) internet(1) private(4) enterprises(1) novell(23) @@ -32,40 +32,40 @@ # To see all values available for your GWMTA, type # snmpwalk -v1 -c public -m GWMTA-MIB gwmta # -# This plugin fetches: +# This plugin fetches: # -# * mtaDomainName 1.3.6.1.4.1.23.2.37.1.1.1.2. -# * mtaTenMinuteRoutedMsgs - 1.3.6.1.4.1.23.2.37.1.1.1.10. +# * mtaDomainName 1.3.6.1.4.1.23.2.37.1.1.1.2. +# * mtaTenMinuteRoutedMsgs - 1.3.6.1.4.1.23.2.37.1.1.1.10. # * mtaTenMinuteUndeliverableMsgs - 1.3.6.1.4.1.23.2.37.1.1.1.12. # * mtaTenMinuteErrorMsgs - 1.3.6.1.4.1.23.2.37.1.1.1.14. # # Usage: # -------------- -# Link this file snmp__gwmta_msgs_ to your nodes servicedir [/etc/munin/plugins] +# Link this file snmp__gwmta_msgs_ to your nodes servicedir [/etc/munin/plugins] # -# as: -# snmp__gwmta_msgs_ +# as: +# snmp__gwmta_msgs_ # # with: -# = Name or IP-Number of host +# = Name or IP-Number of host # = table index of the GWMTA Object -# +# # E.g. # ln -s /usr/share/munin/plugins/snmp__gwmta_msgs_ \ # /etc/munin/plugins/snmp_foo.example.com_gwmta_msgs_0 -# ...will monitor a single GWMTA object on host foo.example.com. +# ...will monitor a single GWMTA object on host foo.example.com. # # Parameters # community - Specify wich community string to use (Default: public) # port - Specify which port to read from (Default: 161) # host - Specify which host to monitor (Default: Read from link in servicedir) -# pos - Specify which table Object to read (Default: Read from link in servicedir, -# +# pos - Specify which table Object to read (Default: Read from link in servicedir, +# # You may adjust settings to your need via configuration in plugin-conf.d/munin-node: # [snmp_*_gwmta_msgs_*] # env.port # env.community -# env.pos +# env.pos # env.host # # Parameters can also be specified on a per GWMTA basis, eg: @@ -104,8 +104,8 @@ my $ERRORS_CRITICAL=10; if (defined $ARGV[0] and $ARGV[0] eq "snmpconf") { - print "index 1.3.6.1.4.1.23.2.37.1.1.1.1.\n"; # mtaIndex - print "require 1.3.6.1.4.1.23.2.37.1.1.1.2. \n"; # mtaDomainName + print "index 1.3.6.1.4.1.23.2.37.1.1.1.1.\n"; # mtaIndex + print "require 1.3.6.1.4.1.23.2.37.1.1.1.2. \n"; # mtaDomainName print "require 1.3.6.1.4.1.23.2.37.1.1.1.10. [\\d+]\n"; # mtaTenMinuteRoutedMsgs print "require 1.3.6.1.4.1.23.2.37.1.1.1.12. [\\d+]\n"; # mtaTenMinuteUndeliverableMsgs print "require 1.3.6.1.4.1.23.2.37.1.1.1.14. [\\d+]\n"; # mtaTenMinuteErrorMsgs @@ -137,20 +137,20 @@ if (!defined ($session)) if (defined $ARGV[0] and $ARGV[0] eq "config") { - # get name of domain - my $domain = &get_single ($session, "1.3.6.1.4.1.23.2.37.1.1.1.2.$pos"); # mtaDomainName + # get name of domain + my $domain = &get_single ($session, "1.3.6.1.4.1.23.2.37.1.1.1.2.$pos"); # mtaDomainName # output to munin print "host_name $host graph_category mail graph_args --base 1000 graph_period $GRAPH_PERIOD -graph_title GWMTA load ($domain) -graph_info Monitors status of Groupwise MTA, here: $domain. It reports values for the last 10 minutes. +graph_title GWMTA load ($domain) +graph_info Monitors status of Groupwise MTA, here: $domain. It reports values for the last 10 minutes. graph_vlabel $GRAPH_VLABEL graph_args -l 0 routed.label $ROUTED_LABEL -routed.info mtaTenMinuteRoutedMsgs (1.3.6.1.4.1.23.2.37.1.1.1.10.) +routed.info mtaTenMinuteRoutedMsgs (1.3.6.1.4.1.23.2.37.1.1.1.10.) routed.critical $ROUTED_CRITICAL routed.type GAUGE routed.min 0 diff --git a/plugins/groupwise/snmp__gwpoa_ b/plugins/groupwise/snmp__gwpoa_ index 78051b3f..e17ca0c4 100755 --- a/plugins/groupwise/snmp__gwpoa_ +++ b/plugins/groupwise/snmp__gwpoa_ @@ -23,8 +23,8 @@ # ------------------------------------------------------------ # Plugin to monitor Novell Groupwise Post Office Agent (POA) # ------------------------------------------------------------ -# -# Management Information Base (MIB) GWPOA +# +# Management Information Base (MIB) GWPOA # # Naming Tree: 1.3.6.1.4.1.23 # iso(1) org(3) dod(6) internet(1) private(4) enterprises(1) novell(23) @@ -32,7 +32,7 @@ # To see all values available for your GWPOA, type # snmpwalk -v1 -c public -m GWPOA-MIB gwpoa # -# This plugin fetches: +# This plugin fetches: # # * poaPostOfficeName - 1.3.6.1.4.1.23.2.38.1.1.1.2. # * poaTotalMsgs - 1.3.6.1.4.1.23.2.38.1.1.1.3. @@ -46,10 +46,10 @@ # with the hostname (host) and the table index (pos) of the POA-Object # defined in the linkage. # -# snmp__gwpoa_ +# snmp__gwpoa_ # # with: -# = Name or IP-Number of host +# = Name or IP-Number of host # = Table index of the POA Object # # @@ -57,7 +57,7 @@ # ln -s /usr/share/munin/plugins/snmp__gwpoa_ \ # /etc/munin/plugins/snmp_foo.example.com_gwpoa_1 # -# ...will monitor the first POA-Object on host foo.example.com. +# ...will monitor the first POA-Object on host foo.example.com. # # # Configuration: @@ -66,13 +66,13 @@ # community - Specify wich community string to use (Default: public) # port - Specify which port to read from (Default: 161) # host - Specify which host to monitor (Default: Read from link in servicedir) -# pos - Specify which table Object to read (Default: Read from link in servicedir, -# +# pos - Specify which table Object to read (Default: Read from link in servicedir, +# # You may adjust settings via configuration in plugin-conf.d/munin-node: # [snmp_*_gwpoa_*] # env.port # env.community -# env.pos +# env.pos # env.host # # Parameters can also be specified on a per POA basis, eg: @@ -103,15 +103,15 @@ my $response; my $GRAPH_PERIOD = "minute"; my $GRAPH_VLABEL = "messages per $GRAPH_PERIOD"; my $TOTAL_LABEL = "TotalMsgs"; -my $UNDELIVERABLE_LABEL = "UndeliverableMsgs"; +my $UNDELIVERABLE_LABEL = "UndeliverableMsgs"; my $PROBLEM_LABEL = "ProblemMsgs"; my $ERRORS_LABEL = "AdmErrorMsgs"; my $ERRORS_CRITICAL = 10; if (defined $ARGV[0] and $ARGV[0] eq "snmpconf") { - print "index 1.3.6.1.4.1.23.2.38.1.1.1.1.\n"; # gwpoa - print "require 1.3.6.1.4.1.23.2.38.1.1.1.2. [.*]\n"; # poaPostOfficeName + print "index 1.3.6.1.4.1.23.2.38.1.1.1.1.\n"; # gwpoa + print "require 1.3.6.1.4.1.23.2.38.1.1.1.2. [.*]\n"; # poaPostOfficeName print "require 1.3.6.1.4.1.23.2.38.1.1.1.3. [\\d*]\n"; # poaTotalMsgs print "require 1.3.6.1.4.1.23.2.38.1.1.1.4. [\\d*]\n"; # poaProblemMsgs print "require 1.3.6.1.4.1.23.2.38.1.1.1.8. [\\d*]\n"; # poaUndeliverableMsgs @@ -145,8 +145,8 @@ if (!defined ($session)) if (defined $ARGV[0] and $ARGV[0] eq "config") { - # get Post Office Name - my $poname = &get_single ($session, "1.3.6.1.4.1.23.2.38.1.1.1.2.$pos"); # poaPostOfficeName + # get Post Office Name + my $poname = &get_single ($session, "1.3.6.1.4.1.23.2.38.1.1.1.2.$pos"); # poaPostOfficeName # output to munin print "host_name $host diff --git a/plugins/gunicorn/gunicorn_memory_status b/plugins/gunicorn/gunicorn_memory_status index 630af52e..b8948e35 100755 --- a/plugins/gunicorn/gunicorn_memory_status +++ b/plugins/gunicorn/gunicorn_memory_status @@ -9,10 +9,10 @@ Like Munin, this plugin is licensed under the GNU GPL v2 license http://www.opensource.org/licenses/GPL-2.0 - If you've put your gunicorn pid somewhere other than the + If you've put your gunicorn pid somewhere other than the default /var/run/gunicorn.pid, you can add a section like this to your munin-node's plugin configuration: - + [gunicorn_*] env.gunicorn_pid_path [path to your gunicorn pid] @@ -50,7 +50,7 @@ class GunicornMemoryStatus(): def _get_master_pid(self): master_pid_file = open(GUNICORN_PID_PATH) self.master_pid = master_pid_file.read().rstrip() - master_pid_file.close() + master_pid_file.close() return True def _get_total_memory(self): @@ -58,7 +58,7 @@ class GunicornMemoryStatus(): total = master +self. _get_worker_memory() total_in_mb = total / 1024 return total_in_mb - + def _get_master_memory(self): master = int(check_output( ['ps', '--pid', self.master_pid, '-o', 'rss', '--no-headers'])) diff --git a/plugins/gunicorn/gunicorn_status b/plugins/gunicorn/gunicorn_status index 471b291d..1d19179a 100755 --- a/plugins/gunicorn/gunicorn_status +++ b/plugins/gunicorn/gunicorn_status @@ -8,10 +8,10 @@ Like Munin, this plugin is licensed under the GNU GPL v2 license http://www.opensource.org/licenses/GPL-2.0 - If you've put your gunicorn pid somewhere other than the + If you've put your gunicorn pid somewhere other than the default /var/run/gunicorn.pid, you can add a section like this to your munin-node's plugin configuration: - + [gunicorn_*] env.gunicorn_pid_path [path to your gunicorn pid] @@ -59,7 +59,7 @@ class GunicornStatus(): def _get_master_pid(self): master_pid_file = open(GUNICORN_PID_PATH) self.master_pid = master_pid_file.read().rstrip() - master_pid_file.close() + master_pid_file.close() def _get_worker_pids(self, master_pid): children = check_output( diff --git a/plugins/haproxy/haproxy-bytes b/plugins/haproxy/haproxy-bytes index 303a849e..3ad78c0c 100755 --- a/plugins/haproxy/haproxy-bytes +++ b/plugins/haproxy/haproxy-bytes @@ -30,7 +30,7 @@ graph_vlabel=${title} case $1 in config) cat <) { + while () { my $url=$_; chomp($url); my $id=get_id($url); @@ -150,7 +150,7 @@ sub read_cache{ my %cache=(); if(-r $file){ open(FILE,'<'.$file); - while () { + while () { m/^(\S*)\s+(.*)$/; $cache{ $1 } = $2; } @@ -297,7 +297,7 @@ sub loadtime_config{ print "graph_total Total\n"; print "graph_info This graph is generated by a set of serial GETs to calculate the total time to load $urls{$id}. "; print "Note that browsers usually fork() the GET requests, resulting in a shorter total loading time.\n"; - + if(keys(%cache)>0){ for my $key ( sort reverse keys %cache ){ my $value=$cache{$key}; @@ -496,7 +496,7 @@ sub cache_values{ my $value=$cache{$key}; if($key =~ m/^([A-Za-z]+)\_(\S+)$/){ my $name=$2; - + if ($1 eq $type){ $name=get_fieldname($name); print $name . ".value " . $value . "\n"; @@ -609,7 +609,7 @@ if($ARGV[0] and $ARGV[0] eq "autoconf") { exit(0); } elsif($ARGV[0] and $ARGV[0] eq "cron") { - # This thing is run by cron and should write a cache file for munin-node to + # This thing is run by cron and should write a cache file for munin-node to # read from my $verbose=0; @@ -629,7 +629,7 @@ if($ARGV[0] and $ARGV[0] eq "autoconf") { while ( my ($id, $url) = each(%urls) ) { $verbose && print "Fetching $url (id: $id)... \n"; - + $t0=0; $status=0; %output=(); @@ -682,7 +682,7 @@ if($ARGV[0] and $ARGV[0] eq "autoconf") { $tag=$$link[0] . " " . $$link[1]; } $output{"tags_" . $$link[0] . "-" . $$link[1]}+=1; - + if(filter($tag)){ $verbose && print " Processing: " . $$link[0] . " " . $$link[1] . " " . $$link[2] . "\n"; @@ -693,7 +693,7 @@ if($ARGV[0] and $ARGV[0] eq "autoconf") { } my $suburl=$$link[2]; - + $t0 = [gettimeofday]; $response = $browser->get($suburl); $output{"loadtime_" . $host} += sprintf("%.6f",tv_interval ( $t0, [gettimeofday])); @@ -720,13 +720,13 @@ if($ARGV[0] and $ARGV[0] eq "autoconf") { while ( my ($id, $value) = each(%input) ) { $input{$id}="U"; } - + # Adding new values while ( my ($id, $value) = each(%output) ) { $input{$id}=$value; $verbose && print " Result: " . $id . " -> " . $value . "\n"; } - + # Writing the cache $verbose && print "Writing cache file: " . $cachefile . "... "; open(FILE,">".$cachefile); @@ -739,7 +739,7 @@ if($ARGV[0] and $ARGV[0] eq "autoconf") { exit(0); }elsif($ARGV[0] and $ARGV[0] eq "config") { my %urls=&read_urls($url_file); - + $debug && print "Reading cache file\n"; my $cachefile=$cachedir . "/" . &get_cache_file_name($scriptname,$id); my %cache=read_cache($cachefile); @@ -773,6 +773,6 @@ if($ARGV[0] and $ARGV[0] eq "autoconf") { } else { cache_values(\%cache, $type); } -} +} # vim:syntax=perl diff --git a/plugins/http/http_request_time b/plugins/http/http_request_time index c8c4b9a0..8c796809 100755 --- a/plugins/http/http_request_time +++ b/plugins/http/http_request_time @@ -4,7 +4,7 @@ This plugin does http requests to specified URLs and takes the response time. Use it to monitor remote sites. - + LWP::UserAgent and Time::HiRes are required =head1 CONFIGURATION @@ -70,7 +70,7 @@ for (my $i = 1; $ENV{"url$i"}; $i++) my $proxy = $ENV{"url${i}_proxy"}; my $name = $ENV{"url${i}_name"} || clean($url); my $label = $ENV{"url${i}_label"} || $url; - + $URLS{$name}={ url=>$url, proxy=>$proxy, @@ -161,7 +161,7 @@ foreach my $name (keys %URLS) { if ($response->is_success) { $$url{'time'}=sprintf("%d",tv_interval($t1,$t2)*1000); - }; + }; }; print("multigraph http_request_time\n"); diff --git a/plugins/http/mongrel_memory b/plugins/http/mongrel_memory index 1638ba65..8448d5cd 100755 --- a/plugins/http/mongrel_memory +++ b/plugins/http/mongrel_memory @@ -4,26 +4,26 @@ # Copyright (C) 2009 Matthias Marschall - mm@agileweboperations.com # # Based on: -# mongrel_process_memory - A munin plugin to monitor memory size of +# mongrel_process_memory - A munin plugin to monitor memory size of # each individual mongrel process # Copyright (C) 2007 Ben VandenBos and Avvo, Inc. # # This program is free software; you can redistribute it and/or modify -# it under the terms of the GNU General Public License version 2 +# it under the terms of the GNU General Public License version 2 # as published by the Free Software Foundation. -# +# # 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 Street, Fifth Floor, Boston, MA 02110-1301 USA. # # Author: Ben VandenBos # Contributors: Adam Jacob () -# Ryan Woodrum +# Ryan Woodrum # Matthias Marschall (mm@agileweboperations.com) # #%# family=auto @@ -31,7 +31,7 @@ module Munin class MongrelProcessMemory - + def run pid_port_map = get_pids() port_list = Hash.new @@ -40,7 +40,7 @@ module Munin puts "mongrel_#{port}.value #{rss}" end end - + def get_pids h = Hash.new pids = [] @@ -57,10 +57,10 @@ module Munin def autoconf get_pids().length > 0 end - + end end - + mpm = Munin::MongrelProcessMemory.new case ARGV[0] diff --git a/plugins/http/mongrel_process_memory b/plugins/http/mongrel_process_memory index b06267ed..0febcfe0 100755 --- a/plugins/http/mongrel_process_memory +++ b/plugins/http/mongrel_process_memory @@ -1,32 +1,32 @@ #!/usr/bin/env ruby # -# mongrel_process_memory - A munin plugin to monitor memory size of +# mongrel_process_memory - A munin plugin to monitor memory size of # each individual mongrel process # Copyright (C) 2007 Ben VandenBos and Avvo, Inc. # # This program is free software; you can redistribute it and/or modify -# it under the terms of the GNU General Public License version 2 +# it under the terms of the GNU General Public License version 2 # as published by the Free Software Foundation. -# +# # 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 Street, Fifth Floor, Boston, MA 02110-1301 USA. # # Author: Ben VandenBos # Contributors: Adam Jacob () -# Ryan Woodrum +# Ryan Woodrum # #%# family=auto #%# capabilities=autoconf module Munin class MongrelProcessMemory - + def run h = get_pids() ps_output = "" @@ -49,10 +49,10 @@ module Munin port_list.sort.each do |port| puts "mongrel_#{port[0]}.value #{port[1]}" end - - end + + end end - + def get_pids h = Hash.new pids = [] @@ -68,10 +68,10 @@ module Munin def autoconf pids.length > 0 end - + end end - + mpm = Munin::MongrelProcessMemory.new case ARGV[0] diff --git a/plugins/http/multi_http_responsetime b/plugins/http/multi_http_responsetime index 94086e05..1596b197 100755 --- a/plugins/http/multi_http_responsetime +++ b/plugins/http/multi_http_responsetime @@ -1,7 +1,7 @@ #! /usr/bin/perl # This plugin based on http_responestime designed by Anders Nordby # -# It is written to control the quality of an internet conneting by +# It is written to control the quality of an internet conneting by # downloading a favicon.ico file from a lot - unlimited - count of # domains. # @@ -100,11 +100,11 @@ if ($ARGV[0] && $ARGV[0] eq "autoconf") { $vhost =~ s@^\w+://(.+?)/.*@\1@; $proto =~ s@^(\w+)://.*@\1@; -# If url_array[] is a domain, vhost will be contain the the strinf "http://" +# If url_array[] is a domain, vhost will be contain the the strinf "http://" if($vhost =~ /http/) { print "timespent$i.label $vhost\n"; } else { - print "timespent$i.label $proto://$vhost\n"; + print "timespent$i.label $proto://$vhost\n"; } print "timespent$i.info Ladezeit von $url_array[$i]/favicon.ico\n"; diff --git a/plugins/icecast/icecast2 b/plugins/icecast/icecast2 index 07de2966..2287302d 100755 --- a/plugins/icecast/icecast2 +++ b/plugins/icecast/icecast2 @@ -1,21 +1,21 @@ #!/bin/sh -# +# # Plugin to monitor icecast2 streams / listeners -# +# # Contributed by drew Roberts # # based on the postfix_mailqueue plugin as per below -# +# # Plugin to monitor postfix mail spools -# +# # Contributed by Nicolai Langfeldt -# +# # $Log$ # Revision 1.0 2008/07/04 16:02:36 zotz # Initial work # -# +# #%# family=auto #%# capabilities=autoconf diff --git a/plugins/icecast/icecast2_ b/plugins/icecast/icecast2_ index 4b0eac8e..91cd00fa 100755 --- a/plugins/icecast/icecast2_ +++ b/plugins/icecast/icecast2_ @@ -147,7 +147,7 @@ def hent_XML(): print "%s_%s_ogg.value %s" % (sourcename, bitrate, listeners) else: print sys.argv[1] - + if __name__ == "__main__": hent_XML() diff --git a/plugins/icecast/icecast2_all b/plugins/icecast/icecast2_all index 793403e8..21549d58 100755 --- a/plugins/icecast/icecast2_all +++ b/plugins/icecast/icecast2_all @@ -66,7 +66,7 @@ def hent_XML(): print "%s.label %s" % (source, "/" + source) else: print sys.argv[1] - + if __name__ == "__main__": hent_XML() diff --git a/plugins/icecast/icecast2_simple b/plugins/icecast/icecast2_simple index 5ebf8acf..dc6c2202 100755 --- a/plugins/icecast/icecast2_simple +++ b/plugins/icecast/icecast2_simple @@ -1,7 +1,7 @@ #!/usr/bin/env ruby # # Plugin author: Gunnar Wolf -# +# # You are hereby granted authorization to copy, use, modify, distribute, # and in general do anything you please with this plugin. It is too simple # even to GPL-protect it. @@ -18,7 +18,7 @@ require 'open-uri' def get_conf # Default values - conf = {:host => '127.0.0.1', :port => 8000, + conf = {:host => '127.0.0.1', :port => 8000, :username => 'admin', :password => 'hackme' } conf.keys.each do |key| env_key = sprintf('icecast_%s', key) @@ -28,10 +28,10 @@ def get_conf end def get_data(conf) - begin - data = Hpricot(open(sprintf('http://%s:%s/admin/stats', + begin + data = Hpricot(open(sprintf('http://%s:%s/admin/stats', conf[:host], conf[:port]), - :http_basic_authentication=>[conf[:username], + :http_basic_authentication=>[conf[:username], conf[:password]])) rescue OpenURI::HTTPError puts "Cannot connect: HTTP connection error" diff --git a/plugins/icecast/icecast_ b/plugins/icecast/icecast_ index 80fbbfb4..6ec74fb1 100755 --- a/plugins/icecast/icecast_ +++ b/plugins/icecast/icecast_ @@ -50,7 +50,7 @@ pw = "yourpassword" #exclude = ("123.123.123.123",) exclude = () -# Exclude these sources from calculation. This is useful to excluse special sources like +# Exclude these sources from calculation. This is useful to excluse special sources like # fallback sources which doesn't expose the same informations and then break this script # Ever add fallback sources to this list #source_exclude = ["/fallback.mp3", "/fallback.ogg"] @@ -141,7 +141,7 @@ except IndexError: if plugin_name == "icecast_uptime": for s in sources: print "%s.value %s" % (s["mount"].strip("/").replace(".","_").replace("-","_"), int(s["connected"]) / 3600.) - + elif plugin_name == "icecast_traffic": f = opener.open("http://%s/admin/stats.xml" % server) tree = ElementTree() diff --git a/plugins/imapproxy/imapproxy_multi b/plugins/imapproxy/imapproxy_multi index 12afc642..16fc5dae 100755 --- a/plugins/imapproxy/imapproxy_multi +++ b/plugins/imapproxy/imapproxy_multi @@ -1,7 +1,7 @@ #!/usr/bin/env python """=cut -=head1 NAME +=head1 NAME imapproxy - Munin multigraph plugin to monitor imapproxy using pimpstat @@ -55,7 +55,7 @@ def print_config(): print "cache_misses.type DERIVE" print "cache_misses.label Cache Misses" print "cache_misses.min 0" - print + print print "multigraph imapproxy_connections" print "graph_title Connection Statistics For ImapProxy" print "graph_args -l 0 --base 1000" @@ -79,7 +79,7 @@ def print_fetch(): connections_created = 0 connections_reused = 0 connections = Popen( - "pimpstat -c | egrep '(Total (Reused|Created)|Cache (Hits|Misses))'", + "pimpstat -c | egrep '(Total (Reused|Created)|Cache (Hits|Misses))'", shell=True, stdout=PIPE ) diff --git a/plugins/ip6/ip6_ b/plugins/ip6/ip6_ index 20408378..54a5f1e3 100755 --- a/plugins/ip6/ip6_ +++ b/plugins/ip6/ip6_ @@ -1,6 +1,6 @@ #!/bin/sh # -# Patched version of ip_ plugin to support IPv6 and ip6tables. +# Patched version of ip_ plugin to support IPv6 and ip6tables. # Most of plugin done by munin core developers. Modified for IPv6 support # by Lasse Karstensen February 2009. # @@ -60,7 +60,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; diff --git a/plugins/ipvs/ipvs_active b/plugins/ipvs/ipvs_active index c6fd9255..ded74d7a 100755 --- a/plugins/ipvs/ipvs_active +++ b/plugins/ipvs/ipvs_active @@ -35,7 +35,7 @@ IPLIST=$ips if [ "$1" = "autoconf" ]; then - echo yes + echo yes exit 0 fi @@ -64,7 +64,7 @@ fi function get_ip { # Read the output ipvsadm -l -n | nl | while read line; do - # If match the ip, print the line number + # If match the ip, print the line number if ( echo $line | grep -e $IP > /dev/null ); then MAT=`echo $line | cut -d " " -f 1` echo $MAT @@ -84,7 +84,7 @@ for IP in $IPLIST; do # Parse lines while read line; do - + # Get line numbers N=`echo $line | cut -d " " -f 1` @@ -94,7 +94,7 @@ for IP in $IPLIST; do if ( echo $line | grep -e TCP -e UDP > /dev/null ); then break fi - + COUNT=`expr $COUNT + 1` fi done < $F1 diff --git a/plugins/ipvs/ipvs_bps b/plugins/ipvs/ipvs_bps index 70e045e3..c13c30d4 100755 --- a/plugins/ipvs/ipvs_bps +++ b/plugins/ipvs/ipvs_bps @@ -35,7 +35,7 @@ IPLIST=$ips if [ "$1" = "autoconf" ]; then - echo yes + echo yes exit 0 fi diff --git a/plugins/ipvs/ipvs_conn b/plugins/ipvs/ipvs_conn index fb480b92..cec4e391 100755 --- a/plugins/ipvs/ipvs_conn +++ b/plugins/ipvs/ipvs_conn @@ -35,7 +35,7 @@ IPLIST=$ips if [ "$1" = "autoconf" ]; then - echo yes + echo yes exit 0 fi @@ -67,7 +67,7 @@ fi function get_ip { # Read the output ipvsadm -l -n | nl | while read line; do - # If match the ip, print the line number + # If match the ip, print the line number if ( echo $line | grep -e $IP > /dev/null ); then MAT=`echo $line | cut -d " " -f 1` echo $MAT @@ -87,7 +87,7 @@ for IP in $IPLIST; do # Parse lines while read line; do - + # Get line numbers N=`echo $line | cut -d " " -f 1` @@ -97,7 +97,7 @@ for IP in $IPLIST; do if ( echo $line | grep -e TCP -e UDP > /dev/null ); then break fi - + # Get ActiveConn number NUM1=`echo $line | awk '{print $6}'` # Sum it @@ -106,7 +106,7 @@ for IP in $IPLIST; do NUM2=`echo $line | awk '{print $7}'` # Sum it INACTCONCNT=$(( INACTCONCNT + NUM2)) - + COUNT=`expr $COUNT + 1` fi done < $F1 diff --git a/plugins/ipvs/ipvs_cps b/plugins/ipvs/ipvs_cps index 41654535..502ff9f0 100755 --- a/plugins/ipvs/ipvs_cps +++ b/plugins/ipvs/ipvs_cps @@ -35,7 +35,7 @@ IPLIST=$ips if [ "$1" = "autoconf" ]; then - echo yes + echo yes exit 0 fi diff --git a/plugins/ircd/irc2 b/plugins/ircd/irc2 index 4a37c396..21361098 100755 --- a/plugins/ircd/irc2 +++ b/plugins/ircd/irc2 @@ -66,7 +66,7 @@ if($ARGV[0] and $ARGV[0] eq "config") { my %result; # We create a new PoCo-IRC object -my $irc = POE::Component::IRC->spawn( +my $irc = POE::Component::IRC->spawn( nick => $nickname, ircname => $ircname, server => $server, @@ -119,7 +119,7 @@ sub irc_001 { } -#irc_251: 'moo.us.p2p-network.net' 'There are 155 users and 3397 invisible on 16 servers' [There are 155 users and 3397 invisible on 16 servers] +#irc_251: 'moo.us.p2p-network.net' 'There are 155 users and 3397 invisible on 16 servers' [There are 155 users and 3397 invisible on 16 servers] # luserclient sub irc_251 { #print "In 251\n"; @@ -152,7 +152,7 @@ sub irc_251 { #printf "251 Got clients=%d servers=%d\n", ($result{'clients'} || -1), ($result{'servers'} || -1); } -#irc_252: 'moo.us.p2p-network.net' '18 :operator(s) online' [18, operator(s) online] +#irc_252: 'moo.us.p2p-network.net' '18 :operator(s) online' [18, operator(s) online] # opers sub irc_252 { my $sender = $_[SENDER]; @@ -165,7 +165,7 @@ sub irc_252 { #printf "254 Got channels %d\n", ($result{'channels'} || -1); } -#irc_253: 'moo.us.p2p-network.net' '1 :unknown connection(s)' [1, unknown connection(s)] +#irc_253: 'moo.us.p2p-network.net' '1 :unknown connection(s)' [1, unknown connection(s)] sub irc_253 { my $sender = $_[SENDER]; my $irc = $sender->get_heap(); @@ -177,7 +177,7 @@ sub irc_253 { #printf "254 Got channels %d\n", ($result{'channels'} || -1); } -#irc_254: 'moo.us.p2p-network.net' '1325 :channels formed' [1325, channels formed] +#irc_254: 'moo.us.p2p-network.net' '1325 :channels formed' [1325, channels formed] # luserchannels sub irc_254 { my $sender = $_[SENDER]; @@ -190,7 +190,7 @@ sub irc_254 { #printf "254 Got channels %d\n", ($result{'channels'} || -1); } -#irc_255: 'moo.us.p2p-network.net' 'I have 348 clients and 1 servers' [I have 348 clients and 1 servers] +#irc_255: 'moo.us.p2p-network.net' 'I have 348 clients and 1 servers' [I have 348 clients and 1 servers] # local clients/servers sub irc_255 { my $sender = $_[SENDER]; @@ -203,7 +203,7 @@ sub irc_255 { } } -#irc_265: 'moo.us.p2p-network.net' 'Current Local Users: 348 Max: 1900' [Current Local Users: 348 Max: 1900] +#irc_265: 'moo.us.p2p-network.net' 'Current Local Users: 348 Max: 1900' [Current Local Users: 348 Max: 1900] sub irc_265 { #print "In 265\n"; my $sender = $_[SENDER]; @@ -216,7 +216,7 @@ sub irc_265 { } } -#irc_266: 'moo.us.p2p-network.net' 'Current Global Users: 3552 Max: 8742' [Current Global Users: 3552 Max: 8742] +#irc_266: 'moo.us.p2p-network.net' 'Current Global Users: 3552 Max: 8742' [Current Global Users: 3552 Max: 8742] sub irc_266 { #print "In 266\n"; my $sender = $_[SENDER]; diff --git a/plugins/ircd/ircd b/plugins/ircd/ircd index 7770d354..4712403c 100755 --- a/plugins/ircd/ircd +++ b/plugins/ircd/ircd @@ -2,12 +2,12 @@ = 0 && $ARGV[0] eq "autoconf") { - + unless (-f $SMCF) { print "no\n"; exit 0; @@ -433,7 +433,7 @@ sub SaveState { printf FSTATE "%-20s %s\n", $k, $h->{$k}; } close FSTATE; - + Munin::Plugin::save_state(%$h); return 1; } @@ -516,7 +516,7 @@ __DATA__ conn Connections conn.info SMTP Connections per time unit msgs Messages -msgs.info Messages per time unit +msgs.info Messages per time unit rcpt Recipients rcpt.info Recipients per time unit @@ -556,8 +556,8 @@ kbytes.info Volume (KBytes) per time unit j-greyvalid Grey Validated records j-greyvalid.info Grey Validated records -j-greypend Grey Waiting records -j-greypend.info Grey Waiting records +j-greypend Grey Waiting records +j-greypend.info Grey Waiting records j-greywhitelist Grey Whitelisted records j-greywhitelist.info Grey Whitelisted records j-greyblacklist j-greyblacklist diff --git a/plugins/jenkins/jenkins_nodes_ b/plugins/jenkins/jenkins_nodes_ index 595e7f96..ab18cc20 100755 --- a/plugins/jenkins/jenkins_nodes_ +++ b/plugins/jenkins/jenkins_nodes_ @@ -157,15 +157,15 @@ if ( exists $ARGV[0] and $ARGV[0] eq "config" ) { print "graph_vlabel Executors\n"; print "graph_info The Graph shows the Jenkins Executors\n"; print "executors_offline.label offline\n"; - print "executors_offline.type GAUGE\n"; + print "executors_offline.type GAUGE\n"; print "executors_offline.draw AREA\n"; - print "executors_offline.colour 8A8A8A\n"; + print "executors_offline.colour 8A8A8A\n"; print "executors_busy.label busy\n"; - print "executors_busy.type GAUGE\n"; + print "executors_busy.type GAUGE\n"; print "executors_busy.draw STACK\n"; print "executors_idle.label idle\n"; - print "executors_idle.type GAUGE\n"; - print "executors_idle.draw STACK\n"; + print "executors_idle.type GAUGE\n"; + print "executors_idle.draw STACK\n"; } } else { @@ -249,8 +249,8 @@ if ( exists $ARGV[0] and $ARGV[0] eq "config" ) { } if( $type eq "executors" ) { - my $busyExecutors = $parsed->{'busyExecutors'}; - my $totalExecutors = 0; + my $busyExecutors = $parsed->{'busyExecutors'}; + my $totalExecutors = 0; my $offlineExecutors = 0; foreach my $cur(@{$parsed->{'computer'}}) { $totalExecutors += $cur->{'numExecutors'}; @@ -258,9 +258,9 @@ if ( exists $ARGV[0] and $ARGV[0] eq "config" ) { $offlineExecutors += $cur->{'numExecutors'}; } } - print "executors_idle.value ", ($totalExecutors - $busyExecutors - $offlineExecutors), "\n"; - print "executors_busy.value $busyExecutors\n"; - print "executors_offline.value $offlineExecutors\n"; + print "executors_idle.value ", ($totalExecutors - $busyExecutors - $offlineExecutors), "\n"; + print "executors_busy.value $busyExecutors\n"; + print "executors_offline.value $offlineExecutors\n"; } } diff --git a/plugins/jmx/examples/java/java_process_memory.conf b/plugins/jmx/examples/java/java_process_memory.conf index cf872a9c..3885f791 100644 --- a/plugins/jmx/examples/java/java_process_memory.conf +++ b/plugins/jmx/examples/java/java_process_memory.conf @@ -42,5 +42,3 @@ os_memory_vm.label os vmem committed os_memory_vm.jmxObjectName java.lang:type=OperatingSystem os_memory_vm.jmxAttributeName CommittedVirtualMemorySize os_memory_vm.graph no - - diff --git a/plugins/jmx/examples/java/java_threads.conf b/plugins/jmx/examples/java/java_threads.conf index 42a9bcc1..06e39b3d 100644 --- a/plugins/jmx/examples/java/java_threads.conf +++ b/plugins/jmx/examples/java/java_threads.conf @@ -10,5 +10,3 @@ java_thread_count.jmxAttributeName ThreadCount java_thread_count_peak.label peak java_thread_count_peak.jmxObjectName java.lang:type=Threading java_thread_count_peak.jmxAttributeName PeakThreadCount - - diff --git a/plugins/jmx/examples/tomcat/catalina_times.conf b/plugins/jmx/examples/tomcat/catalina_times.conf index 5260c8b4..4e0572b7 100644 --- a/plugins/jmx/examples/tomcat/catalina_times.conf +++ b/plugins/jmx/examples/tomcat/catalina_times.conf @@ -10,7 +10,7 @@ catalina_request_count.jmxObjectName Catalina:name=http-8080,type=GlobalRequestP catalina_request_count.jmxAttributeName requestCount catalina_request_count.graph no catalina_request_count.type DERIVE -catalina_request_count.min 0 +catalina_request_count.min 0 catalina_proc_time.label time catalina_proc_time.jmxObjectName Catalina:name=http-8080,type=GlobalRequestProcessor @@ -27,5 +27,3 @@ catalina_proc_tpr.cdef catalina_request_count,0,EQ,0,catalina_proc_time,catalina catalina_max_time.label peak catalina_max_time.jmxObjectName Catalina:name=http-8080,type=GlobalRequestProcessor catalina_max_time.jmxAttributeName maxTime - - diff --git a/plugins/jmx/readme.txt b/plugins/jmx/readme.txt index 44a01282..20f1e77d 100644 --- a/plugins/jmx/readme.txt +++ b/plugins/jmx/readme.txt @@ -5,7 +5,7 @@ As soon as JMX embedded in Java 5, any Java process may expose parameters to be look http://java.sun.com/j2se/1.5.0/docs/guide/management/agent.html and http://java.sun.com/jmx for details In Java version < 5 it is still possible to expose JMX interface using third party libraries -To see what can be monitored by JMX, run /bin/jconsole.exe and connect to +To see what can be monitored by JMX, run /bin/jconsole.exe and connect to the host/port you setup in your Java process. Some examples are: diff --git a/plugins/joomla/joomla-sessions b/plugins/joomla/joomla-sessions index e93f38dd..a75db535 100755 --- a/plugins/joomla/joomla-sessions +++ b/plugins/joomla/joomla-sessions @@ -90,7 +90,7 @@ EOC #Anonym Session count my $anonsessions = `$MYSQL $MYSQLOPTS -e 'SELECT COUNT( session_id ) FROM $DATABASE.jos_session WHERE usertype = "''"'`; -$anonsessions =~ /(\d+)/; +$anonsessions =~ /(\d+)/; print "anonsessions.value ".$1."\n"; #Registered count diff --git a/plugins/jvm/jstat__gctime b/plugins/jvm/jstat__gctime index d3f8e8ff..de221292 100755 --- a/plugins/jvm/jstat__gctime +++ b/plugins/jvm/jstat__gctime @@ -112,7 +112,7 @@ config_bea_jdk() echo 'Young_Pause.min 0' echo 'Old_Pause.label Old_GC Pause' echo 'Old_Pause.min 0' - + } print_sun_stats() @@ -126,7 +126,7 @@ ${JAVA_HOME}/bin/jstat -gc ${PidNum} | tail -1 | awk \ EC = $5; \ EU = $6; \ OC = $7; \ - OU = $8; + OU = $8; \ PC = $9; \ PU = $10; \ YGC = $11; \ diff --git a/plugins/jvm/jstat__heap b/plugins/jvm/jstat__heap index de830218..c4c4c33a 100755 --- a/plugins/jvm/jstat__heap +++ b/plugins/jvm/jstat__heap @@ -117,7 +117,7 @@ config_sun_jdk() config_bea_jdk() { config_common - + echo "NurserySize.label NurserySize" echo "HeapSize.label HeapSize" echo "UsedHeapSize.label UsedHeapSize" @@ -137,7 +137,7 @@ ${JAVA_HOME}/bin/jstat -gc ${PidNum} | tail -1 | awk \ EC = $5; \ EU = $6; \ OC = $7; \ - OU = $8; + OU = $8; \ PC = $9; \ PU = $10; \ \ diff --git a/plugins/jvm/jvm_sun_memory b/plugins/jvm/jvm_sun_memory index c622e1dc..a170561c 100755 --- a/plugins/jvm/jvm_sun_memory +++ b/plugins/jvm/jvm_sun_memory @@ -19,12 +19,12 @@ # env.graphtitle (default: "Sun Java") # You need to configure your Sun JVM with these options: -# -verbose:gc +# -verbose:gc # -Xloggc:/var/log/app/jvm/gc.log # -XX:+PrintGCTimeStamps # -XX:+PrintGCDetails -# History: +# History: # This plugin was developed by various people over some time - no logs # of this has been found. - In 2006 significant contributions was @@ -47,7 +47,7 @@ my $title = "$grtitle memory usage"; my $info = "Write som info about this graph..."; sub analyze_record { - # Match all interesting elements of a record and insert them + # Match all interesting elements of a record and insert them # into a hash my $record = shift; @@ -145,7 +145,7 @@ while () { ($now,undef) = split(/:/,$_,2); $now = $lastnow unless $now; } - + if (/.+Tenured.+/) { $record = $_; } elsif (/^:.+/) { diff --git a/plugins/jvm/jvm_sun_minorgcs b/plugins/jvm/jvm_sun_minorgcs index caa99a9a..23509a51 100755 --- a/plugins/jvm/jvm_sun_minorgcs +++ b/plugins/jvm/jvm_sun_minorgcs @@ -19,12 +19,12 @@ # env.grname (default: "sun-jvm". Used for state file-name) # You need to configure your Sun JVM with these options: -# -verbose:gc +# -verbose:gc # -Xloggc:/var/log/app/jvm/gc.log # -XX:+PrintGCTimeStamps # -XX:+PrintGCDetails -# History: +# History: # This plugin was developed by various people over some time - no logs # of this has been found. - In 2006 significant contributions was @@ -94,7 +94,7 @@ open (OUT, ">$statefile") or die "Could not open $statefile for reading: $!\n"; print OUT "$pos:$count:$timespent\n"; close OUT; -sub parseFile { +sub parseFile { my ($fname, $start, $count, $timespent) = @_; my @secs; diff --git a/plugins/jvm/jvm_sun_tenuredgcs b/plugins/jvm/jvm_sun_tenuredgcs index 9ea42e71..78487e06 100755 --- a/plugins/jvm/jvm_sun_tenuredgcs +++ b/plugins/jvm/jvm_sun_tenuredgcs @@ -17,12 +17,12 @@ # env.graphtitle (default: "Sun Java") # You need to configure your Sun JVM with these options: -# -verbose:gc +# -verbose:gc # -Xloggc:/var/log/app/jvm/gc.log # -XX:+PrintGCTimeStamps # -XX:+PrintGCDetails -# History: +# History: # This plugin was developed by various people over some time - no logs # of this has been found. - In 2006 significant contributions was diff --git a/plugins/kamailio/kamailio_memory b/plugins/kamailio/kamailio_memory index fa256a3c..83a3366a 100755 --- a/plugins/kamailio/kamailio_memory +++ b/plugins/kamailio/kamailio_memory @@ -31,9 +31,9 @@ GPLv2 use strict; -my %WANTED = ( "kamailio" => "ram_total", +my %WANTED = ( "kamailio" => "ram_total", "rtpproxy" => "ram_rtpproxy", - "freeswitch" => "ram_freeswitch", + "freeswitch" => "ram_freeswitch", ); my %VALUE = ( "ram_total" => 0, diff --git a/plugins/kamailio/kamailio_mysql_shared_memory b/plugins/kamailio/kamailio_mysql_shared_memory index d7405dfa..d163c947 100755 --- a/plugins/kamailio/kamailio_mysql_shared_memory +++ b/plugins/kamailio/kamailio_mysql_shared_memory @@ -93,9 +93,9 @@ use strict; my $MYSQLADMIN = $ENV{mysql} || "mysql"; my $COMMAND = "$MYSQLADMIN $ENV{mysqlauth} $ENV{kamailiodb} -e 'select * from statistics order by id desc limit 1\\G'"; -my %WANTED = ( "shm_free_used_size" => "shmem_total", +my %WANTED = ( "shm_free_used_size" => "shmem_total", "shm_real_used_size" => "shmem_real_used", - "shm_used_size" => "shmem_used", + "shm_used_size" => "shmem_used", ); my %VALUE = ( "shmem_total" => 0, diff --git a/plugins/kamailio/kamailio_transactions_users b/plugins/kamailio/kamailio_transactions_users index f7f68220..9af486ec 100755 --- a/plugins/kamailio/kamailio_transactions_users +++ b/plugins/kamailio/kamailio_transactions_users @@ -94,8 +94,8 @@ my $MYSQL = $ENV{mysql} || "mysql"; my $COMMAND = "$MYSQL $ENV{mysqlauth} $ENV{kamailiodb} -e 'select * from statistics order by id desc limit 1\\G'"; my %WANTED = ( "ul_users" => "users", - "ul_contact" => "contacts", - "tm_active" => "transactions", + "ul_contact" => "contacts", + "tm_active" => "transactions", ); my %VALUE = ( "users" => 0, diff --git a/plugins/keystone/keystone_stats b/plugins/keystone/keystone_stats index 4ce1d90c..ec0e596f 100755 --- a/plugins/keystone/keystone_stats +++ b/plugins/keystone/keystone_stats @@ -55,7 +55,7 @@ def get_status(): total['users'] += 1 if user['enabled']: enabled['users'] += 1 - + # Ldap and pam driver don't support get_all_tenants() # kvs and sql implement get_tenants() instead of get_all_tenants() # Whoo: None of backend implements the correct function @@ -89,7 +89,7 @@ if __name__ == '__main__': if sys.argv[1] == "config": print_config() elif sys.argv[1] == "autoconf": - if not successful_import: + if not successful_import: print 'no (failed import keystone module)' sys.exit(0) try: diff --git a/plugins/libvirt/kvm_cpu b/plugins/libvirt/kvm_cpu index f671a4c6..c9cad306 100755 --- a/plugins/libvirt/kvm_cpu +++ b/plugins/libvirt/kvm_cpu @@ -70,7 +70,7 @@ def find_vm_names(pids): cmdline = open("/proc/%s/cmdline" % pid, "r") result[pid] = clean_vm_name(re.sub(r"^.*-name\x00([a-zA-Z0-9.-_-]*)\x00\-.*$",r"\1", cmdline.readline())) return result - + def list_pids(): ''' Find the pid of kvm processes @return a list of pids from running kvm @@ -85,7 +85,7 @@ def fetch(vms): for ( pid, name ) in vms.iteritems(): ( user, system ) = open("/proc/%s/stat" % pid, 'r').readline().split(' ')[13:15] print '%s_cpu.value %d' % ( name, int(user) + int(system) ) - + if __name__ == "__main__": if len(sys.argv) > 1: if sys.argv[1] in ['autoconf', 'detect']: diff --git a/plugins/libvirt/kvm_io b/plugins/libvirt/kvm_io index 4bbf40a2..972f4983 100755 --- a/plugins/libvirt/kvm_io +++ b/plugins/libvirt/kvm_io @@ -37,7 +37,7 @@ graph_args --base 1024 print "%s_read.info I/O used by virtual machine %s" % (vm, vm) print "%s_write.label %s" % (vm, vm) print "%s_write.type COUNTER" % vm - print "%s_write.min 0" % vm + print "%s_write.min 0" % vm print "%s_write.draw LINE1" % vm print "%s_write.negative %s_read" % (vm, vm) print "%s_write.info I/O used by virtual machine %s" % (vm, vm) @@ -53,7 +53,7 @@ def clean_vm_name(vm_name): vm_name = re.sub(suffix,'',vm_name) return re.sub(r"[^a-zA-Z0-9_]", "_", vm_name) - + def fetch(vms): ''' Fetch values for a list of pids @param dictionnary {kvm_pid: cleaned vm name} @@ -64,11 +64,11 @@ def fetch(vms): for line in f.readlines(): if "read_bytes" in line: read = line.split()[1] - print "%s_read.value %s" % (vms[pid], read) + print "%s_read.value %s" % (vms[pid], read) if "write_bytes" in line: write = line.split()[1] - print "%s_write.value %s" % (vms[pid], write) - break + print "%s_write.value %s" % (vms[pid], write) + break f.close() def detect_kvm(): @@ -87,14 +87,14 @@ def find_vm_names(pids): cmdline = open("/proc/%s/cmdline" % pid, "r") result[pid] = clean_vm_name(re.sub(r"^.*-name\x00([a-zA-Z0-9.-_-]*)\x00\-.*$",r"\1", cmdline.readline())) return result - + def list_pids(): ''' Find the pid of kvm processes @return a list of pids from running kvm ''' pid = Popen("pidof qemu-kvm qemu-system-x86_64 kvm", shell=True, stdout=PIPE) return pid.communicate()[0].split() - + if __name__ == "__main__": if len(sys.argv) > 1: if sys.argv[1] in ['autoconf', 'detect']: diff --git a/plugins/libvirt/kvm_mem b/plugins/libvirt/kvm_mem index 55f8e1f1..7e8d2793 100755 --- a/plugins/libvirt/kvm_mem +++ b/plugins/libvirt/kvm_mem @@ -50,7 +50,7 @@ def clean_vm_name(vm_name): vm_name = re.sub(suffix,'',vm_name) return re.sub(r"[^a-zA-Z0-9_]", "_", vm_name) - + def fetch(vms): ''' Fetch values for a list of pids @param dictionnary {kvm_pid: cleaned vm name} @@ -61,12 +61,12 @@ def fetch(vms): cmdline = open("/proc/%s/cmdline" % pid, "r") amount = re.sub(r"^.*-m\x00(.*)\x00-smp.*$",r"\1", cmdline.readline()) amount = int(amount) * 1024 * 1024 - print "%s_mem.value %s" % (vms[pid], amount) + print "%s_mem.value %s" % (vms[pid], amount) except: cmdline = open("/proc/%s/cmdline" % pid, "r") amount = re.sub(r"^.*-m\x00(\d+).*$",r"\1", cmdline.readline()) amount = int(amount) * 1024 * 1024 - print "%s_mem.value %s" % (vms[pid], amount) + print "%s_mem.value %s" % (vms[pid], amount) def detect_kvm(): ''' Check if kvm is installed @@ -84,14 +84,14 @@ def find_vm_names(pids): cmdline = open("/proc/%s/cmdline" % pid, "r") result[pid] = clean_vm_name(re.sub(r"^.*-name\x00([a-zA-Z0-9.-_-]*)\x00\-.*$",r"\1", cmdline.readline())) return result - + def list_pids(): ''' Find the pid of kvm processes @return a list of pids from running kvm ''' pid = Popen("pidof qemu-kvm qemu-system-x86_64 kvm", shell=True, stdout=PIPE) return pid.communicate()[0].split() - + if __name__ == "__main__": if len(sys.argv) > 1: if sys.argv[1] in ['autoconf', 'detect']: diff --git a/plugins/libvirt/libvirt b/plugins/libvirt/libvirt index 2ca31b3e..b77365dc 100755 --- a/plugins/libvirt/libvirt +++ b/plugins/libvirt/libvirt @@ -87,7 +87,7 @@ $show{'network_drops'} = $ENV{show_network_drops} || 1; sub init() { my $type=undef; - + if ($ARGV[0] and $ARGV[0] eq "config"){ $type="config"; } @@ -142,7 +142,7 @@ sub init() { if(defined($hash{$name}{'info'}{'memory'})){ $hash{$name}{'info'}{'memory_bytes'} = 1024 * $hash{$name}{'info'}{'memory'}; } - + # Extract network usage if(defined($hash{$name}{'xml'}{'devices'}{'interface'}{'bridge'})){ my $vif_id=0; @@ -204,7 +204,7 @@ sub init() { print "graph_category virtualization\n"; print "graph_args -l 0 --base 1000 --upper-limit 100\n"; #print "graph_width 550\n"; - + for my $vm (sort keys %hash) { if(defined($hash{$vm}{'devices'}{'block'})){ print $hash{$vm}{'label'} . ".label " . $hash{$vm}{'name'} . "\n"; @@ -214,14 +214,14 @@ sub init() { } } print "\n"; - + } elsif($type eq "fetch"){ print "multigraph libvirt_disk_utilization\n"; for my $vm (sort keys %hash) { if(defined($hash{$vm}{'devices'}{'block'}) && defined($prev_state_ref->{$vm}->{'devices'}->{'block'})){ my $utilization=0; - + for my $device (keys %{$hash{$vm}{'devices'}{'block'}}){ if(defined($prev_state_ref->{$vm}->{'devices'}->{'block'}->{$device})){ @@ -274,7 +274,7 @@ sub init() { print "graph_category virtualization\n"; print "graph_args -l 0 --base 1000 --upper-limit 100\n"; #print "graph_width 550\n"; - + if($devices>0){ if(defined($hash{$vm}{'devices'}{'block'})){ for my $device (keys %{$hash{$vm}{'devices'}{'block'}}){ @@ -286,25 +286,25 @@ sub init() { } } print "\n"; - + } elsif($type eq "fetch"){ if($devices > 0){ print "multigraph libvirt_disk_utilization." . $hash{$vm}{'label'} . "\n"; if(defined($hash{$vm}{'devices'}{'block'}) && defined($prev_state_ref->{$vm}->{'devices'}->{'block'})){ - + for my $device (keys %{$hash{$vm}{'devices'}{'block'}}){ - + my $utilization=0; - + if(defined($prev_state_ref->{$vm}->{'devices'}->{'block'}->{$device})){ - + for my $source_device (keys %{$hash{$vm}{'devices'}{'block'}{$device}{'source'}}){ - + for my $slave_device (keys %{$hash{$vm}{'devices'}{'block'}{$device}{'source'}{$source_device}{'slaves'}}){ - + my $prev_ms_spent_doing_io=$prev_state_ref->{$vm}->{'devices'}->{'block'}->{$device}->{'source'}->{$source_device}->{'slaves'}->{$slave_device}->{'io_ticks'}; my $cur_ms_spent_doing_io=$hash{$vm}{'devices'}{'block'}{$device}{'source'}{$source_device}{'slaves'}{$slave_device}{'io_ticks'}; - + if($cur_ms_spent_doing_io > $prev_ms_spent_doing_io){ my $ticks=$cur_ms_spent_doing_io-$prev_ms_spent_doing_io; my $interval_ms=($time-$prev_time)*1000; @@ -343,7 +343,7 @@ sub init() { print "graph_vlabel read (-) / write (+)\n"; print "graph_category virtualization\n"; #print "graph_width 550\n"; - + for my $vm (sort keys %hash) { if(defined($hash{$vm}{'devices'}{'block'})){ @@ -358,7 +358,7 @@ sub init() { print $hash{$vm}{'label'} . "_rd.min 0\n"; print $hash{$vm}{'label'} . "_rd.draw LINE2\n"; print $hash{$vm}{'label'} . "_rd.graph no\n"; - + print $hash{$vm}{'label'} . "_wr.label " . $hash{$vm}{'name'} . "\n"; print $hash{$vm}{'label'} . "_wr.info I/O latency in seconds on " . $hash{$vm}{'name'} . "\n"; print $hash{$vm}{'label'} . "_wr.min 0\n"; @@ -368,7 +368,7 @@ sub init() { } } print "\n"; - + } elsif($type eq "fetch"){ print "multigraph libvirt_disk_latency\n"; for my $vm (sort keys %hash) { @@ -382,9 +382,9 @@ sub init() { my $cur_total_time_spent_reading=0; my $cur_total_ios_read=0; my $cur_total_ios_written=0; - + my $devices=0; - + for my $device (keys %{$hash{$vm}{'devices'}{'block'}}){ $devices++; @@ -456,16 +456,16 @@ sub init() { print "graph_vlabel read (-) / write (+)\n"; print "graph_category virtualization\n"; #print "graph_width 550\n"; - + if(defined($hash{$vm}{'devices'}{'block'})){ for my $device (keys %{$hash{$vm}{'devices'}{'block'}}){ - + print $hash{$vm}{'label'} . "_" . $device . "_rd.label " . $device . "_rd\n"; print $hash{$vm}{'label'} . "_" . $device . "_rd.info I/O latency in seconds on " . $hash{$vm}{'name'} . ":" . $device . "\n"; print $hash{$vm}{'label'} . "_" . $device . "_rd.min 0\n"; print $hash{$vm}{'label'} . "_" . $device . "_rd.draw LINE2\n"; print $hash{$vm}{'label'} . "_" . $device . "_rd.graph no\n"; - + print $hash{$vm}{'label'} . "_" . $device . "_wr.label " . $device . "\n"; print $hash{$vm}{'label'} . "_" . $device . "_wr.info I/O latency in seconds on " . $hash{$vm}{'name'} . ":" . $device . "\n"; print $hash{$vm}{'label'} . "_" . $device . "_wr.min 0\n"; @@ -479,11 +479,11 @@ sub init() { print "multigraph libvirt_disk_latency.$hash{$vm}{'label'}\n"; if(defined($hash{$vm}{'devices'}{'block'}) && defined($prev_state_ref->{$vm}->{'devices'}->{'block'})){ for my $device (keys %{$hash{$vm}{'devices'}{'block'}}){ - + if(defined($prev_state_ref->{$vm}->{'devices'}->{'block'}->{$device})){ - + for my $source_device (keys %{$hash{$vm}{'devices'}{'block'}{$device}{'source'}}){ - + my $prev_total_time_spent_writing=0; my $prev_total_time_spent_reading=0; my $prev_total_ios_read=0; @@ -492,7 +492,7 @@ sub init() { my $cur_total_time_spent_reading=0; my $cur_total_ios_read=0; my $cur_total_ios_written=0; - + for my $slave_device (keys %{$hash{$vm}{'devices'}{'block'}{$device}{'source'}{$source_device}{'slaves'}}){ my $prev_time_spent_writing=$prev_state_ref->{$vm}->{'devices'}->{'block'}->{$device}->{'source'}->{$source_device}->{'slaves'}->{$slave_device}->{'write_ticks'}; @@ -518,18 +518,18 @@ sub init() { my $read_latency=0; my $write_latency=0; - + if($prev_total_time_spent_reading > 0 && $prev_total_ios_read > 0 && ($cur_total_ios_read-$prev_total_ios_read) > 0){ $read_latency=(($cur_total_time_spent_reading-$prev_total_time_spent_reading)/($cur_total_ios_read-$prev_total_ios_read))/1000; } - + if($prev_total_time_spent_writing > 0 && $prev_total_ios_written > 0 && ($cur_total_ios_written-$prev_total_ios_written) > 0){ $write_latency=(($cur_total_time_spent_writing-$prev_total_time_spent_writing)/($cur_total_ios_written-$prev_total_ios_written))/1000; } - + print $hash{$vm}{'label'} . "_" . $device . "_rd.value " . $read_latency . "\n"; print $hash{$vm}{'label'} . "_" . $device . "_wr.value " . $write_latency . "\n"; - + } } } @@ -554,7 +554,7 @@ sub init() { print "graph_vlabel bytes read (-) / written (+) per \${graph_period}\n"; print "graph_category virtualization\n"; #print "graph_width 550\n"; - + for my $vm (sort keys %hash) { my $devices=0; if(defined($hash{$vm}{'devices'}{'block'})){ @@ -565,14 +565,14 @@ sub init() { if($devices > 0){ if(defined($hash{$vm}{'devices'}{'block'})){ - + print $hash{$vm}{'label'} . "_rd_bytes.label " . $hash{$vm}{'name'} . "\n"; print $hash{$vm}{'label'} . "_rd_bytes.type COUNTER\n"; print $hash{$vm}{'label'} . "_rd_bytes.info The number of bytes read by " . $hash{$vm}{'name'} . "\n"; print $hash{$vm}{'label'} . "_rd_bytes.min 0\n"; print $hash{$vm}{'label'} . "_rd_bytes.draw LINE2\n"; print $hash{$vm}{'label'} . "_rd_bytes.graph no\n"; - + print $hash{$vm}{'label'} . "_wr_bytes.label " . $hash{$vm}{'name'} . "\n"; print $hash{$vm}{'label'} . "_wr_bytes.type COUNTER\n"; print $hash{$vm}{'label'} . "_wr_bytes.info The number of bytes written by " . $hash{$vm}{'name'} . "\n"; @@ -583,7 +583,7 @@ sub init() { } } print "\n"; - + } elsif($type eq "fetch"){ print "multigraph libvirt_disk\n"; for my $vm (sort keys %hash) { @@ -604,7 +604,7 @@ sub init() { # # Disk used, second level # - + for my $vm (sort keys %hash) { my $devices=0; if(defined($hash{$vm}{'devices'}{'block'})){ @@ -623,14 +623,14 @@ sub init() { print "graph_vlabel bytes read (-) / written (+) per \${graph_period}\n"; print "graph_category virtualization\n"; #print "graph_width 550\n"; - + for my $device (keys %{$hash{$vm}{'devices'}{'block'}}){ print $device . "_rd_bytes.label " . $device . "_rd\n"; print $device . "_rd_bytes.type COUNTER\n"; print $device . "_rd_bytes.info The number of bytes read by " . $hash{$vm}{'name'} . "\n"; print $device . "_rd_bytes.min 0\n"; print $device . "_rd_bytes.graph no\n"; - + print $device . "_wr_bytes.label " . $device . "\n"; print $device . "_wr_bytes.type COUNTER\n"; print $device . "_wr_bytes.info The number of bytes written by " . $hash{$vm}{'name'} . "\n"; @@ -639,7 +639,7 @@ sub init() { print $device . "_wr_bytes.negative " . $device . "_rd_bytes\n"; } print "\n"; - + } elsif($type eq "fetch"){ print "multigraph libvirt_disk.bytes_" . $hash{$vm}{'label'} . "\n"; if(defined($hash{$vm}{'devices'}{'block'})){ @@ -672,7 +672,7 @@ sub init() { print "graph_title Disk errors per domain\n"; print "graph_args --base 1000\n"; print "graph_category virtualization\n"; - + for my $vm (sort keys %hash) { if(defined($hash{$vm}{'devices'}{'block'})){ my $devices=0; @@ -691,7 +691,7 @@ sub init() { } } print "\n"; - + } elsif($type eq "fetch"){ print "multigraph libvirt_disk_errs\n"; for my $vm (sort keys %hash) { @@ -709,7 +709,7 @@ sub init() { # # Disk errors, second level # - + for my $vm (sort keys %hash) { my $devices=0; if(defined($hash{$vm}{'devices'}{'block'})){ @@ -724,9 +724,9 @@ sub init() { print "graph_title Disk errors for " . $hash{$vm}{'name'} . "\n"; print "graph_args --base 1000\n"; print "graph_category virtualization\n"; - + for my $device (keys %{$hash{$vm}{'devices'}{'block'}}){ - + print $device . "_errs.label " . $device . "\n"; print $device . "_errs.type COUNTER\n"; print $device . "_errs.info The number of errors by " . $hash{$vm}{'name'} . " on defice " . $device . "\n"; @@ -734,7 +734,7 @@ sub init() { print $device . "_errs.draw LINE2\n"; } print "\n"; - + } elsif($type eq "fetch"){ print "multigraph libvirt_disk_errs." . $hash{$vm}{'label'} . "\n"; if(defined($hash{$vm}{'devices'}{'block'})){ @@ -766,10 +766,10 @@ sub init() { print "graph_vlabel Bytes in (-) / out (+) per \${graph_period}\n"; print "graph_category virtualization\n"; #print "graph_width 550\n"; - + for my $vm (sort keys %hash) { if(defined($hash{$vm}{'devices'}{'network'})){ - + print $hash{$vm}{'label'} . "_rx_bytes.label " . $hash{$vm}{'name'} . "_rx\n"; print $hash{$vm}{'label'} . "_rx_bytes.type DERIVE\n"; print $hash{$vm}{'label'} . "_rx_bytes.info The number of bytes read by " . $hash{$vm}{'name'} . " in total.\n"; @@ -777,7 +777,7 @@ sub init() { print $hash{$vm}{'label'} . "_rx_bytes.draw LINE2\n"; print $hash{$vm}{'label'} . "_rx_bytes.graph no\n"; #print $hash{$vm}{'label'} . "_rx_bytes.cdef " . $hash{$vm}{'label'} . "_rx_bytes,8,*\n"; - + print $hash{$vm}{'label'} . "_tx_bytes.label " . $hash{$vm}{'name'} . "\n"; print $hash{$vm}{'label'} . "_tx_bytes.type DERIVE\n"; print $hash{$vm}{'label'} . "_tx_bytes.info The number of bytes written by " . $hash{$vm}{'name'} . " in total.\n"; @@ -788,7 +788,7 @@ sub init() { } } print "\n"; - + } elsif($type eq "fetch"){ print "multigraph libvirt_network\n"; for my $vm (sort keys %hash) { @@ -819,10 +819,10 @@ sub init() { print "graph_vlabel Bits in (-) / out (+) per \${graph_period}\n"; print "graph_category virtualization\n"; #print "graph_width 550\n"; - + for my $vif (keys %{$hash{$vm}{'devices'}{'network'}}){ my $vif_id=$hash{$vm}{'devices'}{'network'}{$vif}{'vif_id'}; - + print "rx_bytes_" . $vif_id . ".label " . $vif . "_rx\n"; print "rx_bytes_" . $vif_id . ".type DERIVE\n"; print "rx_bytes_" . $vif_id . ".info The number of bytes read by " . $hash{$vm}{'name'} . "\n"; @@ -872,17 +872,17 @@ sub init() { print "graph_vlabel Count in (-) / out (+) per \${graph_period}\n"; print "graph_category virtualization\n"; #print "graph_width 550\n"; - + for my $vm (sort keys %hash) { if(defined($hash{$vm}{'devices'}{'network'})){ - + print $hash{$vm}{'label'} . "_rx_drop.label " . $hash{$vm}{'name'} . "_rx\n"; print $hash{$vm}{'label'} . "_rx_drop.type DERIVE\n"; print $hash{$vm}{'label'} . "_rx_drop.info The number of packets dropped at reception by " . $hash{$vm}{'name'} . "\n"; print $hash{$vm}{'label'} . "_rx_drop.min 0\n"; print $hash{$vm}{'label'} . "_rx_drop.draw LINE2\n"; print $hash{$vm}{'label'} . "_rx_drop.graph no\n"; - + print $hash{$vm}{'label'} . "_tx_drop.label " . $hash{$vm}{'name'} . "\n"; print $hash{$vm}{'label'} . "_tx_drop.type DERIVE\n"; print $hash{$vm}{'label'} . "_tx_drop.info The number of packets dropped at transmission by " . $hash{$vm}{'name'} . "\n"; @@ -892,7 +892,7 @@ sub init() { } } print "\n"; - + } elsif($type eq "fetch"){ print "multigraph libvirt_network_drop\n"; for my $vm (sort keys %hash) { @@ -925,10 +925,10 @@ sub init() { print "graph_vlabel Count in (-) / out (+) per \${graph_period}\n"; print "graph_category virtualization\n"; #print "graph_width 550\n"; - + for my $vif (keys %{$hash{$vm}{'devices'}{'network'}}){ my $vif_id=$hash{$vm}{'devices'}{'network'}{$vif}{'vif_id'}; - + print "rx_drop_" . $vif_id . ".label " . $vif . "_rx\n"; print "rx_drop_" . $vif_id . ".type DERIVE\n"; print "rx_drop_" . $vif_id . ".info The number of packets dropped by " . $hash{$vm}{'name'} . ", nic " . $vif_id . "\n"; @@ -960,7 +960,7 @@ sub init() { # # CPU used # - + if($show{'cpu_used'} == 1){ # @@ -973,7 +973,7 @@ sub init() { print "graph_args --base 1000 -r --lower-limit 0 --upper-limit 100\n"; print "graph_category virtualization\n"; #print "graph_width 550\n"; - + my $draw="AREA"; for my $vm (sort keys %hash) { print $hash{$vm}{'label'} . "_time.label " . $hash{$vm}{'name'} . "\n"; @@ -984,7 +984,7 @@ sub init() { $draw="STACK" if $draw eq "AREA"; } print "\n"; - + } elsif($type eq "fetch"){ print "multigraph libvirt_cpu\n"; for my $vm (sort keys %hash) { @@ -996,7 +996,7 @@ sub init() { # # CPU used, second level (pr virtual machine) # - + if($type eq "config"){ for my $vm (sort keys %hash) { print "multigraph libvirt_cpu.vm_" . $hash{$vm}{'label'} . "\n"; @@ -1004,7 +1004,7 @@ sub init() { print "graph_args --base 1000\n"; print "graph_category virtualization\n"; #print "graph_width 550\n"; - + print "time.label " . $hash{$vm}{'name'} . " (" . $hash{$vm}{'type'} . ")\n"; print "time.type DERIVE\n"; print "time.info The cpu time used by " . $hash{$vm}{'name'} . " in percent of the total available cpu time on the physical node. This domain has access to " . $hash{$vm}{'info'}{'nrVirtCpu'} . " VCPU(s) now, and $hash{$vm}{'maxvcpus'} at maximum. The scheduler for this domain is " . $hash{$vm}{'scheduler'} . ".\n"; @@ -1012,7 +1012,7 @@ sub init() { print "time.draw AREA\n"; print "\n"; } - + } elsif($type eq "fetch"){ for my $vm (sort keys %hash) { print "multigraph libvirt_cpu.vm_" . $hash{$vm}{'label'} . "\n"; @@ -1038,7 +1038,7 @@ sub init() { print "graph_args --base 1000\n"; print "graph_category virtualization\n"; #print "graph_width 550\n"; - + my $draw="AREA"; for my $vm (sort keys %hash) { print $hash{$vm}{'label'} . "_alloc.label " . $hash{$vm}{'name'} . "\n"; @@ -1049,7 +1049,7 @@ sub init() { $draw="STACK" if $draw eq "AREA"; } print "\n"; - + } elsif($type eq "fetch"){ print "multigraph libvirt_mem\n"; for my $vm (sort keys %hash) { @@ -1061,7 +1061,7 @@ sub init() { # # Memory allocated, second level (pr virtual machine) # - + if($type eq "config"){ for my $vm (sort keys %hash) { print "multigraph libvirt_mem.vm_" . $hash{$vm}{'label'} . "\n"; @@ -1069,7 +1069,7 @@ sub init() { print "graph_args --base 1000\n"; print "graph_category virtualization\n"; #print "graph_width 550\n"; - + print "mem.label " . $hash{$vm}{'name'} . " (" . $hash{$vm}{'type'} . ")\n"; print "mem.type GAUGE\n"; print "mem.info Amount of memory allocated to " . $hash{$vm}{'name'} . ". The maximum amount of memory for this domain is " . $hash{$vm}{'maxmem'}/1024 . " MB.\n"; @@ -1077,7 +1077,7 @@ sub init() { print "mem.draw AREA\n"; print "\n"; } - + } elsif($type eq "fetch"){ for my $vm (sort keys %hash) { print "multigraph libvirt_mem.vm_" . $hash{$vm}{'label'} . "\n"; @@ -1156,7 +1156,7 @@ sub parse_xml { my $teller = 0; my $fortsette = 1; - + while($fortsette){ if( $a[$i]{'devices'}[0]{'disk'}[$teller] ){ my $type=$a[$i]{'devices'}[0]{'disk'}[$teller]{'type'}; @@ -1173,7 +1173,7 @@ sub parse_xml { else{ $fortsette = 0; } - } + } } # Hack to extract network information and put it into the hash @@ -1182,7 +1182,7 @@ sub parse_xml { my $teller = 0; my $fortsette = 1; - + while($fortsette){ if( $a[$i]{'devices'}[0]{'interface'}[$teller] ){ my $type=$a[$i]{'devices'}[0]{'interface'}[$teller]{'type'}; @@ -1198,7 +1198,7 @@ sub parse_xml { else{ $fortsette = 0; } - } + } } } @@ -1213,8 +1213,8 @@ sub read_diskstats{ # Verify that $dev is a block device. if(-b $dev){ # Read minor and major number - my $rdev = stat($dev)->rdev; - $res{'major'} = $rdev >> 8; + my $rdev = stat($dev)->rdev; + $res{'major'} = $rdev >> 8; $res{'minor'} = $rdev & 0xff; # If major numer is 253, then proceed as dm-device @@ -1238,7 +1238,7 @@ sub read_diskstats{ while (my $line = ) { # 1 2 3 4 5 6 7 8 9 10 11 if($line =~ m/(\d+)\s+(\d+)\s+(\d+)\s+(\d+)\s+(\d+)\s+(\d+)\s+(\d+)\s+(\d+)\s+(\d+)\s+(\d+)\s+(\d+)/){ - + # Name units description # ---- ----- ----------- # read I/Os requests number of read I/Os processed diff --git a/plugins/libvirt/munin-libvirtpy b/plugins/libvirt/munin-libvirtpy index 1620bbd3..b37e7a19 100755 --- a/plugins/libvirt/munin-libvirtpy +++ b/plugins/libvirt/munin-libvirtpy @@ -1,6 +1,6 @@ #!/usr/bin/python -# Revision 1.0 2008/05/16 - Steven Wagner +# Revision 1.0 2008/05/16 - Steven Wagner # First functional release. Works for me. # # Revision 0.5 2008/05/01 - Julien Rottenberg @@ -45,7 +45,7 @@ if len(sys.argv) == 2: print "%s.type COUNTER" %(nodeName) print "%s.label %s" %(nodeName, nodeName) sys.exit(1) - + for id in ids: dom = conn.lookupByID(id) state, maxMem, memory, numVirtCpu, cpuTime = dom.info() @@ -55,5 +55,3 @@ for id in ids: # print """Domain: %s, %s state (%s), %d CPUs, %d seconds, %d milliseconds, mem/max (%d/%d) """ \ # % (nodeName, ostype, state, numVirtCpu, cpuTime/float(1000000000), cpuTime/float(1000000), memory, maxMem ) print "%s.value %d" % (nodeName, cpuTime/float(1000000)) - - diff --git a/plugins/licensing/flexlm_ b/plugins/licensing/flexlm_ index 1ad006f4..ff7c3145 100755 --- a/plugins/licensing/flexlm_ +++ b/plugins/licensing/flexlm_ @@ -42,11 +42,11 @@ # - LMSTAT: The path to the lmstat binary # - LMLICFILE: The path to the FlexLM License File # - LMLOGARITHMIC If set then graph use a logarithmic scale -# +# # $Log$ # Revision 1.00 20090807 nassarmu # Initial public release. -# +# # Revision 1.10 20120625 nassarmu@msi.umn.edu # incorporate the rewrite by TSUCHIYA Masatoshi # diff --git a/plugins/load/load_extended b/plugins/load/load_extended index 3e7973ce..f0f7314b 100755 --- a/plugins/load/load_extended +++ b/plugins/load/load_extended @@ -1,5 +1,5 @@ #!/bin/sh -# +# # Plugin to monitor the load average on a system. # # Usage: Link or copy into /etc/munin/node.d/ @@ -50,8 +50,8 @@ if [ "$1" = "autoconf" ]; then fi # If run with the "config"-parameter, give out information on how the -# graphs should look. - +# graphs should look. + if [ "$1" = "config" ]; then # The host name this plugin is for. (Can be overridden to have # one machine answer for several) @@ -69,7 +69,7 @@ if [ "$1" = "config" ]; then # Graph category. Defaults to 'other' echo 'graph_category system' # The fields. "label" is used in the legend. "label" is the only - # required subfield. + # required subfield. echo 'load1.label load 1 min avg' echo 'load1.draw AREA' echo 'load5.label load 5 min avg' diff --git a/plugins/logins/logins b/plugins/logins/logins index db7278b4..bde4b43d 100755 --- a/plugins/logins/logins +++ b/plugins/logins/logins @@ -17,10 +17,10 @@ EOF # can go into an include file labels=$((${#graph[*]}/(graph+1))) -for ((i=0; i/tasks count_processes () { [ -z "$1" ] && return 0 - + if [ -n "$cgrouppath" ]; then SYSFS=$cgrouppath/$1/tasks if [ -e $SYSFS ]; then return `wc -l < $SYSFS` fi fi - + for SYSFS in \ /sys/fs/cgroup/$1/tasks \ /sys/fs/cgroup/lxc/$1/tasks \ @@ -63,7 +63,7 @@ count_processes () { return `wc -l < $SYSFS` fi done - + return 0 } @@ -75,7 +75,7 @@ for guest in $guest_names; do fi done guest_names="$active" - + f_comm='lxc-cgroup ' @@ -97,9 +97,8 @@ if [ "$1" = "config" ]; then echo 'graph_vlabel Number of processes' echo 'graph_category processes' - - for guest_name in $guest_names; - do + + for guest_name in $guest_names; do guest="$(clean_fieldname $guest_name)" echo 'lxc_proc_'$guest'.label '$guest_name': processes' echo 'lxc_proc_'$guest'.type GAUGE' @@ -108,17 +107,16 @@ if [ "$1" = "config" ]; then exit 0 fi - for guest_name in $guest_names; - do + for guest_name in $guest_names; do guest="$(clean_fieldname $guest_name)" - + count_processes $guest_name tmp_g=$? if [ $tmp_g -eq 0 ]; then tmp_g=`$f_comm -n $guest_name tasks | wc -l` fi echo 'lxc_proc_'$guest'.value '$tmp_g - + done diff --git a/plugins/lxd/lxd_mem b/plugins/lxd/lxd_mem index f81a767d..23fb40f9 100755 --- a/plugins/lxd/lxd_mem +++ b/plugins/lxd/lxd_mem @@ -10,7 +10,7 @@ try: except: HAS_LIB=False errors.append("no pylxd module") - + c=None HAS_ACCESS=True try: diff --git a/plugins/mail/mail_connections b/plugins/mail/mail_connections index ade4f790..5c71ac87 100755 --- a/plugins/mail/mail_connections +++ b/plugins/mail/mail_connections @@ -29,7 +29,7 @@ fi if [ "$1" = "config" ]; then cat <{offset} ||= 0; diff --git a/plugins/mailman/mailman-queue-check b/plugins/mailman/mailman-queue-check index 3a9deab3..86a49773 100755 --- a/plugins/mailman/mailman-queue-check +++ b/plugins/mailman/mailman-queue-check @@ -56,5 +56,5 @@ echo "news.value ${array[4]}" echo "out.value ${array[5]}" echo "retry.value ${array[6]}" exit 0 - + diff --git a/plugins/mailman/mailman_subscribers b/plugins/mailman/mailman_subscribers index a5809d4f..3000d4e2 100755 --- a/plugins/mailman/mailman_subscribers +++ b/plugins/mailman/mailman_subscribers @@ -61,7 +61,7 @@ if ($ARGV[0] and $ARGV[0] eq "config" ){ print "graph_category mailinglist\n"; print "graph_total Total\n"; print 'graph_info Plugin available at http://rodolphe.quiedeville.org/hack/munin/mailman/'."\n"; - + my $num =0; while (($list,$desc) = each(%lists)) { $label=$list; diff --git a/plugins/memcached/memcached_bytes_all b/plugins/memcached/memcached_bytes_all index 7b7bbe95..bfe5c4d5 100755 --- a/plugins/memcached/memcached_bytes_all +++ b/plugins/memcached/memcached_bytes_all @@ -1,7 +1,7 @@ #!/usr/bin/env perl # ex:ts=4 # Copyright © Nicolas BOUTHORS / Smile -# +# # Licence GPLv2 # # Based on a script distributed on munin-exchange. @@ -11,10 +11,10 @@ use warnings; use Cache::Memcached; -my %instances = (); +my %instances = (); # Will look into /etc for memcached config files and extract TCP listening port -# from the config file. +# from the config file. sub fetch_instances() { my @files = glob("/etc/memcached_*.conf"); undef $/; diff --git a/plugins/memcached/memcached_ext_bytes_ b/plugins/memcached/memcached_ext_bytes_ index 8dda1871..7b1606f8 100755 --- a/plugins/memcached/memcached_ext_bytes_ +++ b/plugins/memcached/memcached_ext_bytes_ @@ -23,7 +23,7 @@ env.label "second local server" my $label = exists $ENV{'label'} ? $ENV{'label'} : ''; unless( $label ){ - + if( $0 =~ /memcached_ext_bytes_([\d\w]+)$/ ){ $label = $1; } diff --git a/plugins/memcached/memcached_ext_connections_ b/plugins/memcached/memcached_ext_connections_ index 326c3afc..f4b0d497 100755 --- a/plugins/memcached/memcached_ext_connections_ +++ b/plugins/memcached/memcached_ext_connections_ @@ -23,7 +23,7 @@ env.label "second local server" my $label = exists $ENV{'label'} ? $ENV{'label'} : ''; unless( $label ){ - + if( $0 =~ /memcached_ext_connections_([\w\d]+)$/ ){ $label = $1; } diff --git a/plugins/memcached/memcached_ext_hits_ b/plugins/memcached/memcached_ext_hits_ index 2aca77a5..8e23ef98 100755 --- a/plugins/memcached/memcached_ext_hits_ +++ b/plugins/memcached/memcached_ext_hits_ @@ -23,7 +23,7 @@ env.label "second local server" my $label = exists $ENV{'label'} ? $ENV{'label'} : ''; unless( $label ){ - + if( $0 =~ /memcached_ext_hits_([\w\d]+)$/ ){ $label = $1; } diff --git a/plugins/memcached/memcached_ext_items_ b/plugins/memcached/memcached_ext_items_ index 19e359f4..53904e53 100755 --- a/plugins/memcached/memcached_ext_items_ +++ b/plugins/memcached/memcached_ext_items_ @@ -23,7 +23,7 @@ env.label "second local server" my $label = exists $ENV{'label'} ? $ENV{'label'} : ''; unless( $label ){ - + if( $0 =~ /memcached_ext_items_([\w\d]+)$/ ){ $label = $1; } diff --git a/plugins/memcached/memcached_ext_requests_ b/plugins/memcached/memcached_ext_requests_ index 9c1d9017..0172a2c2 100755 --- a/plugins/memcached/memcached_ext_requests_ +++ b/plugins/memcached/memcached_ext_requests_ @@ -23,7 +23,7 @@ env.label "second local server" my $label = exists $ENV{'label'} ? $ENV{'label'} : ''; unless( $label ){ - + if( $0 =~ /memcached_ext_requests_([\w\d]+)$/ ){ $label = $1; } diff --git a/plugins/memcached/memcached_ext_traffic_ b/plugins/memcached/memcached_ext_traffic_ index a9354ca0..f77e1d98 100755 --- a/plugins/memcached/memcached_ext_traffic_ +++ b/plugins/memcached/memcached_ext_traffic_ @@ -23,7 +23,7 @@ env.label "second local server" my $label = exists $ENV{'label'} ? $ENV{'label'} : ''; unless( $label ){ - + if( $0 =~ /memcached_ext_traffic_([\w\d]+)$/ ){ $label = $1; } diff --git a/plugins/memcached/memcached_multi_ b/plugins/memcached/memcached_multi_ index f38affa0..5683b399 100755 --- a/plugins/memcached/memcached_multi_ +++ b/plugins/memcached/memcached_multi_ @@ -145,7 +145,7 @@ my %stats; my %items; # This gives us the memory size and usage per slab -# We track this so we can see what slab is being used the most and has no free chunks +# We track this so we can see what slab is being used the most and has no free chunks # so we can re-tune memcached to allocate more pages for the specified chunk size my %chnks; @@ -396,7 +396,7 @@ $graphs{slabitems} = { info => 'This graph shows you the number of items and reclaimed items per slab.', }, datasrc => [ - { name => 'number', label => 'Items', draw => 'AREA', + { name => 'number', label => 'Items', draw => 'AREA', info => 'This is the amount of items stored in this slab', min => '0' }, ], }; @@ -437,8 +437,8 @@ $graphs{slabunfetched} = { =head2 Config Check This block of code looks at the argument that is possibly supplied, - should it be config, it then checks to make sure the plugin - specified exists, assuming it does, it will run the do_config + should it be config, it then checks to make sure the plugin + specified exists, assuming it does, it will run the do_config subroutine for the plugin specified, otherwise it dies complaining about an unknown plugin. @@ -584,7 +584,7 @@ sub fetch_output { This subroutine prints out the return values for our non-multigraph root graphs. It takes one parameter $plugin and returns when completed. - $plugin; graph we are calling up to print data values for + $plugin; graph we are calling up to print data values for Example: print_root_output($plugin); @@ -939,7 +939,7 @@ sub print_submulti_config { # Lets set our graph reference, and main graph config for easy handling my $graph = $graphs{$sgraph}; my %graphconf = %{$graph->{config}}; - # Lets tell munin which graph we are graphing, and what our main graph config info is + # Lets tell munin which graph we are graphing, and what our main graph config info is print "multigraph memcached_multi_$plugin.$sgraph\_$slabid\n"; while ( my ($key, $value) = each(%graphconf)) { if ($key eq 'title') { diff --git a/plugins/memcached/memcached_servers_ b/plugins/memcached/memcached_servers_ index bf5dfcd2..fb80ee91 100755 --- a/plugins/memcached/memcached_servers_ +++ b/plugins/memcached/memcached_servers_ @@ -48,7 +48,7 @@ Link the plugin to get the desirec output, for example: memcached_multi_bytes =head1 ACKNOWLEDGEMENTS -This plugin is based on the available memcached plugins at +This plugin is based on the available memcached plugins at L =head1 AUTHORS diff --git a/plugins/memory/kmemsum b/plugins/memory/kmemsum index 74fe7106..6101d1c0 100755 --- a/plugins/memory/kmemsum +++ b/plugins/memory/kmemsum @@ -1,7 +1,7 @@ #!/bin/sh # Kernel Memory usage stats. -# Author: alex@trull.org -# +# Author: alex@trull.org +# # Based on the short script at http://wiki.freebsd.org/ZFSTuningGuide (20080820) # # Parameters: @@ -45,7 +45,7 @@ if [ "$1" = "config" ]; then echo 'text.info kmem text' echo 'text.draw AREA' echo 'data.label data' - echo 'data.info kmem data' + echo 'data.info kmem data' echo 'data.draw STACK' echo 'total.label total' echo 'total.info kmem total' @@ -61,4 +61,4 @@ echo "data.value $DATA" echo "total.value $TOTAL" echo "max.value $MAX" - + diff --git a/plugins/memory/proc_memory_status b/plugins/memory/proc_memory_status index 3ad2752c..e5e1aa65 100755 --- a/plugins/memory/proc_memory_status +++ b/plugins/memory/proc_memory_status @@ -33,28 +33,28 @@ if [ "$1" = "config" ]; then echo 'VmExe.label VmExe' echo 'VmExe.draw AREA' - echo "VmExe.info The size of the executable segment" - + echo "VmExe.info The size of the executable segment" + echo 'VmLib.label VmLib' echo 'VmLib.draw STACK' echo 'VmLib.info The size of the library code' - + echo 'VmStk.label VmStk' echo 'VmStk.draw STACK' echo 'VmStk.info The stack size' - + echo 'VmLck.label VmLck' echo 'VmLck.draw STACK' echo 'VmLck.info The amount of locked memory' - + echo 'VmData.label VmData' echo 'VmData.draw STACK' echo 'VmData.info The size of the Data segment' - + echo 'VmRSS.label VmRSS' echo 'VmRSS.draw LINE2' echo 'VmRSS.info The amount of memory mapped in RAM ( instead of swapped out)' - + echo 'VmSize.label VmSize' echo 'VmSize.draw LINE2' echo 'VmSize.info The size of the virtual memory allocated to the process' diff --git a/plugins/minecraft/bukkit-jsonapi-players b/plugins/minecraft/bukkit-jsonapi-players index adf8710d..c414f0a8 100755 --- a/plugins/minecraft/bukkit-jsonapi-players +++ b/plugins/minecraft/bukkit-jsonapi-players @@ -12,7 +12,7 @@ * * Author: Jonas Friedmann (http://frd.mn) * GitHub: https://github.com/yeahwhat-mc/munin-bukkit-plugins - * + * */ /** diff --git a/plugins/minecraft/bukkit-jsonapi-ramusage b/plugins/minecraft/bukkit-jsonapi-ramusage index 4de54e93..c4003234 100755 --- a/plugins/minecraft/bukkit-jsonapi-ramusage +++ b/plugins/minecraft/bukkit-jsonapi-ramusage @@ -12,7 +12,7 @@ * * Author: Jonas Friedmann (http://frd.mn) * GitHub: https://github.com/yeahwhat-mc/munin-bukkit-plugins - * + * */ /** diff --git a/plugins/minecraft/bukkit-jsonapi-tps b/plugins/minecraft/bukkit-jsonapi-tps index 597861ff..33fb0e8c 100755 --- a/plugins/minecraft/bukkit-jsonapi-tps +++ b/plugins/minecraft/bukkit-jsonapi-tps @@ -12,7 +12,7 @@ * * Author: Jonas Friedmann (http://frd.mn) * GitHub: https://github.com/yeahwhat-mc/munin-bukkit-plugins - * + * */ /** diff --git a/plugins/minecraft/bukkit-statistician-killshostile b/plugins/minecraft/bukkit-statistician-killshostile index 0e4640e1..6478c841 100755 --- a/plugins/minecraft/bukkit-statistician-killshostile +++ b/plugins/minecraft/bukkit-statistician-killshostile @@ -13,7 +13,7 @@ * * Author: Jonas Friedmann (http://frd.mn) * GitHub: https://github.com/yeahwhat-mc/munin-bukkit-plugins - * + * */ /** diff --git a/plugins/minecraft/bukkit-statistician-killsneutral b/plugins/minecraft/bukkit-statistician-killsneutral index cfa85f56..e0dae2cc 100755 --- a/plugins/minecraft/bukkit-statistician-killsneutral +++ b/plugins/minecraft/bukkit-statistician-killsneutral @@ -13,7 +13,7 @@ * * Author: Jonas Friedmann (http://frd.mn) * GitHub: https://github.com/yeahwhat-mc/munin-bukkit-plugins - * + * */ /** diff --git a/plugins/minecraft/bukkit-statistician-killspassive b/plugins/minecraft/bukkit-statistician-killspassive index 8344ab15..66801109 100755 --- a/plugins/minecraft/bukkit-statistician-killspassive +++ b/plugins/minecraft/bukkit-statistician-killspassive @@ -13,7 +13,7 @@ * * Author: Jonas Friedmann (http://frd.mn) * GitHub: https://github.com/yeahwhat-mc/munin-bukkit-plugins - * + * */ /** diff --git a/plugins/minecraft/minecraft-users-ram_ b/plugins/minecraft/minecraft-users-ram_ index 5e97c060..0520935d 100755 --- a/plugins/minecraft/minecraft-users-ram_ +++ b/plugins/minecraft/minecraft-users-ram_ @@ -34,7 +34,7 @@ Some more instructions: http://wiki.natenom.name/minecraft/munin-plugin MC_PORT=${0##*_} - + if [ "$1" = "config" ] then echo "graph_title Minecraft-Server (Port $MC_PORT)" diff --git a/plugins/moblock/moblock_connections b/plugins/moblock/moblock_connections index 6f163e9c..3b34f14b 100755 --- a/plugins/moblock/moblock_connections +++ b/plugins/moblock/moblock_connections @@ -14,10 +14,10 @@ # Configurable variables # # logfile - Override default moblock logfile -# +# # Magic markers # -#%# family=auto +#%# family=auto #%# capabilities=autoconf # @@ -63,7 +63,7 @@ def fetch(debug=false) puts "blocked_out.value #{num_out}" puts "blocked_total.value #{num_total}" end - + # # If moblock executable on path then allow autoconfiguration # diff --git a/plugins/mod_jk/mod_jk b/plugins/mod_jk/mod_jk index f4358c0a..dfe1dd0e 100755 --- a/plugins/mod_jk/mod_jk +++ b/plugins/mod_jk/mod_jk @@ -81,7 +81,7 @@ for i in `echo $data | sed 's/worker/\nworker/g' | grep "^worker\..*\.state=.*"` do node=`echo $i | awk -F . '{print $2}'` status=`echo $i | awk -F = '{print $2}'` - + value=0 if [ `echo $status | sed 's/^OK/XOK/'` = "X$status" ] then @@ -97,7 +97,7 @@ do then value=3 fi - + echo "$node.value $value" done diff --git a/plugins/mogilefs/mogilefsd_activity b/plugins/mogilefs/mogilefsd_activity index a53edce6..11333d16 100755 --- a/plugins/mogilefs/mogilefsd_activity +++ b/plugins/mogilefs/mogilefsd_activity @@ -24,7 +24,7 @@ # Usage: # ln -s /usr/share/munin/plugins/mogilefsd_activity \ # /etc/munin/plugins/ -# +# # Configuration variables: # # host (default: '127.0.0.1') @@ -135,10 +135,10 @@ if($ARGV[0] and $ARGV[0] eq "config") { print "pending_queries.draw STACK\n"; exit 0; -} - +} + print %states; - + &query_mogilefsd($mogilefsd_host, $mogilefsd_port); foreach $key (@known_states) { diff --git a/plugins/mogilefs/mogilefsd_queries b/plugins/mogilefs/mogilefsd_queries index ac433ac0..5d788f1e 100755 --- a/plugins/mogilefs/mogilefsd_queries +++ b/plugins/mogilefs/mogilefsd_queries @@ -24,7 +24,7 @@ # Usage: # ln -s /usr/share/munin/plugins/mogilefsd_activity \ # /etc/munin/plugins/ -# +# # Configuration variables: # # host (default: '127.0.0.1') @@ -133,10 +133,10 @@ if($ARGV[0] and $ARGV[0] eq "config") { print "queries.min 0\n"; exit 0; -} - +} + print %states; - + &query_mogilefsd($mogilefsd_host, $mogilefsd_port); foreach $key (@known_states) { diff --git a/plugins/moinmoin/moinoin_pages b/plugins/moinmoin/moinoin_pages index e56cc2d5..2a2ec92d 100755 --- a/plugins/moinmoin/moinoin_pages +++ b/plugins/moinmoin/moinoin_pages @@ -15,7 +15,7 @@ # # Implementation notes # -------------------- -# +# # it is quite koumbit-specific: # 1. the wikifarm config is hardcoded # 2. it relies on the "wikilist.py" file to contain the list of wiki -> url patterns @@ -81,18 +81,18 @@ def main(): url = sub('\(([^\|]*)(\|[^\)]*\))+', '\\1', url) # remove common regexp patterns and slap a protocol to make this a real url url = sub('[\^\$]|(\.\*)', '', url) - + mod = getattr(__import__(name), 'Config') #print "Upgradeing wiki %s (%s)" % (getattr(mod, 'sitename'), url) - + request = RequestCLI(url) pagelist = request.rootpage.getPageList(user='') - + systemPages = [page for page in pagelist if wikiutil.isSystemPage(request, page)] print(name + '.value ' + str(len(pagelist)-len(systemPages))) #totalsize = reduce(operator.add, [Page(request, name).size() for name in pagelist]) - #print('Accumulated page sizes' + _formatInReadableUnits(totalsize)) + #print('Accumulated page sizes' + _formatInReadableUnits(totalsize)) def config(): print("""graph_title Wiki size diff --git a/plugins/mongodb/mongo_lag b/plugins/mongodb/mongo_lag index 80fdfbd2..3e6de845 100755 --- a/plugins/mongodb/mongo_lag +++ b/plugins/mongodb/mongo_lag @@ -13,10 +13,10 @@ :author: Stefan Andersen :license: The Beer Ware License (Revision 42) - wrote this file. As long - as you retain this notice you can do whatever you want - with this stuff. If we meet some day, and you think - this stuff is worth it, you can buy me a beer in return. + wrote this file. As long + as you retain this notice you can do whatever you want + with this stuff. If we meet some day, and you think + this stuff is worth it, you can buy me a beer in return. """ import os import sys @@ -51,7 +51,7 @@ graph_args --base 1000 graph_vlabel Replication lag (seconds) graph_category db """ - + for member in _get_members(): print "{0}.label {0}".format(member) diff --git a/plugins/mssql/microsoft-sql b/plugins/mssql/microsoft-sql index 181396ba..c56c703c 100755 --- a/plugins/mssql/microsoft-sql +++ b/plugins/mssql/microsoft-sql @@ -58,8 +58,8 @@ instance = 'AdventureWorks' # dbh = DBI.connect("DBI:ODBC:#{dsn}",sqluser,sqlpass) -instance_name_query = "SELECT distinct instance_name - FROM sys.dm_os_performance_counters +instance_name_query = "SELECT distinct instance_name + FROM sys.dm_os_performance_counters WHERE instance_name = '#{instance}' and object_name = 'SQLServer:Databases' order by instance_name" @@ -91,7 +91,7 @@ if ARGV[0] == "autoconf" # config definition # elsif ARGV[0] == "config" - puts "graph_args --base 1000 -r --lower-limit 0" + puts "graph_args --base 1000 -r --lower-limit 0" puts "graph_title MSSQL Transactions/s" puts "graph_category db" puts "graph_info This graph shows transactions/s" diff --git a/plugins/mssql/microsoft-sql-buffer-cache-hit-ratio b/plugins/mssql/microsoft-sql-buffer-cache-hit-ratio index 61ca3d7d..ca376f16 100755 --- a/plugins/mssql/microsoft-sql-buffer-cache-hit-ratio +++ b/plugins/mssql/microsoft-sql-buffer-cache-hit-ratio @@ -81,7 +81,7 @@ if ARGV[0] == "autoconf" # config definition # elsif ARGV[0] == "config" - puts "graph_args --base 1000 -r --lower-limit 0" + puts "graph_args --base 1000 -r --lower-limit 0" puts "graph_title MSSQL Buffer Cache Hit Ratio " puts "graph_category db" puts "graph_info This graph shows Buffer Cache Hit Ratio" diff --git a/plugins/mssql/microsoft-sql-data-file-sizes b/plugins/mssql/microsoft-sql-data-file-sizes index f7143658..9e72eab4 100755 --- a/plugins/mssql/microsoft-sql-data-file-sizes +++ b/plugins/mssql/microsoft-sql-data-file-sizes @@ -58,7 +58,7 @@ instance = 'AdventureWorks' # dbh = DBI.connect("DBI:ODBC:#{dsn}",sqluser,sqlpass) -instance_name_query = "SELECT distinct instance_name +instance_name_query = "SELECT distinct instance_name FROM sys.dm_os_performance_counters WHERE instance_name = '#{instance}'" @@ -89,7 +89,7 @@ if ARGV[0] == "autoconf" # config definition # elsif ARGV[0] == "config" - puts "graph_args --base 1024k -r --lower-limit 0" + puts "graph_args --base 1024k -r --lower-limit 0" puts "graph_title MSSQL DB File Sizes" puts "graph_category db" puts "graph_info This graph shows DB File Sizes (MB)" diff --git a/plugins/mssql/microsoft-sql-log-file-size b/plugins/mssql/microsoft-sql-log-file-size index 3bbf0c0e..14c7ffc2 100755 --- a/plugins/mssql/microsoft-sql-log-file-size +++ b/plugins/mssql/microsoft-sql-log-file-size @@ -58,7 +58,7 @@ instance = 'AdventureWorks' # dbh = DBI.connect("DBI:ODBC:#{dsn}",sqluser,sqlpass) -instance_name_query = "SELECT distinct instance_name +instance_name_query = "SELECT distinct instance_name FROM sys.dm_os_performance_counters WHERE instance_name = '#{instance}'" @@ -89,7 +89,7 @@ if ARGV[0] == "autoconf" # config definition # elsif ARGV[0] == "config" - puts "graph_args --base 1024k -r --lower-limit 0" + puts "graph_args --base 1024k -r --lower-limit 0" puts "graph_title MSSQL DB Log File Sizes" puts "graph_category db" puts "graph_info This graph shows DB Log File Sizes (MB)" diff --git a/plugins/mumble/murmur-stats b/plugins/mumble/murmur-stats index bb87951d..03178659 100755 --- a/plugins/mumble/murmur-stats +++ b/plugins/mumble/murmur-stats @@ -41,4 +41,4 @@ print "uptime.value %.2f" % (float(meta.getUptime())/60/60/24) print "chancount.value %.1f" % (len(server.getChannels())/10) print "bancount.value %i" % (len(server.getBans())) -ice.shutdown() +ice.shutdown() diff --git a/plugins/munin/healthcheck_url b/plugins/munin/healthcheck_url index 6686f723..66d38700 100755 --- a/plugins/munin/healthcheck_url +++ b/plugins/munin/healthcheck_url @@ -17,14 +17,14 @@ #env.url_1 http://127.0.0.1/ #--------------------------------------------------- # -#check two site +#check two site #--------------------------------------------------- #[healthcheck_url] #env.url_1 http://127.0.0.1/ #env.url_2 http://www.google.com/ #--------------------------------------------------- # -#check three site +#check three site #--------------------------------------------------- #[healthcheck_url] #env.url_1 http://127.0.0.1/ diff --git a/plugins/mysql/mysql-schema-size b/plugins/mysql/mysql-schema-size index d1227479..05a210f9 100755 --- a/plugins/mysql/mysql-schema-size +++ b/plugins/mysql/mysql-schema-size @@ -63,7 +63,7 @@ EOT; public function getSchemaSize() { $sql = <<getTableSize($schema,$table); $data_length = $row['data_length']; echo "$table.value $data_length\n"; @@ -74,7 +74,7 @@ EOT; public function getSchemaSize($schema) { $bind = array($schema); $sql = << "index", +my %WANTED = ( "Index" => "index", "Datas" => "datas", ); diff --git a/plugins/mysql/mysql_size_all b/plugins/mysql/mysql_size_all index c6f617b9..c5a39f84 100755 --- a/plugins/mysql/mysql_size_all +++ b/plugins/mysql/mysql_size_all @@ -48,7 +48,7 @@ use strict; my $COMMAND; my $MYSQLADMIN = $ENV{mysqladmin} || "mysql"; -my %WANTED = ( "Index" => "index", +my %WANTED = ( "Index" => "index", "Datas" => "datas", ); @@ -170,7 +170,7 @@ sub test_service { sub getDBList { my @dbs; foreach my $f (glob("/var/lib/mysql/*")) { - if (-d $f) { + if (-d $f) { $f =~ s/\@002d/-/g; $f =~ s!.*/!!; @dbs[$#dbs+1]=$f }; diff --git a/plugins/mysql/mysql_slave_threads b/plugins/mysql/mysql_slave_threads index f09f97af..6669c85d 100755 --- a/plugins/mysql/mysql_slave_threads +++ b/plugins/mysql/mysql_slave_threads @@ -41,7 +41,7 @@ EOC my $status = `$MYSQL $MYSQLOPTS -e 'SHOW SLAVE STATUS\\G'`; -$status =~ /Slave_IO_Running: (\w+)/; +$status =~ /Slave_IO_Running: (\w+)/; print 'io.value '.($1 eq 'Yes' ? 1 : 0)."\n"; $status =~ /Slave_SQL_Running: (\w+)/; print 'sql.value '.($1 eq 'Yes' ? 1 : 0)."\n"; diff --git a/plugins/mythtv/mythtv_programs b/plugins/mythtv/mythtv_programs index 826549a1..e205329b 100755 --- a/plugins/mythtv/mythtv_programs +++ b/plugins/mythtv/mythtv_programs @@ -2,8 +2,8 @@ # # Munin plugin for MythTV # This plugin can graph:- EPG programs per channel -# -# NOTE: This plugin needs to run as root so add the following to your munin-node config file +# +# NOTE: This plugin needs to run as root so add the following to your munin-node config file # [mythtv_status*] # user=root # @@ -48,8 +48,8 @@ my $Channel=""; print "cannot find MythTV configuration file my.txt\n"; exit 1; } - } - + } + #Config Options ##Configuration for encoder, no config data needs to read from anywhere if ($ARGV[0] and $ARGV[0] eq "config"){ @@ -71,16 +71,16 @@ my $Channel=""; print "Channel" . $Channel . "EPG.label EPG days for channel $gata\n"; $Ptr=0; } - } + } exit 0; } #Actually dump data to Munin - @result=SQLQuery("SELECT o.chanid, (UNIX_TIMESTAMP(MAX(c.endtime)) - - UNIX_TIMESTAMP(NOW()))/86400 - FROM channel o, program c + @result=SQLQuery("SELECT o.chanid, (UNIX_TIMESTAMP(MAX(c.endtime)) + - UNIX_TIMESTAMP(NOW()))/86400 + FROM channel o, program c WHERE o.chanid = c.chanid - AND o.visible = '1' + AND o.visible = '1' GROUP BY o.chanid"); my $Ptr=0; foreach $gata (@result) { @@ -89,10 +89,10 @@ my $Channel=""; $Ptr=1; } else { if ( $gata > 12 ) { - print "Channel" . $Channel . "EPG.value 12.0\n"; - } else { + print "Channel" . $Channel . "EPG.value 12.0\n"; + } else { print "Channel" . $Channel . "EPG.value $gata\n"; - } + } $Ptr=0; } } @@ -104,7 +104,7 @@ exit 0; sub PrepSQLRead { my $hostname = `hostname`; chomp($hostname); - + # Read the mysql.txt file in use by MythTV. Could be in a couple places, so try the usual suspects my $found = 0; my @mysql = ('/usr/local/share/mythtv/mysql.txt', @@ -153,7 +153,7 @@ sub SQLQuery { my ($QUERY) = @_; my @data; my $ref; - my $dbh = DBI->connect("DBI:mysql:$SQLDBName:$SQLServer", $SQLUser, $SQLPassword) + my $dbh = DBI->connect("DBI:mysql:$SQLDBName:$SQLServer", $SQLUser, $SQLPassword) or die "Couldn't connect to database: " . DBI->errstr; my $table_data = $dbh->prepare($QUERY) or die "Couldn't prepare statement: " . $dbh->errstr; $table_data->execute or die "Couldn't execute statement: " . $table_data->errstr; @@ -165,5 +165,5 @@ sub SQLQuery { return @data; } else { return 0; - } + } } diff --git a/plugins/mythtv/mythtv_status_ b/plugins/mythtv/mythtv_status_ index dbace488..dfaf31e0 100755 --- a/plugins/mythtv/mythtv_status_ +++ b/plugins/mythtv/mythtv_status_ @@ -2,19 +2,19 @@ # # Munin plugin for MythTV # This plugin can graph:- Encoder Status, Days Remaining in Schedule, Job schedule, Recording Schedule, Recorded Programes, Recorded hours -# +# # Create a symbolic link to mythtv_status_{GraphType} # Where {GraphType} can be encoder, epg, job, schedule, recorded # for example mythtv_status_encoder # -# NOTE: This plugin needs to run as root so add the following to your munin-node config file +# NOTE: This plugin needs to run as root so add the following to your munin-node config file # [mythtv_status*] # user=root # The http/xml status page must be enabled in the mythtv backend. # # $Log$ # Revision 0.1 2008/03/27 idobson -# Code for all options except recorded implemented +# Code for all options except recorded implemented # # Revision 0.2 2008/03/28 idobson # Tidied up the code abit/removed dead functions @@ -35,7 +35,7 @@ # Revision 0.7 2008/04/3 idobson # Now using SQL to read the number of days in the EPG # Changed recordings symlink to schedule, makes more sense -# +# # Revision 0.8 2008/04/6 idobson # Tidied up the SQL code abit, moved it into a function. # @@ -43,7 +43,7 @@ # Added a check that we got the XML data before trying to parse it. # # Revision 1.0 2008/04/15 idobson -# Fixed undef returned from SQL query, it now returns 0, +# Fixed undef returned from SQL query, it now returns 0, # added error handler to SQL sub. It just dies with an error text. # # Revision 1.1 2008/05/03 idobson @@ -94,7 +94,7 @@ my $RecHoursLiveTV=0; my $result=""; my $gata=""; my $VideoInput=1; - $GraphOption=`basename $0 | sed 's/^mythtv_status_//g' | tr '_' '-'` ; + $GraphOption=`basename $0 | sed 's/^mythtv_status_//g' | tr '_' '-'` ; chomp $GraphOption; PrepSQLRead(); @@ -103,7 +103,7 @@ PrepSQLRead(); if ($ARGV[0] and $ARGV[0] eq "autoconf" ) { print "yes\n"; exit 0; - } + } #Config Options ##Configuration for encoder, no config data needs to read from anywhere @@ -135,7 +135,7 @@ PrepSQLRead(); print "FreeEncoders.colour 00FF00\n"; print "HungEncoders.colour 000000\n"; print "HungEncoders.draw LINE1\n"; - print "HungEncoders.label Encoders that have hung (no DB update)\n"; + print "HungEncoders.label Encoders that have hung (no DB update)\n"; print "HungEncoders.warning 0:0\n"; } @@ -147,7 +147,7 @@ PrepSQLRead(); print "graph_title MythTV EPG days/Programs\n"; print "graph_category tv\n"; print "graph_vlabel Days\/Programs\n"; - + @result=SQLQuery("SELECT DISTINCT `sourceid` FROM `cardinput`"); $VideoInput = 1; foreach $gata (@result) { @@ -259,7 +259,7 @@ PrepSQLRead(); @result=SQLQuery("SELECT count(*) FROM `capturecard` "); my $FreeRecorders=$result[0]; my $ActiveTuners=0; - @result=SQLQuery("SELECT videosource.name, count( inuseprograms.recusage ) + @result=SQLQuery("SELECT videosource.name, count( inuseprograms.recusage ) FROM inuseprograms, channel, videosource WHERE inuseprograms.recusage = 'recorder' AND inuseprograms.chanid = channel.chanid @@ -283,8 +283,8 @@ PrepSQLRead(); } print "FreeEncoders.value $FreeRecorders\n"; @result=SQLQuery("SELECT count(inuseprograms.recusage) - from inuseprograms - where inuseprograms.recusage = 'recorder' + from inuseprograms + where inuseprograms.recusage = 'recorder' and (UNIX_TIMESTAMP( NOW( )) - UNIX_TIMESTAMP(inuseprograms.lastupdatetime)) / 60 > 20"); print "HungEncoders.value $result[0]\n"; } @@ -296,7 +296,7 @@ PrepSQLRead(); foreach $gata (@result) { print "EPGDays$VideoInput.value $gata\n"; $VideoInput++; - } + } #Get number of programs in EPG per video source $VideoInput = 1; @@ -324,7 +324,7 @@ PrepSQLRead(); @result=SQLQuery("SELECT COUNT(*) FROM `record`"); print "RecordingSchedules.value $result[0]\n"; -#Connect to mythtv using the MythTV object +#Connect to mythtv using the MythTV object my $Repeats=0; my $Recordings=0; my $Conflicts=0; @@ -374,7 +374,7 @@ exit 0; sub PrepSQLRead { my $hostname = `hostname`; chomp($hostname); - + # Read the mysql.txt file in use by MythTV. Could be in a couple places, so try the usual suspects my $found = 0; my @mysql = ('/usr/local/share/mythtv/mysql.txt', @@ -423,7 +423,7 @@ sub SQLQuery { my ($QUERY) = @_; my @data; my $ref; - my $dbh = DBI->connect_cached("DBI:mysql:$SQLDBName:$SQLServer", $SQLUser, $SQLPassword) + my $dbh = DBI->connect_cached("DBI:mysql:$SQLDBName:$SQLServer", $SQLUser, $SQLPassword) or die "Couldn't connect to database: " . DBI->errstr; my $table_data = $dbh->prepare($QUERY) or die "Couldn't prepare statement: " . $dbh->errstr; $table_data->execute or die "Couldn't execute statement: " . $table_data->errstr; @@ -435,7 +435,7 @@ sub SQLQuery { return @data; } else { return 0; - } + } } # Returns true if the show is scheduled to record diff --git a/plugins/nagios/nagios_multi_ b/plugins/nagios/nagios_multi_ index 20dbedc7..c34d99ec 100755 --- a/plugins/nagios/nagios_multi_ +++ b/plugins/nagios/nagios_multi_ @@ -14,7 +14,7 @@ A Plugin to monitor Nagios Servers and their Performance (Multigraph) =head2 MUNIN ENVIRONMENT CONFIGURATION EXPLANATION binary = location of your nagiostats binary including binary - passive = tell the plugin to graph passive results + passive = tell the plugin to graph passive results =head1 NODE CONFIGURATION @@ -60,7 +60,7 @@ Matt West < https://github.com/mhwest13/Nagios-Munin-Plugin > GPLv2 =head1 MAGIC MARKERS - + #%# family=auto #%# capabilities=autoconf suggest @@ -122,7 +122,7 @@ my $passive = $ENV{passive} || 'off'; my %graphs; -# main graph for service checks +# main graph for service checks $graphs{services} = { config => { args => '--lower-limit 0', @@ -207,7 +207,7 @@ $graphs{svcchkext} = { { name => 'AVGACTSVCEXT', label => 'Average Execution', min => '0', type => 'GAUGE', info => 'avg active service check execution time (ms).', draw => 'LINE2' }, ], }; -# main graph for host problems +# main graph for host problems $graphs{hosts} = { config => { args => '--lower-limit 0', @@ -290,7 +290,7 @@ $graphs{hostchkext} = { { name => 'AVGACTHSTEXT', label => 'Average Execution', min => '0', type => 'GAUGE', info => 'avg active host check execution time (ms).', draw => 'LINE2' }, ], }; -# main graph for host / service check counts +# main graph for host / service check counts $graphs{checks} = { config => { args => '--lower-limit 0', @@ -404,8 +404,8 @@ $graphs{extcmdcount} = { =head2 Config Check This block of code looks at the argument that is possibly supplied, - should it be config, it then checks to make sure the plugin - specified exists, assuming it does, it will run the do_config + should it be config, it then checks to make sure the plugin + specified exists, assuming it does, it will run the do_config subroutine for the plugin specified, otherwise it dies complaining about an unknown plugin. @@ -618,7 +618,7 @@ sub do_config { =cut sub print_sub_config { - # Lets get our plugin and subgraph, after that print for Munin to process it. + # Lets get our plugin and subgraph, after that print for Munin to process it. my ($plugin,$subgraph) = (@_); my $graph = $graphs{$subgraph}; print "multigraph nagios_$plugin.$subgraph\n"; diff --git a/plugins/nagios/nagiosstatus b/plugins/nagios/nagiosstatus index 57200814..051a1fcd 100755 --- a/plugins/nagios/nagiosstatus +++ b/plugins/nagios/nagiosstatus @@ -14,7 +14,7 @@ # Config variables: # # statuslog - Which logfile to use -# Might be /var/log/nagios2/nagios.log if +# Might be /var/log/nagios2/nagios.log if # /var/log/nagios/status.log is missing # # This program is free software; you can redistribute it and/or @@ -109,7 +109,7 @@ while() { if(/^\s+\}\s*$/) { $type = ""; } - + if($type) { push(@{$values{$type}}, $_); } diff --git a/plugins/netapp/snmp__netapp_cifs b/plugins/netapp/snmp__netapp_cifs index 75e7365a..0e4b8f6c 100755 --- a/plugins/netapp/snmp__netapp_cifs +++ b/plugins/netapp/snmp__netapp_cifs @@ -4,21 +4,21 @@ """ # The SNMP traps for the NetApp filer can be found in -# /net/netappfiler/vol0/etc/mib/traps.dat if the filer is +# /net/netappfiler/vol0/etc/mib/traps.dat if the filer is # NFS automounted mounted on server. # Example: the SNMP id for cpuBusyTimePerCent is -# snmp.1.3.6.1.4.1.789.1.2.1.3.0 -# and retrival of this value is done by +# snmp.1.3.6.1.4.1.789.1.2.1.3.0 +# and retrival of this value is done by # snmpget -v 1 -c public netappfiler 1.3.6.1.4.1.789.1.2.1.3.0 # -# Requires snmpget and assumes public community. +# Requires snmpget and assumes public community. import commands import sys # Provided a servername and a snmpid it returns the value stripped of bogus information. def snmpget(iservername,isnmpid): - runcmd = 'snmpget -v 1 -c public ' + iservername + ' ' + isnmpid + runcmd = 'snmpget -v 1 -c public ' + iservername + ' ' + isnmpid output = commands.getoutput(runcmd) return output.split()[3] @@ -34,14 +34,14 @@ if len(sys.argv) == 2 and sys.argv[1] == "config": print 'graph_args --base 1000 -l 0' print 'graph_vlabel number' print 'graph_category fs' - print 'graph_info This graph shows CIFS usage on '+servername + print 'graph_info This graph shows CIFS usage on '+servername print 'cifsConnectedUsers.label ConnectedUsers' print 'cifsConnectedUsers.info The current number of CIFS users on the filer' - + print 'cifsNSessions.label NumberOfSessions' print 'cifsNSessions.info The current number of active CIFS session on the filer' - + print 'cifsNOpenFiles.label NumberOfOpenfiles' print 'cifsNOpenFiles.info The number of open CIFS files and directories on the filer' sys.exit(0) diff --git a/plugins/netapp/snmp__netapp_cpu b/plugins/netapp/snmp__netapp_cpu index ea56b09b..5aef035c 100755 --- a/plugins/netapp/snmp__netapp_cpu +++ b/plugins/netapp/snmp__netapp_cpu @@ -4,14 +4,14 @@ """ # The SNMP traps for the NetApp filer can be found in -# /net/netappfiler/vol0/etc/mib/traps.dat if the filer is +# /net/netappfiler/vol0/etc/mib/traps.dat if the filer is # NFS automounted mounted on server. # Example: the SNMP id for cpuBusyTimePerCent is -# snmp.1.3.6.1.4.1.789.1.2.1.3.0 -# and retrival of this value is done by +# snmp.1.3.6.1.4.1.789.1.2.1.3.0 +# and retrival of this value is done by # snmpget -v 1 -c public netappfiler 1.3.6.1.4.1.789.1.2.1.3.0 # -# Requires snmpget and assumes public community. +# Requires snmpget and assumes public community. import commands import sys @@ -24,7 +24,7 @@ def snmpget(iservername,isnmpid): snmpid = "1.3.6.1.4.1.789.1.2.1.3.0" warning = 80 -critical = 95 +critical = 95 servername = sys.argv[0].split('_')[1] if len(sys.argv) == 2 and sys.argv[1] == "config": diff --git a/plugins/netapp/snmp__netapp_diskbusy b/plugins/netapp/snmp__netapp_diskbusy index 35a4b262..da44a4ec 100755 --- a/plugins/netapp/snmp__netapp_diskbusy +++ b/plugins/netapp/snmp__netapp_diskbusy @@ -64,7 +64,7 @@ sub do_collect sub do_config_root { # graph_category san # To show plugin in Gallery also in this category - + my ($host) = @_; print "multigraph diskbusy\n"; diff --git a/plugins/netapp/snmp__netapp_nfs3calls b/plugins/netapp/snmp__netapp_nfs3calls index 44acdb21..3f29fcf2 100755 --- a/plugins/netapp/snmp__netapp_nfs3calls +++ b/plugins/netapp/snmp__netapp_nfs3calls @@ -14,9 +14,9 @@ with SNMP agent daemon activated. See na_snmp(8) for details. Unfortunately, SNMPv3 is not fully supported on all NetApp equipments. For this reason, this plugin will use SNMPv2 by default, which is -insecure because it doesn't encrypt the community string. +insecure because it doesn't encrypt the community string. -The following parameters will help you get this plugin working : +The following parameters will help you get this plugin working: [snmp_*] env.community MyCommunity diff --git a/plugins/netscaler/snmp__netscaler_connections b/plugins/netscaler/snmp__netscaler_connections index 9cc822f1..8b6952a1 100755 --- a/plugins/netscaler/snmp__netscaler_connections +++ b/plugins/netscaler/snmp__netscaler_connections @@ -23,9 +23,9 @@ # 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, see . +# along with this program. If not, see . # -# ---------------------------------------------------- # +# ---------------------------------------------------- # =head1 NAME @@ -33,7 +33,7 @@ netscaler_conn - Munin plugin to monitor netscaler connections =head1 CONFIGURATION -Make a symlink from netscaler_conn_ to /etc/munin/plugins/netscaler_conn_. +Make a symlink from netscaler_conn_ to /etc/munin/plugins/netscaler_conn_. You can omit , then you need the env variable B. To configure the plugin, use ENV variables. @@ -173,7 +173,7 @@ $return_str .= "ssl.value $counter1\n"; &close_session($session); -print "$return_str"; +print "$return_str"; exit 0; # --------------------------- functions ------------------------- # @@ -203,7 +203,7 @@ sub close_session { sub get_buildversion { my ($session) = @_; my $build_version; - + my $result = $session->get_request( -varbindlist => [$oid_build_version] ); @@ -228,7 +228,7 @@ sub get_oid_values { if (!defined($result)) { return "na"; } - else { + else { $return_value = $result->{$oid_string}; return $return_value; } diff --git a/plugins/netscaler/snmp__netscaler_cpu b/plugins/netscaler/snmp__netscaler_cpu index e0ad7bb5..a13f447d 100755 --- a/plugins/netscaler/snmp__netscaler_cpu +++ b/plugins/netscaler/snmp__netscaler_cpu @@ -23,9 +23,9 @@ # 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, see . +# along with this program. If not, see . # -# ---------------------------------------------------- # +# ---------------------------------------------------- # =head1 NAME @@ -33,7 +33,7 @@ netscaler_cpu - Munin plugin to monitor CPU usage =head1 CONFIGURATION -Make a symlink from netscaler_cpu_ to /etc/munin/plugins/netscaler_cpu_. +Make a symlink from netscaler_cpu_ to /etc/munin/plugins/netscaler_cpu_. You can omit , then you need the env variable B. To configure the plugin, use ENV variables. @@ -96,7 +96,7 @@ $o_community = undef; $o_port = 161; my $return_str = ""; -my @cpu_name = (); +my @cpu_name = (); # ---------------------------- snmp ---------------------------- # @@ -176,7 +176,7 @@ if ($ARGV[0] and $ARGV[0] eq "config") { &close_session($session); -print "$return_str"; +print "$return_str"; exit 0; # --------------------------- functions ------------------------- # @@ -206,7 +206,7 @@ sub close_session { sub get_buildversion { my ($session) = @_; my $build_version; - + my $result = $session->get_request( -varbindlist => [$oid_build_version] ); @@ -268,7 +268,7 @@ sub get_cpus { return 0; } else { - @cpu_name = (); + @cpu_name = (); foreach my $n ($session->var_bind_names()) { push @cpu_name, $session->var_bind_list()->{$n}; } diff --git a/plugins/network/bandwidth_ b/plugins/network/bandwidth_ index 09b3410c..031709b8 100755 --- a/plugins/network/bandwidth_ +++ b/plugins/network/bandwidth_ @@ -18,7 +18,7 @@ bandwidth_ 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}; } diff --git a/plugins/network/bgpd b/plugins/network/bgpd index 8624a221..dc0c7515 100755 --- a/plugins/network/bgpd +++ b/plugins/network/bgpd @@ -1,7 +1,7 @@ #!/bin/sh # bgpd.sh -# +# # # Created by spleen. diff --git a/plugins/network/brc_rssi b/plugins/network/brc_rssi index 348f8263..01c76325 100755 --- a/plugins/network/brc_rssi +++ b/plugins/network/brc_rssi @@ -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 '') :;; diff --git a/plugins/network/ddclient b/plugins/network/ddclient index cebf6db7..b77cd67f 100755 --- a/plugins/network/ddclient +++ b/plugins/network/ddclient @@ -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 diff --git a/plugins/network/denyhosts b/plugins/network/denyhosts index d1456c4b..8617caed 100755 --- a/plugins/network/denyhosts +++ b/plugins/network/denyhosts @@ -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 diff --git a/plugins/network/fms b/plugins/network/fms index 29eeb219..2aaf70ee 100755 --- a/plugins/network/fms +++ b/plugins/network/fms @@ -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; diff --git a/plugins/network/fms_apps b/plugins/network/fms_apps index 06beed5d..241958a4 100755 --- a/plugins/network/fms_apps +++ b/plugins/network/fms_apps @@ -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; diff --git a/plugins/network/fms_apps_rate b/plugins/network/fms_apps_rate index 9a9b1573..d84fec3b 100755 --- a/plugins/network/fms_apps_rate +++ b/plugins/network/fms_apps_rate @@ -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; diff --git a/plugins/network/fwbuilder_ b/plugins/network/fwbuilder_ index 23f8ba3c..d8ccfb4a 100755 --- a/plugins/network/fwbuilder_ +++ b/plugins/network/fwbuilder_ @@ -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; diff --git a/plugins/network/hfsc b/plugins/network/hfsc index 14314069..fb1171d3 100755 --- a/plugins/network/hfsc +++ b/plugins/network/hfsc @@ -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 diff --git a/plugins/network/hfsc_sep b/plugins/network/hfsc_sep index 114458d6..355e1c13 100755 --- a/plugins/network/hfsc_sep +++ b/plugins/network/hfsc_sep @@ -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 diff --git a/plugins/network/hostsdeny b/plugins/network/hostsdeny index d5196556..3977be38 100755 --- a/plugins/network/hostsdeny +++ b/plugins/network/hostsdeny @@ -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. # diff --git a/plugins/network/if b/plugins/network/if index d5086c85..3ad61159 100755 --- a/plugins/network/if +++ b/plugins/network/if @@ -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'}}) diff --git a/plugins/network/if1sec-c.c b/plugins/network/if1sec-c.c index 4786d956..c31031ae 100644 --- a/plugins/network/if1sec-c.c +++ b/plugins/network/if1sec-c.c @@ -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 diff --git a/plugins/network/if_uptime b/plugins/network/if_uptime index c5c51d2a..4dce3e7d 100755 --- a/plugins/network/if_uptime +++ b/plugins/network/if_uptime @@ -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 diff --git a/plugins/network/ifem_ b/plugins/network/ifem_ index 89d42bd2..13a0c60d 100755 --- a/plugins/network/ifem_ +++ b/plugins/network/ifem_ @@ -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 (+)' diff --git a/plugins/network/interfaces_linux_multi b/plugins/network/interfaces_linux_multi index 2b75c82c..d9515725 100755 --- a/plugins/network/interfaces_linux_multi +++ b/plugins/network/interfaces_linux_multi @@ -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; } diff --git a/plugins/network/ip_forward_ b/plugins/network/ip_forward_ index d5ae66a2..374092f2 100755 --- a/plugins/network/ip_forward_ +++ b/plugins/network/ip_forward_ @@ -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; diff --git a/plugins/network/ipfwnat_ b/plugins/network/ipfwnat_ index 3708729e..1ebba2de 100755 --- a/plugins/network/ipfwnat_ +++ b/plugins/network/ipfwnat_ @@ -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;}' diff --git a/plugins/network/ipt_basic_ b/plugins/network/ipt_basic_ index ec17102f..dd692fcd 100755 --- a/plugins/network/ipt_basic_ +++ b/plugins/network/ipt_basic_ @@ -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" diff --git a/plugins/network/ldap_connections b/plugins/network/ldap_connections index fc24b18b..49dd1cc6 100755 --- a/plugins/network/ldap_connections +++ b/plugins/network/ldap_connections @@ -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) # diff --git a/plugins/network/netatalk b/plugins/network/netatalk index 9ac211eb..58c53c68 100755 --- a/plugins/network/netatalk +++ b/plugins/network/netatalk @@ -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 diff --git a/plugins/network/nsd3 b/plugins/network/nsd3 index f2a4cddf..3b2e8b42 100755 --- a/plugins/network/nsd3 +++ b/plugins/network/nsd3 @@ -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 - + =head1 LICENSE - + GPLv2 - + =cut """ diff --git a/plugins/network/qos_ b/plugins/network/qos_ index 06592904..973f5204 100755 --- a/plugins/network/qos_ +++ b/plugins/network/qos_ @@ -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}, " "; diff --git a/plugins/network/radio b/plugins/network/radio index 4534506e..460f4b49 100755 --- a/plugins/network/radio +++ b/plugins/network/radio @@ -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) diff --git a/plugins/network/shorewall-accounting_ b/plugins/network/shorewall-accounting_ index 9f6f9f21..4bb27d38 100755 --- a/plugins/network/shorewall-accounting_ +++ b/plugins/network/shorewall-accounting_ @@ -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 # Copyright 2006 Chris AtLee # diff --git a/plugins/network/shorewall_ b/plugins/network/shorewall_ index a48f8007..b32bb7a0 100755 --- a/plugins/network/shorewall_ +++ b/plugins/network/shorewall_ @@ -1,11 +1,11 @@ #!/usr/bin/python # shorewall_ v2.0 - 30 Aug 2008 - Tanguy Pruvot -# +# # 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 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) \ No newline at end of file diff --git a/plugins/network/shorewall_acc b/plugins/network/shorewall_acc index 2e60cd2d..5a5fc479 100755 --- a/plugins/network/shorewall_acc +++ b/plugins/network/shorewall_acc @@ -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) diff --git a/plugins/network/tc_drops_ b/plugins/network/tc_drops_ index f719291b..8906080c 100755 --- a/plugins/network/tc_drops_ +++ b/plugins/network/tc_drops_ @@ -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 diff --git a/plugins/network/tc_packets_ b/plugins/network/tc_packets_ index 8ae58204..0c5cadc2 100755 --- a/plugins/network/tc_packets_ +++ b/plugins/network/tc_packets_ @@ -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 diff --git a/plugins/network/transmission b/plugins/network/transmission index 8d95b1de..ea3d15ad 100755 --- a/plugins/network/transmission +++ b/plugins/network/transmission @@ -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" : diff --git a/plugins/network/ubiquiti_airfiber_ b/plugins/network/ubiquiti_airfiber_ index 96e04ca2..233194fc 100755 --- a/plugins/network/ubiquiti_airfiber_ +++ b/plugins/network/ubiquiti_airfiber_ @@ -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(); diff --git a/plugins/network/ubiquiti_airos_ b/plugins/network/ubiquiti_airos_ index f1e7351d..9be5cca0 100755 --- a/plugins/network/ubiquiti_airos_ +++ b/plugins/network/ubiquiti_airos_ @@ -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"; diff --git a/plugins/network/umts_sig b/plugins/network/umts_sig index b66a9b55..674a697e 100755 --- a/plugins/network/umts_sig +++ b/plugins/network/umts_sig @@ -1,5 +1,5 @@ #!/bin/bash -# +# # A Munin Plugin to show umts signal strength using gcom # Created by Derik Vercueil # Based on a work of "auth" diff --git a/plugins/network/upnpc_ b/plugins/network/upnpc_ index e3c933c5..7e42fdea 100755 --- a/plugins/network/upnpc_ +++ b/plugins/network/upnpc_ @@ -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/.*_//'` diff --git a/plugins/network/vnstat b/plugins/network/vnstat index 65a52f8d..afdaf9f3 100755 --- a/plugins/network/vnstat +++ b/plugins/network/vnstat @@ -26,7 +26,7 @@ if [ "$1" = "config" ]; then echo 'totalrx.info Total data received.' echo 'totalrx.cdef totalrx,1000000,*' exit 0 - + fi; diff --git a/plugins/network/vnstat_ b/plugins/network/vnstat_ index 9fb9c039..23388ae1 100755 --- a/plugins/network/vnstat_ +++ b/plugins/network/vnstat_ @@ -34,7 +34,7 @@ if [ "$1" = "config" ]; then echo 'totalrx.info Total data received.' echo 'totalrx.cdef totalrx,1000000,*' exit 0 - + fi; diff --git a/plugins/newznab/nn_ b/plugins/newznab/nn_ index 0bb1c601..41f13395 100755 --- a/plugins/newznab/nn_ +++ b/plugins/newznab/nn_ @@ -101,7 +101,7 @@ $graphs{releases} = { }, data_source_attrs => { min => '0', - + }, }, data_sources => [ @@ -254,7 +254,7 @@ sub main { 'config' => \&config, 'show' => \&show, ); - + die "Unknown command: $command" unless exists $commands{$command}; return $commands{$command}->($graph); } @@ -265,7 +265,7 @@ sub show { unless $graphs{$graph_name}; my $graph = $graphs{$graph_name}; - run_queries($graph_name); + run_queries($graph_name); for my $ds (@{$graph->{data_sources}}) { printf "%s.value %s\n", clean_fieldname($ds->{label}), ($data->{$ds->{name}} ? $data->{$ds->{name}} : '0'); } @@ -298,22 +298,22 @@ sub run_queries { } sub update_requests { - my ($dbh) = @_; + my ($dbh) = @_; my %queries = ( - request => 'select count(*) as requests from userrequests where timestamp > now() - INTERVAL 5 MINUTE;', - download => 'select count(*) as downloads from userdownloads where timestamp > now() - INTERVAL 5 MINUTE;', - ); + request => 'select count(*) as requests from userrequests where timestamp > now() - INTERVAL 5 MINUTE;', + download => 'select count(*) as downloads from userdownloads where timestamp > now() - INTERVAL 5 MINUTE;', + ); for my $name ( qw(request download) ) { - my $query = $queries{$name}; - my $sth = $dbh->prepare($query); - $sth->execute(); - while (my $row = $sth->fetch) { + my $query = $queries{$name}; + my $sth = $dbh->prepare($query); + $sth->execute(); + while (my $row = $sth->fetch) { $data->{$name} = $row->[0]; } - $sth->finish(); - } + $sth->finish(); + } } - + sub update_category { my ($dbh) = @_; my $sth = $dbh->prepare('select count(*) as releases, category.title, category.id from releases LEFT JOIN category ON releases.categoryID = category.ID group by releases.categoryID'); @@ -322,7 +322,7 @@ sub update_category { while (my $row = $sth->fetch) { $data->{$row->[2]} = $row->[0]; } - + } sub update_releases { my ($dbh) = @_; @@ -331,7 +331,7 @@ sub update_releases { $sth->execute(); }; if ($@) { die $@; } - my $row = $sth->fetchrow_hashref(); + my $row = $sth->fetchrow_hashref(); $data->{releases} = $row->{'releases'}; $sth->finish(); } @@ -343,7 +343,7 @@ sub update_users { $sth->execute(); }; if ($@) { die $@; } - my $row = $sth->fetchrow_hashref(); + my $row = $sth->fetchrow_hashref(); $data->{users} = $row->{'users'}; $sth->finish(); } diff --git a/plugins/nginx/nginx-combined b/plugins/nginx/nginx-combined index 0adf8362..e1006b01 100755 --- a/plugins/nginx/nginx-combined +++ b/plugins/nginx/nginx-combined @@ -10,7 +10,7 @@ # Copyright (C) 2010 António P. P. Almeida # Copyright (C) 2010 Minato Miray -# Author: António P. P. Almeida , +# Author: António P. P. Almeida , # Author: Minato Miray ####################################### @@ -50,7 +50,7 @@ if ( exists $ARGV[0] and $ARGV[0] eq "autoconf" ) print "no ($ret)\n"; exit 1; } - + my $ua = LWP::UserAgent->new(timeout => 30); my $response = $ua->request(HTTP::Request->new('GET',$URL)); @@ -75,15 +75,15 @@ if ( exists $ARGV[0] and $ARGV[0] eq "config" ) print "reqpsec.label Request/sec.\n"; print "reqpsec.info Request/sec.\n"; - print "reqpsec.draw LINE2\n"; + print "reqpsec.draw LINE2\n"; print "conpersec.label Connection/sec.\n"; print "conpersec.info Connection/sec.\n"; - print "conpersec.draw LINE2\n"; + print "conpersec.draw LINE2\n"; print "reqpcon.label Request/conn.\n"; print "reqpcon.info Request/conn.\n"; - print "reqpcon.draw LINE2\n"; + print "reqpcon.draw LINE2\n"; print "total.label Active connections\n"; print "total.info Active connections\n"; @@ -91,16 +91,16 @@ if ( exists $ARGV[0] and $ARGV[0] eq "config" ) print "reading.label Reading\n"; print "reading.info Reading\n"; - print "reading.draw LINE2\n"; + print "reading.draw LINE2\n"; print "writing.label Writing\n"; print "writing.info Writing\n"; - print "writing.draw LINE2\n"; + print "writing.draw LINE2\n"; print "waiting.label Waiting\n"; print "waiting.info Waiting\n"; - print "waiting.draw LINE2\n"; - + print "waiting.draw LINE2\n"; + exit 0; } @@ -145,11 +145,11 @@ if (defined $tmp2_conpsec && $tmp2_conpsec =~ /^[+-]?\d+$/ && $tmp2_conpsec > 0 $conpersec=$tmp2_conpsec-$tmp1_conpsec; } if (defined $tmp2_reqpsec && $tmp2_reqpsec =~ /^[+-]?\d+$/ && $tmp2_reqpsec > 0){ - $reqpsec=$tmp2_reqpsec-$tmp1_reqpsec; + $reqpsec=$tmp2_reqpsec-$tmp1_reqpsec; } if ($conpersec > 0){ $reqpcon=$reqpsec/$conpersec; -} +} print "reqpsec.value $reqpsec\n"; print "conpersec.value $conpersec\n"; diff --git a/plugins/nginx/nginx_byprojects/README.md b/plugins/nginx/nginx_byprojects/README.md index 7f93095f..0bde3568 100644 --- a/plugins/nginx/nginx_byprojects/README.md +++ b/plugins/nginx/nginx_byprojects/README.md @@ -2,21 +2,21 @@ Those plugins are used to monitor different projects or vhost (i.e. either different log files or using regular expression as filters) on the same web server. ## munin_byprojects_access -Count the number of hits per projects/vhost. +Count the number of hits per projects/vhost. ![byproject_access](https://www.mantor.org/~northox/misc/munin-plugins/nginx_byprojects_access1-month.png "byproject_access") ## munin_byprojects_bandwidth -Count the total bandwidth used by each projects/vhost. [Logtail](https://www.fourmilab.ch/webtools/logtail/) is required. +Count the total bandwidth used by each projects/vhost. [Logtail](https://www.fourmilab.ch/webtools/logtail/) is required. ![byproject_bandwidth](https://www.mantor.org/~northox/misc/munin-plugins/apache_byprojects_bandwidth-month.png "byproject_bandwidth") ## munin_byprojects_inout_bandwidth -Counts the in/out bandwidth used by each projects/vhost. [Logtail](https://www.fourmilab.ch/webtools/logtail/) is required. +Counts the in/out bandwidth used by each projects/vhost. [Logtail](https://www.fourmilab.ch/webtools/logtail/) is required. ![byproject_inout_bandwidth](https://www.mantor.org/~northox/misc/munin-plugins/apache_byprojects_inout_bandwidth-month.png "byproject_inout_bandwidth") ## Installation The setup is pretty straight forward. First you need to configure the plugin: -In your munin plugin configuration file (for example, a new dedicated /etc/munin/plugin-conf.d/nginx_byprojects), configure the plugins : +In your munin plugin configuration file (for example, a new dedicated /etc/munin/plugin-conf.d/nginx_byprojects), configure the plugins: [byprojects_*] env.logtail /usr/local/bin/logtail @@ -35,6 +35,6 @@ Then link the file just as any other plugins. ln -s /usr/local/sbin/ /usr/local/etc/munin/plugins/ And restart the munin-node service. - + ## License MIT diff --git a/plugins/nginx/nginx_byprojects/byprojects_access b/plugins/nginx/nginx_byprojects/byprojects_access index bc400504..f1246b62 100755 --- a/plugins/nginx/nginx_byprojects/byprojects_access +++ b/plugins/nginx/nginx_byprojects/byprojects_access @@ -4,16 +4,16 @@ use JSON qw(decode_json); # # byprojects_access # -# Perl script to monitor access *byprojects* (e.g. vhost) from multiple files +# Perl script to monitor access *byprojects* (e.g. vhost) from multiple files # and/or regex. # -# Danny Fullerton +# Danny Fullerton # Mantor Organization # This work is licensed under a MIT license. # # You need logtail (https://www.fourmilab.ch/webtools/logtail/) # -# Log can be gathered from multiple sources by simply specifying multiple log +# Log can be gathered from multiple sources by simply specifying multiple log # filename or using wildcards (glob). File content can be selected using regex. # # - 'prod' => [ {'path' => '/home/prod/log/access.log'} ], @@ -73,7 +73,7 @@ foreach my $project ( keys %logs ) { my @paths = glob $log->{'path'}; foreach my $path (@paths) { my $state = $statepath.'/'.$project.$x.'_access.state'; - open(LT, "$logtail -f ".$log->{'path'}." -o $state |") or + open(LT, "$logtail -f ".$log->{'path'}." -o $state |") or die "Can't open $logtail: $!"; while () { my $buf = $_; diff --git a/plugins/nginx/nginx_byprojects/byprojects_bandwidth b/plugins/nginx/nginx_byprojects/byprojects_bandwidth index af245e96..52be2ced 100755 --- a/plugins/nginx/nginx_byprojects/byprojects_bandwidth +++ b/plugins/nginx/nginx_byprojects/byprojects_bandwidth @@ -7,19 +7,19 @@ use JSON qw(decode_json); # Perl script to monitor total bandwidth *byprojects* (e.g. vhost) from multiple # files and/or regex. # -# Danny Fullerton +# Danny Fullerton # Mantor Organization # This work is licensed under a MIT license. # # You need logtail (https://www.fourmilab.ch/webtools/logtail/) # -# Your nginx configuration should look like this (i.e. $request_length +# Your nginx configuration should look like this (i.e. $request_length # body_bytes_sent at the end): # log_format main '$remote_addr - $remote_user $time_local "$request" ' # '$status $body_bytes_sent "$http_referer" ' # '"$http_user_agent" $request_length $body_bytes_sent'; # -# Log can be gathered from multiple sources by simply specifying multiple log +# Log can be gathered from multiple sources by simply specifying multiple log # filename or using wildcards (glob). File content can be selected using regex. # # - 'prod' => [ {'path' => '/home/prod/log/access.log'} ], @@ -80,7 +80,7 @@ foreach my $project ( keys %logs ) { my @paths = glob $log->{'path'}; foreach my $path (@paths) { my $state = $statepath.'/'.$project.$x.'_totalbandwidth.state'; - open(LT, "$logtail -f ".$log->{'path'}." -o $state |") or + open(LT, "$logtail -f ".$log->{'path'}." -o $state |") or die "Can't open $logtail : $!"; while () { my $buf = $_; diff --git a/plugins/nginx/nginx_byprojects/byprojects_inout_bandwidth b/plugins/nginx/nginx_byprojects/byprojects_inout_bandwidth index 21b36902..17f0772c 100755 --- a/plugins/nginx/nginx_byprojects/byprojects_inout_bandwidth +++ b/plugins/nginx/nginx_byprojects/byprojects_inout_bandwidth @@ -4,22 +4,22 @@ use JSON qw(decode_json); # # byprojects_inout_bandwidth # -# Perl script to monitor in/out bandwidth *byprojects* (e.g. vhost) from +# Perl script to monitor in/out bandwidth *byprojects* (e.g. vhost) from # multiple files and/or regex. # -# Danny Fullerton +# Danny Fullerton # Mantor Organization # This work is licensed under a MIT license. # # You need logtail (https://www.fourmilab.ch/webtools/logtail/) # -# Your nginx configuration should look like this (i.e. $request_length +# Your nginx configuration should look like this (i.e. $request_length # body_bytes_sent at the end): # log_format main '$remote_addr - $remote_user $time_local "$request" ' # '$status $body_bytes_sent "$http_referer" ' # '"$http_user_agent" $request_length $body_bytes_sent'; # -# Log can be gathered from multiple sources by simply specifying multiple log +# Log can be gathered from multiple sources by simply specifying multiple log # filename or using wildcards (glob). File content can be selected using regex. # # - 'prod' => [ {'path' => '/home/prod/log/access.log'} ], @@ -83,7 +83,7 @@ foreach my $project ( keys %logs ) { my @paths = glob $log->{'path'}; foreach my $path (@paths) { my $state = $statepath.'/'.$project.$x.'_inoutbandwidth.state'; - open(LT, "$logtail -f ".$log->{'path'}." -o $state |") or + open(LT, "$logtail -f ".$log->{'path'}." -o $state |") or die "Can't open $logtail : $!"; while () { my $buf = $_; diff --git a/plugins/nginx/nginx_upstream b/plugins/nginx/nginx_upstream index 5528e9a1..0bca0f8d 100755 --- a/plugins/nginx/nginx_upstream +++ b/plugins/nginx/nginx_upstream @@ -44,7 +44,7 @@ totaltimeforrequests=0 numberofrequests=0 for line in lines: m = rg.search(line) - if m: + if m: word1=m.group(1) c1=m.group(2) float1=m.group(3) diff --git a/plugins/nginx/nginx_vhost_traffic b/plugins/nginx/nginx_vhost_traffic index a467d575..b512dce2 100755 --- a/plugins/nginx/nginx_vhost_traffic +++ b/plugins/nginx/nginx_vhost_traffic @@ -1,7 +1,7 @@ #!/bin/sh # # Script for monitoring nginx Virtual host output traffic -# +# # Requierements: logtail awk # one unique access log file with $bytes_sent value for more accuracy # check http://wiki.nginx.org/NginxHttpLogModule @@ -11,23 +11,23 @@ # # Virtual host list # env.vhosts "example.com example.net example.org" -# +# # Log path # env.logdir = /var/log/nginx -# env.flogfile = access.log +# env.flogfile = access.log # # Position of the $bytes_sent in the access.log file # env.bparam 11 # # Aggregate subdomains -# ex: example.com will match www.example.com, webmail.example.com and *example.com +# ex: example.com will match www.example.com, webmail.example.com and *example.com # BUG: will also match also www.bad-example.com -# env.aggregate true #change to false to disable aggregation +# env.aggregate true #change to false to disable aggregation # # To report bugs, improvements or get updates # see http://github.com/joanpc/nginix_vhost_traffic # -# inspired in postfix_filtered_awk +# inspired in postfix_filtered_awk # Copyright (c) 2010, Joan Perez i Cauhe LOGDIR=${logdir:-/var/log/nginx} @@ -48,8 +48,8 @@ case $1 in echo 'graph_category webserver' i=0 - for vhost in $VHOSTS - do + for vhost in $VHOSTS + do i=$(($i + 1)) echo vhost$i.label $vhost echo vhost$i.type ABSOLUTE @@ -57,7 +57,7 @@ case $1 in echo vhost$i.draw $DRAW DRAW=STACK done - + echo rest.label Rest echo rest.type ABSOLUTE echo rest.cdef rest,8,* @@ -72,16 +72,16 @@ export AGGREGATE # Awk Script $LOGTAIL ${ACCESS_LOG} -o $STATEFILE | awk ' -BEGIN { +BEGIN { split(ENVIRON["VHOSTS"], hosts) for (host in hosts) { track[hosts[host]] = host} -} +} { cn[$2]+=$ENVIRON["BPARAM"] } -END { - for (host in cn) { - if (match(ENVIRON["AGGREGATE"], "true")) { +END { + for (host in cn) { + if (match(ENVIRON["AGGREGATE"], "true")) { found = 0 for (vhost in track) { if (index(host, vhost)) { @@ -93,7 +93,7 @@ END { if (! found) rest+=cn[host] } else { if (host in track) { - res[host] += cn[host] + res[host] += cn[host] } else rest+=cn[host] } } diff --git a/plugins/nova/nova_floating_ips b/plugins/nova/nova_floating_ips index 6b7e95ba..ee04a083 100755 --- a/plugins/nova/nova_floating_ips +++ b/plugins/nova/nova_floating_ips @@ -72,7 +72,7 @@ if __name__ == '__main__': if sys.argv[1] == "config": print_config() elif sys.argv[1] == "autoconf": - if not successful_import: + if not successful_import: print 'no (failed import nova module)' sys.exit(0) else: diff --git a/plugins/nova/nova_instance_ b/plugins/nova/nova_instance_ index d34730b7..b5ffb60c 100755 --- a/plugins/nova/nova_instance_ +++ b/plugins/nova/nova_instance_ @@ -114,7 +114,7 @@ if __name__ == '__main__': elif argv[1] == 'suggest': print_suggest() elif argv[1] == 'autoconf': - if not successful_import: + if not successful_import: print 'no (failed import nova module)' sys.exit(0) else: diff --git a/plugins/nova/nova_instance_launched b/plugins/nova/nova_instance_launched index 2e80c2ce..f2c6fb6d 100755 --- a/plugins/nova/nova_instance_launched +++ b/plugins/nova/nova_instance_launched @@ -52,12 +52,12 @@ if __name__ == '__main__': if sys.argv[1] == "config": print_config() elif sys.argv[1]=="autoconf" : - if not successful_import: + if not successful_import: print 'no (failed import nova module)' sys.exit(0) else: print 'yes' elif successful_import: utils.default_flagfile() - flags.FLAGS(sys.argv) + flags.FLAGS(sys.argv) print_values() diff --git a/plugins/nova/nova_instance_timing b/plugins/nova/nova_instance_timing index 8e59ca0e..de53b909 100755 --- a/plugins/nova/nova_instance_timing +++ b/plugins/nova/nova_instance_timing @@ -64,7 +64,7 @@ if __name__ == '__main__': if sys.argv[1] == "config": print_config() elif sys.argv[1] == "autoconf": - if not successful_import: + if not successful_import: print 'no (failed import nova module)' sys.exit(0) else: diff --git a/plugins/nova/nova_services b/plugins/nova/nova_services index d12823ea..47baa0b1 100755 --- a/plugins/nova/nova_services +++ b/plugins/nova/nova_services @@ -76,7 +76,7 @@ if __name__ == '__main__': if sys.argv[1] == "config": print_config() elif sys.argv[1] == "autoconf": - if not successful_import: + if not successful_import: print 'no (failed import nova module]' else: print 'yes' diff --git a/plugins/nscd/nscd_ b/plugins/nscd/nscd_ index a6e8877b..b8919a55 100755 --- a/plugins/nscd/nscd_ +++ b/plugins/nscd/nscd_ @@ -41,7 +41,7 @@ MODE=$(basename $0 | sed 's/^nscd_//g' | tr '_' '.') case $1 in autoconf) - [ -r "$NSCD_CFG" ] && [ $AUTOCONF_CHECK -gt 0 ] && echo yes || echo "no (nscd config not found or no database enabled)" + [ -r "$NSCD_CFG" ] && [ $AUTOCONF_CHECK -gt 0 ] && echo yes || echo "no (nscd config not found or no database enabled)" exit 0 ;; suggest) diff --git a/plugins/ntp/ntp_kernel_pll_prec b/plugins/ntp/ntp_kernel_pll_prec index 52fbd984..26fe2139 100755 --- a/plugins/ntp/ntp_kernel_pll_prec +++ b/plugins/ntp/ntp_kernel_pll_prec @@ -37,7 +37,7 @@ EOF if [ "$1" = "autoconf" ]; then { ntpq -c kerninfo; ntpdc -c kerninfo; } 2>/dev/null | awk 'BEGIN { ev=1; } - /^precision:/ { ev=0; } + /^precision:/ { ev=0; } END { if (ev == 0) { print "yes";} else { print "no"; } exit ev; }' exit 0 fi diff --git a/plugins/ntp/ntp_kernel_pll_tol b/plugins/ntp/ntp_kernel_pll_tol index 481c8a48..e1d48e6c 100755 --- a/plugins/ntp/ntp_kernel_pll_tol +++ b/plugins/ntp/ntp_kernel_pll_tol @@ -35,9 +35,9 @@ None known EOF if [ "$1" = "autoconf" ]; then - { ntpq -c kerninfo; ntpdc -c kerninfo; } 2>/dev/null | + { ntpq -c kerninfo; ntpdc -c kerninfo; } 2>/dev/null | awk 'BEGIN { ev=1; } - /^frequency tolerance:/ { ev=0; } + /^frequency tolerance:/ { ev=0; } END { if (ev == 0) { print "yes";} else { print "no"; } exit ev; }' exit 0 fi diff --git a/plugins/ntp/ntp_peers b/plugins/ntp/ntp_peers index 174a0c26..3cd798bb 100755 --- a/plugins/ntp/ntp_peers +++ b/plugins/ntp/ntp_peers @@ -39,7 +39,7 @@ # # Change log # v1.0.0 2008-07-21 Chris Hastie -# initial release +# initial release # # v1.1.0 2010-12-07 Uffe Norberg # - Changed default statedir to /var/lib/munin/plugin-state (Debian default) @@ -107,7 +107,7 @@ open(SERVICE, "$COMMAND |") while () { if (/^[-+*#](\d{1,3}\.\d{1,3}\.\d{1,3}\.\d{1,3})(\s+\S+){7}\s+(\S+)/) { my $name = &lookupname($1); - $peers{$1}{'value'} = $3; + $peers{$1}{'value'} = $3; } } close(SERVICE); @@ -140,7 +140,7 @@ foreach my $peer (keys %peers) { # save list of peer IPs and hostnames if(-l $statefile) { die("$statefile is a symbolic link, refusing to touch it."); -} +} open (OUT, ">$statefile") or exit 4; foreach my $i (keys %peers) { print OUT "$i:" . $peers{$i}{'name'} . "\n"; @@ -155,12 +155,12 @@ sub by_name { # create a valid munin field name from the hostname sub sanitize_field () { my $field = shift; - + # replace illegal characters with an underscore $field =~ s/[^A-Za-z0-9_]/_/g; # prepend an underscore if name starts with a number $field =~ s/^([^A-Za-z_])/_$1/; - + # truncate to 19 characters if (length($field) > 19) { $field = substr($field, 0, 19); @@ -181,11 +181,11 @@ sub lookupname () { my $ip = shift; # have we already got it? if ($peers{$ip}{'name'}) { - return $peers{$ip}{'name'}; + return $peers{$ip}{'name'}; } # else look it up - my $iaddr = inet_aton($ip); - my $name = gethostbyaddr($iaddr, AF_INET) || $ip; + my $iaddr = inet_aton($ip); + my $name = gethostbyaddr($iaddr, AF_INET) || $ip; # add to cache $peers{$ip}{'name'} = $name; return $name; diff --git a/plugins/ntp/ntp_peers_ipv6 b/plugins/ntp/ntp_peers_ipv6 index d98701e0..e422f012 100755 --- a/plugins/ntp/ntp_peers_ipv6 +++ b/plugins/ntp/ntp_peers_ipv6 @@ -29,7 +29,7 @@ # # Change log # v1.0.0 2008-07-21 Chris Hastie -# initial release +# initial release # v1.0.1 2009-06-05 Tony Hoyle # ipv6 support. Remove dns lookups. # @@ -75,7 +75,7 @@ open(SERVICE, "$COMMAND |") while () { if(/^\s*\d+\s+(\d+)\s+/) { my ($name, $offset) = &lookupip($1); - $peers{$name} = $offset; + $peers{$name} = $offset; } } close(SERVICE); @@ -106,12 +106,12 @@ foreach my $peer (keys %peers) { # create a valid munin field name from the hostname sub sanitize_field () { my $field = shift; - + # replace illegal characters with an underscore $field =~ s/[^A-Za-z0-9_]/_/g; # prepend an underscore if name starts with a number $field =~ s/^([^A-Za-z_])/_$1/; - + # truncate to 19 characters if (length($field) > 19) { $field = substr($field, 0, 19); diff --git a/plugins/ntp/ntp_pool_score_ b/plugins/ntp/ntp_pool_score_ index 1e5ce7d4..44c2633c 100755 --- a/plugins/ntp/ntp_pool_score_ +++ b/plugins/ntp/ntp_pool_score_ @@ -5,7 +5,7 @@ =head1 NAME -ntp_pool_score_ - Wildcard plugin to monitor the score assigned to a server +ntp_pool_score_ - Wildcard plugin to monitor the score assigned to a server from pool.ntp.org . This is achieved by fetching the cvs data from http://www.pool.ntp.org/scores/IP_ADDRESS/log?limit=1 using wget. @@ -38,7 +38,7 @@ tocho AT tochev DOT net =head1 LICENSE GNU General Public License, version 2 - http://www.gnu.org/licenses/gpl-2.0.html + http://www.gnu.org/licenses/gpl-2.0.html =head1 MAGIC MARKERS diff --git a/plugins/ntp/ntp_queries b/plugins/ntp/ntp_queries index 18a25b22..68c155f8 100755 --- a/plugins/ntp/ntp_queries +++ b/plugins/ntp/ntp_queries @@ -27,7 +27,7 @@ # # Change log # v1.0.0 2009-03-11 Chris Hastie -# initial release +# initial release # # # @@ -86,20 +86,19 @@ while () { } if (/^bad version:\s*(\d*)/) { $queries += $1; - } + } # if (/^access denied:\s*(\d*)/) { # $queries += $1; - # } + # } # if (/^bad length or format:\s*(\d*)/) { # $queries += $1; - # } + # } # if (/^bad authentication:\s*(\d*)/) { # $queries += $1; - # } + # } # if (/^rate exceeded:\s*(\d*)/) { # $queries += $1; - # } - + # } } close(SERVICE); diff --git a/plugins/omreport/omreport_pwrmon_current b/plugins/omreport/omreport_pwrmon_current index b8e8a0cc..af0eb858 100755 --- a/plugins/omreport/omreport_pwrmon_current +++ b/plugins/omreport/omreport_pwrmon_current @@ -2,7 +2,7 @@ # # Copyright (C) 2009 Andrew Chadwick, University of Oxford # Based on work by Rackspace US, Inc. , (C) 2008. -# +# # 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; version 2 dated June, diff --git a/plugins/omreport/omreport_pwrmon_power b/plugins/omreport/omreport_pwrmon_power index c5c2ddbe..a58ec270 100755 --- a/plugins/omreport/omreport_pwrmon_power +++ b/plugins/omreport/omreport_pwrmon_power @@ -2,7 +2,7 @@ # # Copyright (C) 2009 Andrew Chadwick, University of Oxford # Based on work by Rackspace US, Inc. , (C) 2008. -# +# # 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; version 2 dated June, diff --git a/plugins/omreport/omreport_storage_temp b/plugins/omreport/omreport_storage_temp index 0c8be449..ca67cc71 100755 --- a/plugins/omreport/omreport_storage_temp +++ b/plugins/omreport/omreport_storage_temp @@ -2,7 +2,7 @@ # # Copyright (C) 2009 Andrew Chadwick, University of Oxford # Based on work by Rackspace US, Inc. , (C) 2008. -# +# # 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; version 2 dated June, diff --git a/plugins/omreport/omreport_temp b/plugins/omreport/omreport_temp index f7bcb3f9..01eeee16 100755 --- a/plugins/omreport/omreport_temp +++ b/plugins/omreport/omreport_temp @@ -14,11 +14,11 @@ # # You should have received a copy of the GNU General Public License # along with this program; if not, see http://www.gnu.org/licenses/gpl.txt -# +# # # This plugin will graph the chassis temp sensors on a Dell PowerEdge Server # via the omreport tool. It has been tested on the following chassis: -# +# # PE2650/6650 # PE2850/6850 # PE2950 diff --git a/plugins/openvz/openvz-load-avg b/plugins/openvz/openvz-load-avg index 77dbcb42..c624ad85 100755 --- a/plugins/openvz/openvz-load-avg +++ b/plugins/openvz/openvz-load-avg @@ -1,12 +1,12 @@ #!/usr/bin/perl -# +# # Copyright (c) 2008, Maxime Besson # Copyright (c) 2011, David Bernard -# +# # Permission to use, copy, modify, and/or distribute this software for any # purpose with or without fee is hereby granted, provided that the above # copyright notice and this permission notice appear in all copies. -# +# # THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES # WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF # MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR @@ -15,7 +15,7 @@ # ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF # OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. # -# +# # Graph VE load averages on an OpenVZ server # # This plugin needs root privileges to call vzlist, so add this : @@ -62,7 +62,7 @@ if ( $arg eq "autoconf" ) { # Dynamic config my @result=`/usr/sbin/vzlist -H -a -s veid -o veid,name`; my $A=0; # draw an area only under the first line - + for (@result ) { ( my $veid,my $label ) = /^\s*(\d+)\s*([\w\-]+)\s*$/ ; my $name = $label; diff --git a/plugins/openvz/vpsmem b/plugins/openvz/vpsmem index c9d9d789..dc3aad03 100755 --- a/plugins/openvz/vpsmem +++ b/plugins/openvz/vpsmem @@ -2,7 +2,7 @@ # # Monitors memory usage in openVZ or Virtuozzo # based on http://www.huschi.net/archiv/speicher-anzeigen-mit-vzfree.html -# Author: Michael Richter, http://osor.de/ +# Author: Michael Richter, http://osor.de/ # Cleaned up and translated to english by: Marian Sigler , 2010-08-13 # #%# capabilities=autoconf diff --git a/plugins/openwrt/snmp__memory_openwrt b/plugins/openwrt/snmp__memory_openwrt index af496ec0..2be0186e 100755 --- a/plugins/openwrt/snmp__memory_openwrt +++ b/plugins/openwrt/snmp__memory_openwrt @@ -72,7 +72,7 @@ if (defined $ARGV[0] and $ARGV[0] eq "config") { print "host_name $host\n" unless ($host eq 'localhost'); print <<'EOC'; graph_title Memory usage -graph_args --base 1000 -l 0 +graph_args --base 1000 -l 0 graph_vlabel kB graph_category memory graph_info This graph shows total and used memory on the host. diff --git a/plugins/oracle/oracle-pga-monitor b/plugins/oracle/oracle-pga-monitor index bc723a0f..b7fd0915 100755 --- a/plugins/oracle/oracle-pga-monitor +++ b/plugins/oracle/oracle-pga-monitor @@ -7,18 +7,18 @@ # Version: 1.0 # # This program is free software; you can redistribute it and/or modify -# it under the terms of the GNU General Public License version 2 +# it under the terms of the GNU General Public License version 2 # as published by the Free Software Foundation. -# +# # 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 Street, Fifth Floor, Boston, MA 02110-1301 USA. -# +# # # Prerequistes: # 1) env.ORACLE_HOME set in munin-node @@ -44,7 +44,7 @@ # dbport : port used by the monitored instance (notice: numeric value) # dbname : database to be monitored # dbhost : host or ip address of db instance -# +# # #%# family=auto #%# capabilities=autoconf @@ -72,7 +72,7 @@ end # # Queries # -pga_target_query = "SELECT TO_CHAR(ROUND(decode(unit,'bytes',(value)/(1024*1024),value),2)) pga_target +pga_target_query = "SELECT TO_CHAR(ROUND(decode(unit,'bytes',(value)/(1024*1024),value),2)) pga_target from V$PGASTAT where name = 'aggregate PGA target parameter'" pga_query = "SELECT TO_CHAR(ROUND(decode(unit,'bytes',(value)/(1024*1024),value),2)) pga @@ -97,7 +97,7 @@ if ARGV[0] == "autoconf" # config definition # elsif ARGV[0] == "config" - puts "graph_args --base 1024k -r --lower-limit 0" + puts "graph_args --base 1024k -r --lower-limit 0" puts "graph_title Oracle PGA from #{dbname}" puts "graph_category db" puts "graph_info This graph shows the PGA memory usage (in MB)" diff --git a/plugins/oracle/oracle-sga b/plugins/oracle/oracle-sga index dddbdc04..a00ceeb1 100755 --- a/plugins/oracle/oracle-sga +++ b/plugins/oracle/oracle-sga @@ -7,18 +7,18 @@ # Version: 1.0 # # This program is free software; you can redistribute it and/or modify -# it under the terms of the GNU General Public License version 2 +# it under the terms of the GNU General Public License version 2 # as published by the Free Software Foundation. -# +# # 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 Street, Fifth Floor, Boston, MA 02110-1301 USA. -# +# # # Prerequistes: # 1) env.ORACLE_HOME set in munin-node @@ -43,7 +43,7 @@ # dbport : port used by the monitored instance (notice: numeric value) # dbname : database to be monitored # dbhost : host or ip address of db instance -# +# # #%# family=auto #%# capabilities=autoconf @@ -71,7 +71,7 @@ end # # Queries # -shared_pool_query = "SELECT TO_CHAR(ROUND(SUM(decode(pool, 'shared pool', +shared_pool_query = "SELECT TO_CHAR(ROUND(SUM(decode(pool, 'shared pool', decode(name, 'library cache',0, 'dictionary chace',0, 'free memory',0, @@ -96,7 +96,7 @@ large_pool_query = "SELECT TO_CHAR(ROUND(SUM(decode(pool, 'large pool', (bytes)/ log_buffer_query = "SELECT TO_CHAR(ROUND(SUM(decode(pool, NULL, decode(name, 'log_buffer', (bytes)/(1024*1024),0),0)),2)) sga_lbuffer - from V$SGASTAT" + from V$SGASTAT" memory_components = { "fixed_area" => fixed_area_query, @@ -122,7 +122,7 @@ if ARGV[0] == "autoconf" # config definition # elsif ARGV[0] == "config" - puts "graph_args --base 1024k -r --lower-limit 0" + puts "graph_args --base 1024k -r --lower-limit 0" puts "graph_title Oracle SGA from #{dbname}" puts "graph_category db" puts "graph_info This graph shows the SGA memory usage (in MB)" @@ -138,7 +138,7 @@ elsif ARGV[0] == "config" # make sure fixed_area is at the bottom of the stack if ( m == 'fixed_area' ) puts "#{m}.draw AREA" - else + else puts "#{m}.draw STACK" end end diff --git a/plugins/oracle/oracle__connections b/plugins/oracle/oracle__connections index 5119e840..a96b3b23 100755 --- a/plugins/oracle/oracle__connections +++ b/plugins/oracle/oracle__connections @@ -30,7 +30,7 @@ # 'oracle'. Anyway, Munin must be told which user # this plugin should be run as. # dbpass - The corresponding password, if -# applicable. Default to undef. +# applicable. Default to undef. # # showusers - If set to 1 show usernames and num. of connections. # Default is not show users (0). @@ -137,9 +137,9 @@ if ( $showusers ) { $sth->execute(); my $total = 0; while ( my ($datname,$curr_conn) = $sth->fetchrow_array ) { - print "$datname.value $curr_conn\n"; + print "$datname.value $curr_conn\n"; $total = $total+$curr_conn; - } + } print "total.value $total\n"; } else { my $sql = "select count(username) from v\$session where username is not null"; diff --git a/plugins/oracle/oracle_connections b/plugins/oracle/oracle_connections index a05f5d8c..587b34f8 100755 --- a/plugins/oracle/oracle_connections +++ b/plugins/oracle/oracle_connections @@ -25,7 +25,7 @@ # 'oracle'. Anyway, Munin must be told which user # this plugin should be run as. # oracle_pass - The corresponding password, if -# applicable. Default to undef. +# applicable. Default to undef. # # SHOW_ORACLE_USERS - If set to 1 show usernames and num. of connections. # Default is not show users (0). @@ -119,21 +119,21 @@ EOF` set pagesize 0 select username, count(username) from v\$session where username is not null group by username; EOF - echo $WARN_CRIT| awk '{ print "total.warning " $1 "\ntotal.critical " $2 }' + echo $WARN_CRIT| awk '{ print "total.warning " $1 "\ntotal.critical " $2 }' else echo "connections.label active connections" echo "connections.info active connections" echo "connections.type GAUGE" - echo $WARN_CRIT| awk '{ print "connections.warning " $1 "\nconnections.critical " $2 }' + echo $WARN_CRIT| awk '{ print "connections.warning " $1 "\nconnections.critical " $2 }' fi fi -if [ $SHOW_ORACLE_USERS -eq 1 ] +if [ $SHOW_ORACLE_USERS -eq 1 ] then sqlplus -s ${oracle_user}/${oracle_pass}@$ORACLE_SID << EOF | \ grep -v '^$'|awk 'BEGIN { total=0 } { - print $1 ".value " $2 + print $1 ".value " $2 total=total+$2 } END { print "total.value " total }' set pagesize 0 select username, count(username) from v\$session where username is not null group by username; @@ -145,7 +145,7 @@ set pagesize 0 select count(username) from v\$session where username is not null; EOF fi - + echo "max_connections.value" "`sqlplus -s ${oracle_user}/${oracle_pass}@$ORACLE_SID << EOF | \ grep -v '^$' | awk '{print $1 }' set pagesize 0 diff --git a/plugins/oracle/oracle_sysstat b/plugins/oracle/oracle_sysstat index 85ddd1f9..1ea0526a 100755 --- a/plugins/oracle/oracle_sysstat +++ b/plugins/oracle/oracle_sysstat @@ -84,7 +84,7 @@ default: asmusage Module name(s) to exclude seperated by white-space. - By default, asmusage module is excluded because another privilege + By default, asmusage module is excluded because another privilege is necessary to connect ASM instance. env.include_module: @@ -92,21 +92,21 @@ default: none Module name(s) to include seperated by white-space. - If both include_module and exclude_module are set, exclude will be + If both include_module and exclude_module are set, exclude will be ignored. - env.plugin_name: + env.plugin_name: example: env.plugin_name oracle_sysstat_2 default: program name (usually oracle_sysstat) - Used for internal graph name. + Used for internal graph name. It will be useful to monitor multi-instance databases. - env.db_name: + env.db_name: example: env.db_name dbname default: none - Used for graph title. + Used for graph title. It will be useful to monitor multi-instance databases. =head1 NOTES @@ -133,7 +133,7 @@ . "${MUNIN_LIBDIR:-}/plugins/plugin.sh" is_multigraph "$@" -# Like perl 'use strict;' +# Like perl 'use strict;' set -o nounset # Global variables @@ -661,7 +661,7 @@ sqlplus_variables=" set numwidth 30 " -# Functions +# Functions autoconf() { if which sqlplus >/dev/null ; then @@ -688,7 +688,7 @@ fetch() { do_config() { local label_max_length=45 local field type draw label - local fields= + local fields= getfield echo "multigraph ${plugin_name}_${module}" @@ -697,7 +697,7 @@ do_config() { echo "${global_attrs[$module]}" | sed -e 's/^ *//' -e '/^$/d' # print data source attributes - # split line into field,type,draw,label + # split line into field,type,draw,label while read -r field type draw label do [ -z "$field" ] && continue @@ -731,7 +731,7 @@ module_list() { echo "$include_module" else for i in $exclude_module - do + do # remove excluded modules unset -v "global_attrs[$i]" done @@ -768,8 +768,8 @@ getvalue_sysstat() { echo "${sqlplus_variables} VAR vf VARCHAR2(64) VAR vl VARCHAR2(64) - EXEC :vf := '${field}' - EXEC :vl := '${label}' + EXEC :vf := '${field}' + EXEC :vl := '${label}' SELECT :vf || '.value ' || value FROM @@ -789,8 +789,8 @@ getvalue_sgainfo() { echo "${sqlplus_variables} VAR vf VARCHAR2(64) VAR vl VARCHAR2(64) - EXEC :vf := '${field}' - EXEC :vl := '${label}' + EXEC :vf := '${field}' + EXEC :vl := '${label}' SELECT :vf || '.value ' || bytes FROM @@ -810,8 +810,8 @@ getvalue_pgastat() { echo "${sqlplus_variables} VAR vf VARCHAR2(64) VAR vl VARCHAR2(64) - EXEC :vf := '${field}' - EXEC :vl := '${label}' + EXEC :vf := '${field}' + EXEC :vl := '${label}' SELECT :vf || '.value ' || value FROM @@ -831,8 +831,8 @@ getvalue_cputime() { echo "${sqlplus_variables} VAR vf VARCHAR2(64) VAR vl VARCHAR2(64) - EXEC :vf := '${field}' - EXEC :vl := '${label}' + EXEC :vf := '${field}' + EXEC :vl := '${label}' SELECT :vf || '.value ' || ROUND( value / 1000000 ) FROM @@ -853,11 +853,11 @@ FROM WHERE name = 'physical reads cache' ; -SELECT +SELECT 'buf_logical.value ' || ( sd.value + sc.value ) -FROM - v\$sysstat sd, v\$sysstat sc -WHERE +FROM + v\$sysstat sd, v\$sysstat sc +WHERE sd.name = 'db block gets from cache' AND sc.name = 'consistent gets from cache' ; SELECT 'lib_pins.value ' || SUM(pins) FROM v\$librarycache; @@ -892,7 +892,7 @@ ${sqlplus_variables} SELECT REGEXP_REPLACE( du.username, '^[^A-Za-z_]|[^A-Za-z0-9_]', '_' ) || '.value ' || count(vs.username) -FROM +FROM ( SELECT username FROM @@ -952,7 +952,7 @@ FROM ) en LEFT JOIN v\$session se ON - en.wait_class = se.wait_class AND + en.wait_class = se.wait_class AND se.username is not null AND se.wait_time = 0 GROUP BY @@ -1010,12 +1010,12 @@ getfield_eventwait2() { data_attrs[$module]=$( ${sqlplus} "${oracle_auth}" < GPLv2 =head1 MAGIC MARKERS - + #%# family=auto #%# capabilities=autoconf suggest @@ -193,8 +193,8 @@ $graphs{udp4} = { =head2 Config Check This block of code looks at the argument that is possibly supplied, - should it be config, it then checks to make sure the plugin - specified exists, assuming it does, it will run the do_config + should it be config, it then checks to make sure the plugin + specified exists, assuming it does, it will run the do_config subroutine for the plugin specified, otherwise it dies complaining about an unknown plugin. @@ -313,7 +313,7 @@ sub print_output { This subroutine prints out the main config information for all of the graphs. It takes one parameters, $plugin - $plugin; graph being called up to print config for + $plugin; graph being called up to print config for Example: print_config($plugin); diff --git a/plugins/other/pid b/plugins/other/pid index 09e2c2b0..f1381a5a 100755 --- a/plugins/other/pid +++ b/plugins/other/pid @@ -8,7 +8,7 @@ GRAPH="pid" SECTION="system" run_autoconf() { - echo yes + echo yes } run_config() { diff --git a/plugins/other/port_ b/plugins/other/port_ index 7249cbac..32f70ab2 100755 --- a/plugins/other/port_ +++ b/plugins/other/port_ @@ -55,7 +55,7 @@ class PortMonit < Munin::Plugin :type => :GAUGE, :min => 0 def retrieve_values - + @_netstat = %x[netstat -n -P tcp | egrep "\.#{PORT} "].split( "\n" ) @@ -73,7 +73,7 @@ class PortMonit < Munin::Plugin @_result = 0 source.each { |obj| @_result += 1 if obj.match( regex ) } - + return @_result end end diff --git a/plugins/other/proc_ b/plugins/other/proc_ index 6577bdb6..473da807 100755 --- a/plugins/other/proc_ +++ b/plugins/other/proc_ @@ -1,4 +1,4 @@ -#!/usr/bin/perl +#!/usr/bin/perl # -*- perl -*- # # proc_ - Munin plugin to for Process information @@ -7,17 +7,17 @@ # # Author: Kristian Lyngstøl # Author: Trygve Vea -# +# # 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 Street, Fifth Floor, Boston, MA 02110-1301 USA. @@ -39,7 +39,7 @@ The configuration section shows the defaults env.procname init env.category Process Info -env.procname defines the processname as seen inside the parenthesis of the +env.procname defines the processname as seen inside the parenthesis of the second column in /proc/pid/stat. If you don't get the data you expect, you can check if the value is what you expect here. @@ -121,15 +121,15 @@ my @field_parameters = ('graph', 'min', 'max', 'draw', 'cdef', 'warning', 'colour', 'info', 'type'); # Data structure that defines all possible graphs (aspects) and how they # are to be plotted. Every top-level entry is a graph/aspect. Each top-level graph -# MUST have title set and 'values'. -# +# MUST have title set and 'values'. +# # Graphs with 'DEBUG' set to anything is omitted from 'suggest'. -# +# # 'rpn' on values allows easy access to graphs consisting of multiple # values from procstats. (Reverse polish notation). The RPN # implementation only accepts +-*/ and procstats-values. # -# Any value left undefined will be left up to Munin to define/ignore/yell +# Any value left undefined will be left up to Munin to define/ignore/yell # about. # # See munin documentation or rrdgraph/rrdtool for more information. @@ -258,7 +258,7 @@ sub autoconf exit 0; } -# Suggest relevant aspects/values of $self. +# Suggest relevant aspects/values of $self. # 'DEBUG'-graphs are excluded. sub suggest { @@ -292,7 +292,7 @@ sub print_if_exist } # Walk through the relevant aspect and print all top-level configuration -# values and value-definitions. +# values and value-definitions. sub get_config { my $graph = $_[0]; @@ -328,7 +328,7 @@ sub get_config } } -# Read and verify the aspect ($self). +# Read and verify the aspect ($self). sub set_aspect { $self = $0; diff --git a/plugins/other/s9y b/plugins/other/s9y index f66b688e..a3b75b24 100755 --- a/plugins/other/s9y +++ b/plugins/other/s9y @@ -1,8 +1,8 @@ #!/bin/bash -# $Id: s9y 7 2010-02-24 22:15:37Z root $ +# $Id: s9y 7 2010-02-24 22:15:37Z root $ # $Rev: 7 $ # $Author: root $ -# $Date: 2010-02-24 23:15:37 +0100 (Mi, 24. Feb 2010) $ +# $Date: 2010-02-24 23:15:37 +0100 (Mi, 24. Feb 2010) $ # # : < -# for FreeBSD systems. Ported and splitted by the +# for FreeBSD systems. Ported and splitted by the # immerda admin team admin(at)immerda.ch # this version is adapted for openbsd and is only tested on # openbsd systems. diff --git a/plugins/pf/pf_openbsd b/plugins/pf/pf_openbsd index 03160e14..0d7c1680 100755 --- a/plugins/pf/pf_openbsd +++ b/plugins/pf/pf_openbsd @@ -2,7 +2,7 @@ # # OpenBSD's pf(4) monitoring for OpenBSD # 2007, Originally by Gergely Czuczy -# for FreeBSD systems. Ported and splitted by the +# for FreeBSD systems. Ported and splitted by the # immerda admin team admin(at)immerda.ch # this version is adapted for openbsd and is only tested on # openbsd systems. diff --git a/plugins/pf/pf_packets b/plugins/pf/pf_packets index 7995aee6..117fe0a5 100755 --- a/plugins/pf/pf_packets +++ b/plugins/pf/pf_packets @@ -2,7 +2,7 @@ # # OpenBSD's pf(4) monitoring for OpenBSD # 2007, Originally by Gergely Czuczy -# for FreeBSD systems. Ported and splitted by the +# for FreeBSD systems. Ported and splitted by the # immerda admin team admin(at)immerda.ch # this version is adapted for openbsd and is only tested on # openbsd systems. diff --git a/plugins/pf/pf_states b/plugins/pf/pf_states index 5e57ea60..762b2c03 100755 --- a/plugins/pf/pf_states +++ b/plugins/pf/pf_states @@ -2,7 +2,7 @@ # # OpenBSD's pf(4) monitoring for OpenBSD # 2007, Originally by Gergely Czuczy -# for FreeBSD systems. Ported and splitted by the +# for FreeBSD systems. Ported and splitted by the # immerda admin team admin(at)immerda.ch # this version is adapted for openbsd and is only tested on # openbsd systems. diff --git a/plugins/php/eaccelerator b/plugins/php/eaccelerator index 9a9fcbc7..f4f8e111 100755 --- a/plugins/php/eaccelerator +++ b/plugins/php/eaccelerator @@ -18,8 +18,8 @@ # - php file placed on web server , paste there below code (strip hash files first) # # 0,"memoryAvailable"=>0,"memoryAllocated"=>0,"cachedScripts"=>0,"removedScripts"=>0,"cachedKeys"=>0); # if(!function_exists("eaccelerator_info")) # $info = $keys; @@ -35,7 +35,7 @@ # http://localhost/eaccelerator_status.php # if you see the plain text with values then its working ok! # if you see the plain text and all values are zero then probalby eaccelerator is not enabled. -# - installed wget +# - installed wget # ################################################################# # @@ -53,8 +53,8 @@ WGET_FLAGS="-Yoff"; # refer to wget manual, you may set extra parameters like di # Changelog # # Revision 0.1 Tue 03 Feb 2009 02:16:02 PM CET _KaszpiR_ -# - initial release, -# +# - initial release, +# ################################################################# @@ -79,7 +79,7 @@ if [ "$1" = "config" ]; then echo 'graph_args -l 0' echo 'graph_category webserver' echo 'graph_info This graph shows performance of the eaccelerator module on WWW server.' - + echo 'memorysize.label total' echo 'memorysize.draw AREA' echo 'memorysize.min 0' @@ -91,7 +91,7 @@ if [ "$1" = "config" ]; then # echo "memoryallocated.warning 92" # echo "memoryallocated.critical 98" echo 'memoryallocated.info Memory allocated .' - + echo 'memoryavailable.label available' echo 'memoryavailable.min 0' echo 'memoryavailable.info Memory available .' diff --git a/plugins/php/eaccelerator-python b/plugins/php/eaccelerator-python index dc2bad21..098f204f 100755 --- a/plugins/php/eaccelerator-python +++ b/plugins/php/eaccelerator-python @@ -2,7 +2,7 @@ ''' Plugin to monitor performance of eaccelerator module for PHP. -To use: +To use: 1. Copy script to munin plugins folder 2. Symbolically link to eacc_memory and eacc_cached * eacc_memory shows memory usage @@ -33,27 +33,27 @@ config = { 'graph_info This graph shows memory performance of PHP eaccelerator module\n' + 'graphs_args -1 0\n' + 'graph_category webserver\n' + - + 'memorysize.label total\n' + 'memorysize.draw AREA\n' + 'memorysize.min 0\n' + 'memorysize.info Total memory\n' + - + 'memoryallocated.label allocated\n' + 'memoryallocated.draw LINE1\n' + 'memoryallocated.min 0\n' + 'memoryallocated.info Memory allocated', - 'cached': + 'cached': 'graph_title eacceleratory cached scripts\n' + 'graph_info This graph shows how many scripts are cached by PHP eaccelerator module\n' + 'graphs_args -1 0\n' + 'graph_category webserver\n' + - + 'cachedscripts.label cached scripts\n' + 'cachedscripts.draw LINE1\n' + 'cachedscripts.min 0\n' + 'cachedscripts.info Cached scripts\n' + - + 'removedscripts.label removed scripts\n' + 'removedscripts.draw LINE1\n' + 'removedscripts.min 0\n' + @@ -68,16 +68,16 @@ def get_stats(): if 'auth_user' in os.environ and 'auth_pwd' in os.environ: fetcher.add_credentials(os.environ['auth_user'], os.environ['auth_pwd']) resp, content = fetcher.request(os.environ["cpanel"]) - + if resp['status'] != '200': content = '0 0 0 0' - + bits = content.split(' ') return {'memorysize': bits[0], 'memoryallocated': bits[1], 'cachedscripts': bits[2], 'removedscripts': bits[3]} def print_stats(command): stats = get_stats() - + for var in command_vars[command]: print "%s.value %s" % (var, stats[var]) @@ -87,19 +87,19 @@ if __name__ == "__main__": except ImportError: print "httplib2 not found" sys.exit(1) - + if os.environ['cpanel'] == '': print "env.cpanel not defined in munin config" sys.exit() underscore = sys.argv[0].find('_') - + if underscore == -1: print "Symbolically link this file to eacc_memory or eacc_cached" sys.exit(1) else: command = sys.argv[0][underscore+1:] - + if len(sys.argv) > 1 and sys.argv[1] != '': if sys.argv[1] == 'config': print_config(command) diff --git a/plugins/php/eaccelerator-usage b/plugins/php/eaccelerator-usage index f95a19d1..090c5256 100755 --- a/plugins/php/eaccelerator-usage +++ b/plugins/php/eaccelerator-usage @@ -89,7 +89,7 @@ if ($resp->is_success) { print "cached.value $v\n" if $b =~ /cached/i; print "removed.value $v\n" if $b =~ /removed/i; print "keys.value $v\n" if $b =~ /keys/i; - + } $b = $_; } diff --git a/plugins/php/php5-fpm_status b/plugins/php/php5-fpm_status index 73cc92c4..8af29db8 100755 --- a/plugins/php/php5-fpm_status +++ b/plugins/php/php5-fpm_status @@ -3,7 +3,7 @@ # Plugin to monitor php5-fpm process manager, php5-fpm 5.3.3 is required # 20100726 21:15:39 radar AT aol DOT pl # modified by Daniel Caillibaud on 20110926 -# +# # /etc/php5/fpm/php5-fpm.conf: # # pm.status_path = /fpm-status diff --git a/plugins/php/php_apc_ b/plugins/php/php_apc_ index f0824171..82c00177 100755 --- a/plugins/php/php_apc_ +++ b/plugins/php/php_apc_ @@ -2,7 +2,7 @@ ################################################################# # # Script to monitor apc usage -# +# ################################################################# # # Parameters understood: config, autoconf and suggest @@ -10,9 +10,9 @@ ################################################################# # # Configuration section -# +# # Configuration example -# +# # [php_apc_*] # user root # env.URL http://localhost/php_apc.php # URL to fetch APC status @@ -30,7 +30,7 @@ #%# family=auto #%# capabilities=autoconf suggest -# URL to the script to check APC status (defaults to +# URL to the script to check APC status (defaults to # 'http://localhost/php_apc.php' if not configured) URL=${URL:-'http://localhost/php_apc.php'} diff --git a/plugins/php/php_eaccelerator b/plugins/php/php_eaccelerator index 34edc549..7c08adda 100755 --- a/plugins/php/php_eaccelerator +++ b/plugins/php/php_eaccelerator @@ -1,6 +1,6 @@ #!/usr/bin/env ruby -# Monitor your EAccelerator usage. +# Monitor your EAccelerator usage. # Requires: ruby # Mandatory Parameters @@ -35,11 +35,11 @@ if ARGV[0]=="config" print "EAccelerator Monitoring\n" print "graph_title PHP Eaccelerator\n" print "graph_category webserver\n" - print "Memoryusagepercentage.label Memory Usage %\n" - print "Memoryusagepercentage.warning 95\n" - print "Memoryusagepercentage.critical 95\n" - print "Memoryusage.label Memory Usage MB\n" - print "Memorymax.label Cache Size MB\n" + print "Memoryusagepercentage.label Memory Usage %\n" + print "Memoryusagepercentage.warning 95\n" + print "Memoryusagepercentage.critical 95\n" + print "Memoryusage.label Memory Usage MB\n" + print "Memorymax.label Cache Size MB\n" print "Freememory.label Free Memory MB\n" print "Cachedscripts.label Cached Scripts\n" print "Removedscripts.label Removed Scripts\n" diff --git a/plugins/php/php_errors_ b/plugins/php/php_errors_ index dd073a58..fd4f43fe 100755 --- a/plugins/php/php_errors_ +++ b/plugins/php/php_errors_ @@ -30,8 +30,8 @@ Revision 0.1 2011/06/17 12:00:00 Ulrich Lusseau . $MUNIN_LIBDIR/plugins/plugin.sh LOGS=${logfile:-/var/log/apache2/error.log} - - + + if [[ $1 == autoconf ]]; then for LOG in $LOGS; do if [[ ! -r $LOGS ]]; then @@ -43,7 +43,7 @@ if [[ $1 == autoconf ]]; then echo yes exit 0 fi - + if [[ $1 == config ]]; then echo 'graph_title PHP Errors from ' $LOGS echo 'graph_args --base 1000 -l 0' diff --git a/plugins/php/php_opcache.php b/plugins/php/php_opcache.php index a4437a35..b45a0c14 100755 --- a/plugins/php/php_opcache.php +++ b/plugins/php/php_opcache.php @@ -3,7 +3,7 @@ * Part of Munin PHP OPcache plugin - Refer to php_opcache for installation instructions. */ -if (function_exists('opcache_get_status')) +if (function_exists('opcache_get_status')) { $data = opcache_get_status(false); $output = array( diff --git a/plugins/php/php_time_execution b/plugins/php/php_time_execution index bae1252f..431754c6 100755 --- a/plugins/php/php_time_execution +++ b/plugins/php/php_time_execution @@ -31,12 +31,12 @@ #env.sitename mon-code #env.nbrpage 10 # - + LOG=${logfile:-/var/log/apache2/access.log} NAME=${sitename:undefined} NBRPAGE=${nbrpage} - - + + if [ "$1" = "autoconf" ]; then if [ -r "$LOG" ]; then echo yes @@ -46,13 +46,13 @@ if [ "$1" = "autoconf" ]; then exit 1 fi fi - + if [ "$1" = "config" ]; then - + echo 'graph_title Time to generate PHP page ' $NAME 'v2' echo 'graph_args --base 1000 -l 0' echo 'graph_vlabel Time in microsecond' - + echo "graph_category webserver" echo "graph_info This graph shows load time in ms of $target" echo "minloadtime.label Min time" @@ -61,9 +61,9 @@ if [ "$1" = "config" ]; then echo "avgloadtime.info Avg time" echo "maxloadtime.label Max time" echo "maxloadtime.info Max time" - + exit 0 fi - + awk '($4 ~ /[0-9]+\/[0-9]+/ && $8 !~ /\.(jpg|JPG|jpeg|JPEG|gif|GIF|png|PNG|txt|TXT|css|CSS|js|JS|zip|ZIP|bmp|BMP)$/)' $LOG | sed -e :a -e '$q;N;'$NBRPAGE',$D;ba' | awk '{print $4}' | awk -F\/ ' MIN=="" || $2 < MIN {MIN=$2} MAX=="" || $2 > MAX {MAX=$2} {SUM += $2} END {print "minloadtime.value ",MIN/1000,"\navgloadtime.value ",SUM/(NR*1000),"\nmaxloadtime.value ",MAX/1000}' - + diff --git a/plugins/php/php_xcache b/plugins/php/php_xcache index 148ad864..bfa3cc38 100755 --- a/plugins/php/php_xcache +++ b/plugins/php/php_xcache @@ -7,7 +7,7 @@ require LWP::UserAgent; # # Installation / Configuration # -# - place munin_xcache.php in a directory on your webserver +# - place munin_xcache.php in a directory on your webserver # - add the url config to plugin-conf.d/munin-node # # diff --git a/plugins/ping/fping_ b/plugins/ping/fping_ index 2c7efd4a..f7c66d80 100755 --- a/plugins/ping/fping_ +++ b/plugins/ping/fping_ @@ -4,7 +4,7 @@ # Author : Thomas VIAL # Author URL : http://tvi.al # Usage : ln -s /path/to/fping_ /etc/munin/plugins/fping_www.google.com -# Explanation : Will graph connection to www.google.com +# Explanation : Will graph connection to www.google.com # Requirements : # * fping # @@ -47,5 +47,5 @@ if [ $status -eq 0 ]; then else # Failure echo "success.value 0" - echo "failure.value 100" + echo "failure.value 100" fi diff --git a/plugins/ping/multi_tcp_ping b/plugins/ping/multi_tcp_ping index 1ab779a4..cd07de4e 100755 --- a/plugins/ping/multi_tcp_ping +++ b/plugins/ping/multi_tcp_ping @@ -91,7 +91,7 @@ $cmd_arg = $ARGV[0] || ''; config() if($cmd_arg eq "config"); autoconf() if ($cmd_arg eq 'autoconf'); -for my $host (@hosts) { +for my $host (@hosts) { threads->new(\&ping_host, $host) } diff --git a/plugins/ping/multiping b/plugins/ping/multiping index 1fb56458..a6f9bfa3 100755 --- a/plugins/ping/multiping +++ b/plugins/ping/multiping @@ -82,7 +82,7 @@ if ((exists $ARGV[0]) && ($ARGV[0] eq "config")) { print "graph_category network\n"; print "graph_info This graph shows ping RTT statistics.\n"; for (my $site=1; $site<=$#hosts+1; $site++) { - my $item = lc($hosts[$site-1]); + my $item = lc($hosts[$site-1]); $item =~ s/\.//g; print "$item.label $names[$site-1]\n"; print "$item.info Ping RTT statistics for $hosts[$site-1].\n"; @@ -94,7 +94,7 @@ if ((exists $ARGV[0]) && ($ARGV[0] eq "config")) { } for (my $site=1; $site<=$#hosts+1; $site++) { - my $item = lc($hosts[$site-1]); + my $item = lc($hosts[$site-1]); $item =~ s/\.//g; my $host = $hosts[$site-1]; my @ping = `$ping_cmd $ping_args $host $ping_args2`; diff --git a/plugins/ping/ping-with-ceil b/plugins/ping/ping-with-ceil index 5735e10a..d9f10c05 100755 --- a/plugins/ping/ping-with-ceil +++ b/plugins/ping/ping-with-ceil @@ -16,7 +16,7 @@ # along with this program; if not, write to the Free Software # Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. # -# Python (2.5+) version of the plugin to monitor ping times. +# Python (2.5+) version of the plugin to monitor ping times. # Evolution from the standard shipped with munin by adding a ceil. # # Thanks to "Jimmy Olsen" for the base. @@ -82,5 +82,5 @@ for line in out.split("\n"): print "ping.value", "%.6f" % (v / 1000) EOF -) | python +) | python diff --git a/plugins/poseidon/snmp__poseidon-sensors b/plugins/poseidon/snmp__poseidon-sensors index 0fe28a8d..aea79be5 100755 --- a/plugins/poseidon/snmp__poseidon-sensors +++ b/plugins/poseidon/snmp__poseidon-sensors @@ -29,7 +29,7 @@ E_OK="0" # everything went allright E_UNKNOWN="1" # "catch all" for otherwise unhandled errors -E_ARG="81" # invalid argument +E_ARG="81" # invalid argument E_USAGE="82" # wrong program name or arguments E_SNMPGET="83" # error while executing the 'snmpget' utility @@ -57,12 +57,12 @@ SENS_VALUE_OID=".1.3.6.1.4.1.21796.3.3.3.1.6." # integer (decimal * 10) SENS_ID_OID=".1.3.6.1.4.1.21796.3.3.99.1.2.1.4." # unique sensor ID (integer) #+ representation of the #+ temperature (integer) -SENS_UNIT_OID=".1.3.6.1.4.1.21796.3.3.3.1.9." # 0=°C,1=°F,2=°K,3=%,4=V,5=mA, +SENS_UNIT_OID=".1.3.6.1.4.1.21796.3.3.3.1.9." # 0=°C,1=°F,2=°K,3=%,4=V,5=mA, RTS_OUTPUT_OID=".1.3.6.1.4.1.21796.3.3.2.1.2." # binary input state (integer) #+ 6=unknown, 7=pulse, 8=switch # define some Poseidon specific stuff: -STATE_OK="1" +STATE_OK="1" STATE_WARN="2" STATE_CRIT="3" UNITS=("C" "F" "K" "%" "V" "mA" "unknown" "pulse" "switch") @@ -100,13 +100,13 @@ EOT cat <<- EOT multigraph $sensorType graph_title $sensorLocation - $sensorType [$sensorUnit] -graph_args --base 1000 -l 0 +graph_args --base 1000 -l 0 graph_vlabel $sensorUnit graph_category sensors graph_info This graph shows $sensorType history. EOT fi - _firstSensor="0" + _firstSensor="0" cat <<- EOT $sensorType$_sensorNr.label $sensorName $sensorType$_sensorNr.info This graph shows $sensorType$_sensorNr history. @@ -158,7 +158,7 @@ EOT # getSensorData(sensorNr) # fetch state, value, name unit and sensor type for the sensor -#+ with the number "sensorNr" +#+ with the number "sensorNr" getSensorData() { _sensorNr=$1 sensorState=`snmpGet $hostAddr $SENS_STATE_OID$_sensorNr || err \ @@ -172,7 +172,7 @@ getSensorData() { } # getSystemInfo() -# fetch general information about the system +# fetch general information about the system getSystemInfo() { sensorLocation="`snmpGet $hostAddr $SYS_LOC_OID`" } @@ -185,22 +185,22 @@ snmpGet () { _host="$1" _exit="0" - # fetch the requested OID + # fetch the requested OID _longValue="`snmpget -O v\ -m $MIBS\ -v $SNMPVERSION\ -c $SNMPCOMMUNITY\ $_host $_oid 2>/dev/null`" - + _exitStatus="$?" echo ${_longValue#*:} # remove the type from the answer return $_exitStatus -} +} # get unit (string) -#+ find out the unit of the output of a given sensor. possible units are: -#+ "C" "F" "K" "%" "V" "mA" "unknown" "pulse" "switch" +#+ find out the unit of the output of a given sensor. possible units are: +#+ "C" "F" "K" "%" "V" "mA" "unknown" "pulse" "switch" getSensorUnitString () { _sensorNr=$1 _sensorUnit=`snmpGet $hostAddr $SENS_UNIT_OID$_sensorNr || err \ @@ -209,7 +209,7 @@ getSensorUnitString () { } # get type (string) -#+ find out what type of sensor we are dealing with. possible types are: +#+ find out what type of sensor we are dealing with. possible types are: #+ "Temp" "Hum" "Volt" "Curr" "Unkn" "Pulse" "Switch" getSensorType () { _sensorNr=$1 @@ -223,19 +223,19 @@ getSensorType () { #+ in the array for the respective unit getAvailableSensorsByType () { _thisSensorNr="1" - + # initial fetch _snmpget=`snmpGet $hostAddr $SENS_UNIT_OID$_thisSensorNr` _nextSensorExits=$? _unit=`echo "$_snmpget" | tr -d " "` - # add next sensor if it exists - while [ true ]; do + # add next sensor if it exists + while [ true ]; do # add sensors of the same type to a list - sensorsOfType[$_unit]="${sensorsOfType[$_unit]} $_thisSensorNr" - + sensorsOfType[$_unit]="${sensorsOfType[$_unit]} $_thisSensorNr" + # fetch next sensor - _thisSensorNr=$(($_thisSensorNr+1)) + _thisSensorNr=$(($_thisSensorNr+1)) _snmpget=`snmpGet $hostAddr $SENS_UNIT_OID$_thisSensorNr` _nextSensorExits=$? @@ -243,7 +243,7 @@ getAvailableSensorsByType () { if [ $_nextSensorExits -ne 0 ]; then break fi - + _unit=`echo "$_snmpget" |cut -d" " -f 4` done } @@ -264,7 +264,7 @@ sanitize () { } # usage () -# print usage +# print usage usage () { echo "usage: snmp__poseidon-sensors [config|snmpconf]" 1>&2 exit $E_USAGE @@ -279,7 +279,7 @@ err () { else _errorMsg="Fatal: An unknown error occurred! Exiting..." _exitCode="$E_UNKNOWN" - + fi # print error message to STDERR ... @@ -291,13 +291,13 @@ err () { #==============================================================================# # SNMP Config -MIBS=":" # we don't use any configured MIBs so we don't +MIBS=":" # we don't use any configured MIBs so we don't #+ have to deal with errors in the MIBs -if [ -z $SNMPVERSION ]; then +if [ -z $SNMPVERSION ]; then SNMPVERSION="1" # as of firmware 3.1.5 only SNMPv1 is supported fi -if [ -z $SNMPCOMMUNITY ]; then +if [ -z $SNMPCOMMUNITY ]; then SNMPCOMMUNITY="public" # SNMP community string to read from the device fi @@ -326,11 +326,11 @@ hostAddr="`basename "$0" | cut -d "_" -f 2`" if [ "$myName" = "snmp_poseidon-sensors" ]; then hostAddr=`sanitize $hostAddr || err \ "Fatal: Invalid argument \"$hostAddr\"! Exiting..." $E_ARG` - if [ -z "$hostAddr" ]; then + if [ -z "$hostAddr" ]; then usage munin fi getAvailableSensorsByType - if [ "$1" = "config" ]; then + if [ "$1" = "config" ]; then printMuninConfig exit $E_OK elif [ "$1" = "snmpconfig" ]; then diff --git a/plugins/postfix/greyfix b/plugins/postfix/greyfix index 87d0d4fd..75fd84c3 100755 --- a/plugins/postfix/greyfix +++ b/plugins/postfix/greyfix @@ -21,7 +21,7 @@ $ ln -s /path/to/plugin/greyfix /etc/munin/plugins/greyfix Configuration ============= -There are some settings that can be tweaked by adding statements to the +There are some settings that can be tweaked by adding statements to the munin-node config: [greyfix] @@ -36,10 +36,10 @@ env.num_steps 47 # graph the greylisted triplets separate from the whitelisted ones (default: yes) env.greylist_step no -Please note that the last step has no end date, so it includes all triplets -older than the second last step. I.e., the defaults (as named above) create a -graph that shows 10 steps of one week each, and one last step for everything -older than 10 weeks. Also, the separate greylist step is not considered +Please note that the last step has no end date, so it includes all triplets +older than the second last step. I.e., the defaults (as named above) create a +graph that shows 10 steps of one week each, and one last step for everything +older than 10 weeks. Also, the separate greylist step is not considered when applying num_steps. """ @@ -72,7 +72,7 @@ def greyfix_parse_triplets(): if greyfix.returncode > 0: print '# greyfix exited with exit code %i' % (greyfix.returncode) sys.exit(greyfix.returncode) - + triplets = [] for line in stdout.split("\n"): triplet = line.split("\t") diff --git a/plugins/postfix/policyd-spf-python b/plugins/postfix/policyd-spf-python index 93c53b5e..3c169b40 100755 --- a/plugins/postfix/policyd-spf-python +++ b/plugins/postfix/policyd-spf-python @@ -1,14 +1,14 @@ #! /bin/bash # # Munin plugin to monitor postfix-policyd-spf-python results -# Contributed by Alexander Koch +# Contributed by Alexander Koch # # This plugin is published under the terms of the MIT License. -# +# # Parameters understood: # config (required) # autoconf (optional - used by munin-config) -# +# # Config variables: # logfile - Where to find the postfix log (mail.log) # diff --git a/plugins/postfix/postfix-queue-size b/plugins/postfix/postfix-queue-size index f471b260..5f9db598 100755 --- a/plugins/postfix/postfix-queue-size +++ b/plugins/postfix/postfix-queue-size @@ -91,7 +91,7 @@ SPOOLDIR=${spooldir:-$POSTCONFSPOOL} case $1 in autoconf|detect) - + if [ -d $SPOOLDIR ] ; then echo yes exit 0 diff --git a/plugins/postfix/postfix_filtered b/plugins/postfix/postfix_filtered index 8cb70370..c9eda5f4 100755 --- a/plugins/postfix/postfix_filtered +++ b/plugins/postfix/postfix_filtered @@ -17,9 +17,9 @@ # env.policy my policy string # # When env.policy is set, this plugin will match the string you supply as env.policy and return the number of instances -# of that string as an output called "policy.value". +# of that string as an output called "policy.value". # -# If you are NOt using a postfix policy daemon, as above, use the line +# If you are NOt using a postfix policy daemon, as above, use the line # # [postfix*] # env.policy none @@ -29,7 +29,7 @@ -POLICY=${policy} +POLICY=${policy} if [ "$POLICY" = "none" ] then POLICY="" @@ -67,11 +67,11 @@ if [ "$1" = "config" ]; then echo 'allowed.label Allowed' echo 'allowed.min 0' echo 'allowed.type ABSOLUTE' - + echo 'rbl.label RBL blocked' echo 'rbl.min 0' echo 'rbl.type ABSOLUTE' - + if [ -z "$POLICY" ] then echo "empty" > /dev/null @@ -84,15 +84,15 @@ if [ "$1" = "config" ]; then echo 'helo.label HELO rejected' echo 'helo.min 0' echo 'helo.type ABSOLUTE' - + echo 'client.label Client rejected' echo 'client.min 0' echo 'client.type ABSOLUTE' - + echo 'sender.label Sender rejected' echo 'sender.min 0' echo 'sender.type ABSOLUTE' - + echo 'recipient.label Recipient unknown' echo 'recipient.min 0' echo 'recipient.type ABSOLUTE' diff --git a/plugins/postfix/postfix_filtered_awk b/plugins/postfix/postfix_filtered_awk index fde5dbc0..b054c111 100755 --- a/plugins/postfix/postfix_filtered_awk +++ b/plugins/postfix/postfix_filtered_awk @@ -17,9 +17,9 @@ # env.policy my policy string # # When env.policy is set, this plugin will match the string you supply as env.policy and return the number of instances -# of that string as an output called "policy.value". +# of that string as an output called "policy.value". # -# If you are NOT using a postfix policy daemon, as above, use the line +# If you are NOT using a postfix policy daemon, as above, use the line # # [postfix_filtered] # env.policy none @@ -58,7 +58,7 @@ if [ "$1" = "config" ]; then if [ -z "$POLICY" ] then echo 'graph_order rbl helo client sender recipient relay allowed' - + else echo 'graph_order rbl policy helo client sender recipient relay allowed' echo 'policy.label policy blocked' @@ -98,11 +98,11 @@ fi $LOGTAIL ${MAIL_LOG} $STATEFILE | \ -awk 'BEGIN { na= 0; nb= 0; nc= 0; nd= 0; ne= 0; nf= 0; ng= 0; nh= 0 ; st= ENVIRON["POLICY"] } +awk 'BEGIN { na= 0; nb= 0; nc= 0; nd= 0; ne= 0; nf= 0; ng= 0; nh= 0 ; st= ENVIRON["POLICY"] } - { - if (index($0, "queued as")) { na++ } - else if (index($0, "Relay access denied")) { nb++ } + { + if (index($0, "queued as")) { na++ } + else if (index($0, "Relay access denied")) { nb++ } else if (index($0, "blocked using")) { nc++ } else if (index($0, "Helo command rejected")) { nd++ } else if (index($0, "Client host rejected")) { ne++ } diff --git a/plugins/postfix/postfix_mailfiltered b/plugins/postfix/postfix_mailfiltered index f96687df..8689bdd7 100755 --- a/plugins/postfix/postfix_mailfiltered +++ b/plugins/postfix/postfix_mailfiltered @@ -10,8 +10,8 @@ mktempfile () { -mktemp -t -} + mktemp -t +} MAIL_LOG=${logfile:-/var/log/mail.log} LOGTAIL=${logtail:-`which logtail`} diff --git a/plugins/postfix/postfix_mailqueuelog_ b/plugins/postfix/postfix_mailqueuelog_ index 4ccc8f6a..a4be671a 100755 --- a/plugins/postfix/postfix_mailqueuelog_ +++ b/plugins/postfix/postfix_mailqueuelog_ @@ -171,7 +171,7 @@ foreach my $i (@status_list) #if(-l $statefile) { # die("$statefile is a symbolic link, refusing to touch it."); -#} +#} #open (OUT, '>', $statefile) or die "Unable to open statefile: $!\n"; #print OUT "sum:$sum\n"; #foreach my $i (@status_list) @@ -180,8 +180,8 @@ foreach my $i (@status_list) #} #close OUT; -sub parseLogfile -{ +sub parseLogfile +{ my ($fname) = @_; # the search parts diff --git a/plugins/postfix/postfix_mailstats_ b/plugins/postfix/postfix_mailstats_ index b3a7f489..24d0029e 100755 --- a/plugins/postfix/postfix_mailstats_ +++ b/plugins/postfix/postfix_mailstats_ @@ -169,7 +169,7 @@ foreach my $i (sort keys %{$rejects}) if (-l $statefile) { die ("$statefile is a symbolic link, refusing to touch it."); -} +} open (OUT, '>', $statefile) or die "Unable to open statefile: $!\n"; print OUT "$pos:$delivered\n"; foreach my $i (sort keys %{$rejects}) @@ -178,31 +178,31 @@ foreach my $i (sort keys %{$rejects}) } close OUT; -sub parseLogfile -{ +sub parseLogfile +{ my ($fname, $start, $stop) = @_; open (LOGFILE, $fname) or die "Unable to open logfile $fname for reading: $!\n"; seek (LOGFILE, $start, 0) or die "Unable to seek to $start in $fname: $!\n"; - while (tell (LOGFILE) < $stop) + while (tell (LOGFILE) < $stop) { my $line = ; chomp ($line); if ($line =~ /$postfix\/qmgr.*from=.*size=[0-9]*/ || - $line =~ /$postfix\/smtp.* status=sent /) + $line =~ /$postfix\/smtp.* status=sent /) { $delivered++; - } + } elsif ($line =~ /$postfix\/smtpd.*reject: \S+ \S+ \S+ (\S+)/ || $line =~ /$postfix\/cleanup.* reject: (\S+)/) { $rejects->{$1}++; } } - close(LOGFILE) or warn "Error closing $fname: $!\n"; + close(LOGFILE) or warn "Error closing $fname: $!\n"; } # vim:syntax=perl diff --git a/plugins/postfix/postfix_mailvolume_multi b/plugins/postfix/postfix_mailvolume_multi index 4e7401e5..5ef5c201 100755 --- a/plugins/postfix/postfix_mailvolume_multi +++ b/plugins/postfix/postfix_mailvolume_multi @@ -145,7 +145,7 @@ if ($ARGV[0] and $ARGV[0] eq "autoconf") print "no (logfile '$logfile' not found)\n"; } } - else + else { print "no (postfix not found)\n"; } @@ -193,7 +193,7 @@ if (!$pos) # No state file present. Avoid startup spike: Do not read log # file up to now, but remember how large it is now, and next # time read from there. - + $pos = (stat $logfile)[7]; # File size foreach $syslog_name (@postfix_syslog_name) { diff --git a/plugins/postfix/postfix_stats b/plugins/postfix/postfix_stats index 89ac0fdb..d3f51fbc 100755 --- a/plugins/postfix/postfix_stats +++ b/plugins/postfix/postfix_stats @@ -21,11 +21,11 @@ There is no default configuration. This is an example config for Ubuntu: env.pflogsumm pflogsumm env.logfiles contains space separated syslog logfiles, usually current log -and previous log. You can add more log files if you want, but this may +and previous log. You can add more log files if you want, but this may increase the time required for analysis. env.pflogsumm The "pflogsumm" script, can be pflogsumm.pl if it was manually -downloaded and installed, or "pflogsumm" if it was installed by a package +downloaded and installed, or "pflogsumm" if it was installed by a package manager (like apt-get). Use the last part of the symlink name for filtering by hostname from logfile, @@ -136,7 +136,7 @@ else fi # Parse value from Raw result -# +# # Return digit if regex are parsed correctly # # Return U (undefined) if any error occurs diff --git a/plugins/postfix/postgrey b/plugins/postfix/postgrey index e5c9ebc6..0fc3bbef 100755 --- a/plugins/postfix/postgrey +++ b/plugins/postfix/postgrey @@ -10,8 +10,8 @@ mktempfile () { -mktemp -t -} + mktemp -t +} MAIL_LOG=${logfile:-/var/log/mail.log} STATEFILE=$MUNIN_PLUGSTATE/postgrey.offset @@ -69,7 +69,7 @@ then fi delayed=`grep 'Recipient address rejected.*Greylisted' ${TEMP_FILE} | wc -l` - passed=`grep 'postgrey\[[0-9]*\]: delayed [0-9]* seconds:' ${TEMP_FILE} | wc -l` + passed=`grep 'postgrey\[[0-9]*\]: delayed [0-9]* seconds:' ${TEMP_FILE} | wc -l` whitelisted=`grep 'postgrey\[[0-9]*\]: whitelisted:' ${TEMP_FILE} | wc -l` /bin/rm -f $TEMP_FILE diff --git a/plugins/postfix/postgrey-new b/plugins/postfix/postgrey-new index 3a8944a1..a56e0f12 100755 --- a/plugins/postfix/postgrey-new +++ b/plugins/postfix/postgrey-new @@ -62,7 +62,7 @@ if(defined $ARGV[0] and $ARGV[0] eq "config") { print "graph_category mail\n"; print "graph_vlabel Count\n"; print "graph_scale no\n"; - + print "greylisted.label greylisted_reason_new\n"; print "greylisted.type GAUGE\n"; print "greylisted.draw AREA\n"; @@ -93,7 +93,7 @@ if( -f $statefile) { chomp($retry_old); chomp($passes_white_old); close STATE; -} +} @@ -122,7 +122,7 @@ while(my $line = ) $passes_white++; } } - + } } diff --git a/plugins/postgresql/pgbouncer_ b/plugins/postgresql/pgbouncer_ index 7e429671..69dacafd 100755 --- a/plugins/postgresql/pgbouncer_ +++ b/plugins/postgresql/pgbouncer_ @@ -31,7 +31,7 @@ my $plugin_title = ($db_pool) ? $plugin_suffix." ".$pool_name : $pool_name; if (!$pool_name) { print "Cannot get pool name\n"; - exit 1; + exit 1; } # command line arguments for autconf and config @@ -164,7 +164,7 @@ if (defined($ARGV[0])) } # connect to data -my $dbh = DBI->connect("DBI:Pg:dbname=$db_name;host=$db_host;port=$db_port", $db_user, $db_pass) +my $dbh = DBI->connect("DBI:Pg:dbname=$db_name;host=$db_host;port=$db_port", $db_user, $db_pass) or die ("Cannot connect to database"); # go trough each set and get the data foreach my $get ('pools', 'stats') @@ -256,7 +256,7 @@ another example, where different pgbouncers (and so munin plugins) connecting to env.pgbouncer_port 6542 env.pgbouncer_host localhost env.pgbouncer_pool dbname - + [pgbouncer_webmain] env.pgbouncer_pass barfoo env.pgbouncer_user bar @@ -276,7 +276,7 @@ This graph will show the average bytes sent and received by the pgbouncer for th =head2 Average connections -This graph will show the average amount of connections to the pgbouncer for this pool +This graph will show the average amount of connections to the pgbouncer for this pool =head2 Average query time diff --git a/plugins/postgresql/postgres_block_read_ b/plugins/postgresql/postgres_block_read_ index 62a6f4b5..2ea8da8a 100755 --- a/plugins/postgresql/postgres_block_read_ +++ b/plugins/postgresql/postgres_block_read_ @@ -28,8 +28,8 @@ # This should, however, be given through autoconf and suggest. # # If required, give username, password and/or Postgresql server -# host through environment variables. -# +# host through environment variables. +# # You must also activate Postgresql statistics. See # http://www.postgresql.org/docs/7.4/interactive/monitoring-stats.html # for how to enable this. Specifically, the following lines must @@ -46,11 +46,11 @@ # Config variables: # # dbhost - Which database server to use. Defaults to -# 'localhost'. +# 'localhost'. # dbuser - A Postgresql user account with read permission to # the given database. Defaults to # 'postgres'. Anyway, Munin must be told which user -# this plugin should be run as. +# this plugin should be run as. # dbpass - The corresponding password, if # applicable. Default to undef. Remember that # pg_hba.conf must be configured accordingly. @@ -128,7 +128,7 @@ if ($configure) { graph_title Postgres data reads from $dbname graph_args --base 1000 graph_vlabel Blocks read per \${graph_period} -graph_category db +graph_category db graph_info Shows number of blocks read from disk and from memory from_disk.label Read from disk from_disk.info Read from disk diff --git a/plugins/postgresql/postgres_queries2_ b/plugins/postgresql/postgres_queries2_ index 5c8185f2..dab14abb 100755 --- a/plugins/postgresql/postgres_queries2_ +++ b/plugins/postgresql/postgres_queries2_ @@ -14,7 +14,7 @@ cat << EOF graph_title Postgres queries2 on $db graph_args --base 1000 graph_vlabel Queries per \${graph_period} -graph_category db +graph_category db graph_info Shows number of select, insert, update and delete queries sel_seq.label s_selects sel_seq.info Sequential selects on all tables @@ -47,7 +47,7 @@ deletes.min 0 EOF else psql -At $db << EOF -select +select 'sel_seq.value ' || SUM(seq_scan) || E'\n' || 'sel_seq_rows.value ' || SUM(seq_tup_read) || E'\n' || 'sel_idx.value ' || SUM(idx_scan) || E'\n' || @@ -57,7 +57,7 @@ select 'deletes.value ' || SUM(n_tup_del) from pg_stat_all_tables; EOF - + # my $sql = "SELECT SUM(seq_scan),SUM(seq_tup_read), "; # $sql .= "SUM(idx_scan),SUM(idx_tup_fetch), "; # $sql .= "SUM(n_tup_ins),SUM(n_tup_upd),SUM(n_tup_del) "; diff --git a/plugins/postgresql/postgres_queries3_ b/plugins/postgresql/postgres_queries3_ index 6d4b873e..c3b18169 100755 --- a/plugins/postgresql/postgres_queries3_ +++ b/plugins/postgresql/postgres_queries3_ @@ -1,6 +1,6 @@ #!/usr/bin/env perl -# postgres_queries3: see stats on number of rows +# postgres_queries3: see stats on number of rows # read, inserted, updated and deleted on a per table basis # # Author: @@ -27,10 +27,10 @@ # On debian systems install libipc-run3-perl # # Log info: -# 20140701 - Initial -# 20140924 - +# 20140701 - Initial +# 20140924 - # -ignore internal pg tables -# -missing stuff in config +# -missing stuff in config use strict; @@ -40,7 +40,7 @@ use IPC::Run3 qw( run3 ); my %values; my $query = \<new( vlabel => 'Size', paramdatabase => 1, basequery => "SELECT CASE WHEN relkind = 'r' OR relkind = 't' THEN 'db_detail_data' WHEN relkind = 'i' THEN 'db_detail_index' WHEN relkind = 'v' THEN 'db_detail_view' WHEN relkind = 'S' THEN 'db_detail_sequence' ELSE 'db_detail_other' END AS state, - SUM(relpages::bigint * 8 * 1024) AS size + SUM(relpages::bigint * 8 * 1024) AS size FROM pg_class pg, pg_namespace pgn WHERE pg.relnamespace = pgn.oid AND pgn.nspname NOT IN ('information_schema', 'pg_catalog') GROUP BY state", configquery => [ "VALUES ('db_detail_data','Data size'),('db_detail_index','Index size'),('db_detail_sequence','Sequence size'),('db_detail_view','View size'),('db_detail_other','Other size')", diff --git a/plugins/postgresql/postgres_space_ b/plugins/postgresql/postgres_space_ index ed387631..1b6d88da 100755 --- a/plugins/postgresql/postgres_space_ +++ b/plugins/postgresql/postgres_space_ @@ -105,17 +105,17 @@ _EOM my $metadatabase_pages = 0; my $metadatabase_indexes = 0; my @names = $dbh->tables; - + # Find relfilenode and relpages from the given table my $q_ind = "SELECT relkind, relfilenode, relpages FROM pg_class WHERE relname = ? UNION SELECT relkind, relfilenode, relpages FROM pg_class - WHERE relfilenode IN (SELECT indexrelid FROM pg_index + WHERE relfilenode IN (SELECT indexrelid FROM pg_index WHERE indrelid IN (SELECT relfilenode FROM pg_class WHERE relname = ?))"; my $sth = $dbh->prepare ($q_ind) or die $dbh->errstr; - + # Iterate over the tables in the database foreach my $table (@names) { my $meta = 1; @@ -127,7 +127,7 @@ _EOM # "public" tables are the user data $meta = 0 if $table =~ /^public\./; $table =~ s/^.*\.//; - + # Call the query with $table twice for each side of the UNION $sth->execute ($table, $table) or die $dbh->errstr; while (my ($relkind, $relfilenode, $relpages) = $sth->fetchrow_array) { @@ -139,8 +139,8 @@ _EOM $metatable_indexes += $relpages if $meta == 1; } # Define the query - my $q2 = "SELECT SUM(relpages) - FROM pg_class + my $q2 = "SELECT SUM(relpages) + FROM pg_class WHERE relname IN (?, ?)"; my $sth2 = $dbh->prepare ($q2); $sth2->execute ("pg_toast_${relfilenode}", @@ -159,7 +159,7 @@ _EOM $database_indexes += $table_indexes; $metadatabase_pages += $metatable_pages; $metadatabase_indexes += $metatable_indexes; - } + } $sth->finish; $dbh->disconnect; print "size\.value " . $database_pages * 8192 . "\n"; diff --git a/plugins/postgresql/slony_lag_events_ b/plugins/postgresql/slony_lag_events_ index 13d88f83..f85d6272 100755 --- a/plugins/postgresql/slony_lag_events_ +++ b/plugins/postgresql/slony_lag_events_ @@ -14,7 +14,7 @@ # st_last_received_event_ts: the timestamp on the sl_event in that pair # st_lag_num_events: difference between st_last_event and st_last_received # st_lag_time: difference between st_last_event_ts and st_last_received_ts -# +# # # Configuration variables: # @@ -54,7 +54,7 @@ if [ "$1" = "config" ]; then echo "graph_title Slony lag events for ${PGDATABASE}" echo 'graph_vlabel event' - psql -h ${PGHOST} -d ${PGDATABASE} -U ${PGUSER} -tc "SELECT no_id,regexp_replace(pa_conninfo, '.*host=(.*?) .*$', '\\1') FROM ${PGSCHEMA}.sl_node JOIN ${PGSCHEMA}.sl_path ON (pa_server=no_id) WHERE pa_client=${PGSCHEMA}.getlocalnodeid('${PGSCHEMA}'::name);" | while read node_id sep host + psql -h ${PGHOST} -d ${PGDATABASE} -U ${PGUSER} -tc "SELECT no_id,regexp_replace(pa_conninfo, '.*host=(.*?) .*$', '\\1') FROM ${PGSCHEMA}.sl_node JOIN ${PGSCHEMA}.sl_path ON (pa_server=no_id) WHERE pa_client=${PGSCHEMA}.getlocalnodeid('${PGSCHEMA}'::name);" | while read node_id sep host do test -z "${node_id}" && continue echo "${node_id}.label ${host}" @@ -68,7 +68,7 @@ if [ "$1" = "config" ]; then fi psql -h ${PGHOST} -d ${PGDATABASE} -U ${PGUSER} -tc "SELECT st_received, st_lag_num_events FROM ${PGSCHEMA}.sl_status ORDER BY 1;" | while read node_id sep event -do +do test -z "${node_id}" && continue echo "${node_id}.value ${event}" done diff --git a/plugins/postgresql/slony_lag_time b/plugins/postgresql/slony_lag_time index 3ba34422..ddbcd99f 100755 --- a/plugins/postgresql/slony_lag_time +++ b/plugins/postgresql/slony_lag_time @@ -1,6 +1,6 @@ #!/bin/bash # -# plugin to monitor difference between st_last_event_ts and st_last_received_ts +# plugin to monitor difference between st_last_event_ts and st_last_received_ts # in sl_status table (based on slony_ and slony_lag_) # # http://blog.endpoint.com/2009/07/slony-slstatus-and-diagnosing.html @@ -14,7 +14,7 @@ # st_last_received_event_ts: the timestamp on the sl_event in that pair # st_lag_num_events: difference between st_last_event and st_last_received # st_lag_time: difference between st_last_event_ts and st_last_received_ts -# +# # # Configuration variables: # @@ -54,7 +54,7 @@ if [ "$1" = "config" ]; then echo "graph_title Slony lag time for ${PGDATABASE}" echo "graph_vlabel \${graph_period}" - psql -h ${PGHOST} -d ${PGDATABASE} -U ${PGUSER} -tc "SELECT no_id,regexp_replace(pa_conninfo, '.*host=(.*?) .*$', '\\\\1') FROM ${PGSCHEMA}.sl_node JOIN ${PGSCHEMA}.sl_path ON (pa_server=no_id) WHERE pa_client=${PGSCHEMA}.getlocalnodeid('${PGSCHEMA}'::name);" | while read node_id sep host + psql -h ${PGHOST} -d ${PGDATABASE} -U ${PGUSER} -tc "SELECT no_id,regexp_replace(pa_conninfo, '.*host=(.*?) .*$', '\\\\1') FROM ${PGSCHEMA}.sl_node JOIN ${PGSCHEMA}.sl_path ON (pa_server=no_id) WHERE pa_client=${PGSCHEMA}.getlocalnodeid('${PGSCHEMA}'::name);" | while read node_id sep host do test -z "${node_id}" && continue echo "${node_id}.label ${host}" @@ -68,7 +68,7 @@ if [ "$1" = "config" ]; then fi psql -h ${PGHOST} -d ${PGDATABASE} -U ${PGUSER} -tc "SELECT st_received, extract(epoch FROM st_lag_time)::integer FROM ${PGSCHEMA}.sl_status ORDER BY 1;" | while read node_id sep time -do +do test -z "${node_id}" && continue echo "${node_id}.value ${time}" done diff --git a/plugins/postgresql/slony_lag_time_ b/plugins/postgresql/slony_lag_time_ index c671f657..0ab90119 100755 --- a/plugins/postgresql/slony_lag_time_ +++ b/plugins/postgresql/slony_lag_time_ @@ -1,6 +1,6 @@ #!/bin/bash # -# plugin to monitor difference between st_last_event_ts and st_last_received_ts +# plugin to monitor difference between st_last_event_ts and st_last_received_ts # in sl_status table (based on slony_ and slony_lag_) # # http://blog.endpoint.com/2009/07/slony-slstatus-and-diagnosing.html @@ -14,7 +14,7 @@ # st_last_received_event_ts: the timestamp on the sl_event in that pair # st_lag_num_events: difference between st_last_event and st_last_received # st_lag_time: difference between st_last_event_ts and st_last_received_ts -# +# # # Configuration variables: # @@ -54,7 +54,7 @@ if [ "$1" = "config" ]; then echo "graph_title Slony lag time for ${PGDATABASE}" echo "graph_vlabel \${graph_period}" - psql -h ${PGHOST} -d ${PGDATABASE} -U ${PGUSER} -tc "SELECT no_id,regexp_replace(pa_conninfo, '.*host=(.*?) .*$', '\\1') FROM ${PGSCHEMA}.sl_node JOIN ${PGSCHEMA}.sl_path ON (pa_server=no_id) WHERE pa_client=${PGSCHEMA}.getlocalnodeid('${PGSCHEMA}'::name);" | while read node_id sep host + psql -h ${PGHOST} -d ${PGDATABASE} -U ${PGUSER} -tc "SELECT no_id,regexp_replace(pa_conninfo, '.*host=(.*?) .*$', '\\1') FROM ${PGSCHEMA}.sl_node JOIN ${PGSCHEMA}.sl_path ON (pa_server=no_id) WHERE pa_client=${PGSCHEMA}.getlocalnodeid('${PGSCHEMA}'::name);" | while read node_id sep host do test -z "${node_id}" && continue echo "${node_id}.label ${host}" @@ -68,7 +68,7 @@ if [ "$1" = "config" ]; then fi psql -h ${PGHOST} -d ${PGDATABASE} -U ${PGUSER} -tc "SELECT st_received, extract(epoch FROM st_lag_time)::integer FROM ${PGSCHEMA}.sl_status ORDER BY 1;" | while read node_id sep time -do +do test -z "${node_id}" && continue echo "${node_id}.value ${time}" done diff --git a/plugins/power/apcupsd_pct b/plugins/power/apcupsd_pct index dec45cfb..2e4452aa 100755 --- a/plugins/power/apcupsd_pct +++ b/plugins/power/apcupsd_pct @@ -208,14 +208,14 @@ munin plugin to monitor APC UPS via apcupsd by apcaccess. =head1 INSTALLATION cp apcupsd_pct $MUNIN_LIBDIR/plugsin/ - + cd YOUR_MUNIN_PLUGINS_DIR (make symbolic links different name) ln -s $MUNIN_LIBDIR/plugsin/apcupsd_pct apcupsd_pct ln -s $MUNIN_LIBDIR/plugsin/apcupsd_pct apcupsd_volt ln -s $MUNIN_LIBDIR/plugsin/apcupsd_pct apcupsd_time ln -s $MUNIN_LIBDIR/plugsin/apcupsd_pwr apcupsd_pwr - + restart munin-node =head1 REPOSITORY diff --git a/plugins/power/apcupsd_ww b/plugins/power/apcupsd_ww index b50067b3..4a657f28 100755 --- a/plugins/power/apcupsd_ww +++ b/plugins/power/apcupsd_ww @@ -1,15 +1,15 @@ #!/usr/bin/perl -w -# +# # Plugin to monitor apcupsd via apcaccess # # Version 1.3 -# +# # Copyright (C) 2005-2008 Behan Webster # Licenced under GPL 2.0 # # Written by: Behan Webster # German translation by: Bianco Veigel -# +# #%# family=auto #%# capabilities=autoconf @@ -28,7 +28,7 @@ my $language = $ENV{LANG} || 'en'; # # UPSNAME : Elfhild # MODEL : SMART-UPS 1400 RM XL -# STATUS : ONLINE +# STATUS : ONLINE # LINEV : 123.5 Volts # LOADPCT : 24.9 Percent Load Capacity # BCHARGE : 100.0 Percent diff --git a/plugins/power/currentcost b/plugins/power/currentcost index 956acfc8..41437c51 100755 --- a/plugins/power/currentcost +++ b/plugins/power/currentcost @@ -314,8 +314,8 @@ As per L 00014 days since birth
14 the time - 07 - 07 + 07 + 07 CC02 name of this device @@ -336,71 +336,71 @@ As per L 000.0 total Kwh used in 2 hour blocks - 000.1 - 000.1 - 000.0 - 000.0 - 000.0 - 000.0 - 000.1 - 000.1 - 000.1 - 000.1 - 000.0 - 000.0 + 000.1 + 000.1 + 000.0 + 000.0 + 000.0 + 000.0 + 000.1 + 000.1 + 000.1 + 000.1 + 000.0 + 000.0 0000 total Kwh used per day(s) - 0000 - 0000 - 0000 - 0000 - 0000 - 0000 - 0000 - 0000 - 0000 - 0000 - 0000 - 0000 - 0000 - 0000 - 0000 - 0000 - 0000 - 0000 - 0000 - 0000 - 0000 - 0000 - 0000 - 0000 - 0000 - 0000 - 0000 - 0000 - 0000 - 0000 + 0000 + 0000 + 0000 + 0000 + 0000 + 0000 + 0000 + 0000 + 0000 + 0000 + 0000 + 0000 + 0000 + 0000 + 0000 + 0000 + 0000 + 0000 + 0000 + 0000 + 0000 + 0000 + 0000 + 0000 + 0000 + 0000 + 0000 + 0000 + 0000 + 0000 0000 total Kwh used per month(s) - 0000 - 0000 - 0000 - 0000 - 0000 - 0000 - 0000 - 0000 - 0000 - 0000 - 0000 + 0000 + 0000 + 0000 + 0000 + 0000 + 0000 + 0000 + 0000 + 0000 + 0000 + 0000 0000000 total Kwh used per year(s) - 0000000 - 0000000 - 0000000 + 0000000 + 0000000 + 0000000 @@ -427,7 +427,7 @@ For full definition, see L 00000 end of message - + =cut sub collect_cc128_data { diff --git a/plugins/power/nut b/plugins/power/nut index 0bd56048..8c3f158d 100755 --- a/plugins/power/nut +++ b/plugins/power/nut @@ -41,7 +41,7 @@ load=$(upsc $UPS | grep ups.load: | cut -d" " -f2) charge=$(upsc $UPS | grep battery.charge: | cut -d" " -f2) } -# Munin routines +# Munin routines case "$1" in autoconf) grep ^MONITOR < /etc/nut/upsmon.conf &> /dev/null @@ -78,8 +78,8 @@ EOM grep ^MONITOR < /etc/nut/upsmon.conf | cut -d" " -f2 | sed 's|@|_AT_|g' exit 0 ;; - *) - + *) + FETCH_DATA # Print data for Munin cat << EOM diff --git a/plugins/power/snmp__ipoman_ b/plugins/power/snmp__ipoman_ index 9524460b..011852e1 100755 --- a/plugins/power/snmp__ipoman_ +++ b/plugins/power/snmp__ipoman_ @@ -3,8 +3,8 @@ # What is snmp__ipoman_ # ---------------------- # snmp__ipoman is a munin plugin written for the Ingrasys IpomanII 1202 -# Power Distribution Unit. It should work on any PDU conforming to -# the IPOMANII-MIB. +# Power Distribution Unit. It should work on any PDU conforming to +# the IPOMANII-MIB. # # How do I use it # --------------- @@ -12,7 +12,7 @@ # how: # # 1. Copy snmp__ipoman_ to the directory where all your munin plugins -# reside, for example /usr/share/munin/plugins. +# reside, for example /usr/share/munin/plugins. # # 2. Make the following symlinks to snmp__ipoman_ in that same directory # @@ -40,7 +40,7 @@ # output current and power usage for all available outlets of the # ipoman, and current, power usage and voltage/frequency on all inlets # of the ipoman. -# +# # 5. Restart munin-node # # 6. Make an entry in your munin server's munin.conf: @@ -48,7 +48,7 @@ # [] # address
# use_node_name no -# +# # 7. Done. # # Copyright (C) 2009 Rien Broekstra @@ -67,21 +67,21 @@ # along with this program; if not, write to the Free Software # Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. # -# Munin plugin to monitor power consumption and current of the sockets of an -# Ingrasys IpomanII 1202 Power Distribution Unit, or any power distribution +# Munin plugin to monitor power consumption and current of the sockets of an +# Ingrasys IpomanII 1202 Power Distribution Unit, or any power distribution # unit that conforms to IPOMANII-MIB via SNMP. # # Parameters: # -# config -# snmpconf +# config +# snmpconf # # Relevant OID's under .iso.org.dod.internet.private.enterprises.ingrasys.product.pduAgent.iPoManII # .ipmObjects.ipmDevice.ipmDeviceOutlet.ipmDeviceOutletNumber.0 # .ipmObjects.ipmDevice.ipmDeviceOutlet.ipmDeviceOutletStatusTable.ipmDeviceOutletStatusEntry.outletStatusIndex.1 # .ipmObjects.ipmDevice.ipmDeviceOutlet.ipmDeviceOutletStatusTable.ipmDeviceOutletStatusEntry.outletStatusCurrent.1 # .ipmObjects.ipmDevice.ipmDeviceOutlet.ipmDeviceOutletStatusTable.ipmDeviceOutletStatusEntry.outletStatusKwatt.1 -# .ipmObjects.ipmDevice.ipmDeviceOutlet.ipmDeviceOutletStatusTable.ipmDeviceOutletStatusEntry.outletStatusWH.1 +# .ipmObjects.ipmDevice.ipmDeviceOutlet.ipmDeviceOutletStatusTable.ipmDeviceOutletStatusEntry.outletStatusWH.1 # # Version 0.1, Aug 4, 2009 # @@ -134,15 +134,15 @@ if (!defined($graphtype)) { # # The relevant OID's on the IPOMAN # -my $oid_inletnumber = ".1.3.6.1.4.1.2468.1.4.2.1.3.1.1.0"; -my $oid_inletindextable = ".1.3.6.1.4.1.2468.1.4.2.1.3.1.2.1.1."; +my $oid_inletnumber = ".1.3.6.1.4.1.2468.1.4.2.1.3.1.1.0"; +my $oid_inletindextable = ".1.3.6.1.4.1.2468.1.4.2.1.3.1.2.1.1."; my $oid_inletvoltage = ".1.3.6.1.4.1.2468.1.4.2.1.3.1.3.1.2."; my $oid_inletcurrent = ".1.3.6.1.4.1.2468.1.4.2.1.3.1.3.1.3."; my $oid_inletfrequency = ".1.3.6.1.4.1.2468.1.4.2.1.3.1.3.1.4."; my $oid_inletenergy = ".1.3.6.1.4.1.2468.1.4.2.1.3.1.3.1.5."; -my $oid_outletnumber = ".1.3.6.1.4.1.2468.1.4.2.1.3.2.1.0"; -my $oid_outletindextable = ".1.3.6.1.4.1.2468.1.4.2.1.3.2.3.1.1."; +my $oid_outletnumber = ".1.3.6.1.4.1.2468.1.4.2.1.3.2.1.0"; +my $oid_outletindextable = ".1.3.6.1.4.1.2468.1.4.2.1.3.2.3.1.1."; my $oid_outletdescription = ".1.3.6.1.4.1.2468.1.4.2.1.3.2.2.1.2."; my $oid_outletcurrent = ".1.3.6.1.4.1.2468.1.4.2.1.3.2.3.1.3."; my $oid_outletenergy = ".1.3.6.1.4.1.2468.1.4.2.1.3.2.3.1.4."; @@ -219,7 +219,7 @@ if (defined $ARGV[0] and $ARGV[0] eq "config") { print "graph_args --base 1000 -l 0\n"; print "graph_category sensors\n"; print "graph_info This graph shows the tension and frequency to inlet $socketnumber on the Power Distribution Unit\n"; - + print "voltage.label Tension (V)\n"; print "voltage.draw LINE2\n"; print "voltage.type GAUGE\n"; @@ -235,7 +235,7 @@ if (defined $ARGV[0] and $ARGV[0] eq "config") { print "graph_args --base 1000 -l 0\n"; print "graph_category sensors\n"; print "graph_info This graph shows the delivered current to inlet $socketnumber on the Power Distribution Unit\n"; - + print "current.label Current (A)\n"; print "current.draw AREA\n"; print "current.type GAUGE\n"; @@ -247,43 +247,43 @@ if (defined $ARGV[0] and $ARGV[0] eq "config") { print "graph_args --base 1000 -l 0\n"; print "graph_category sensors\n"; print "graph_info This graph shows the delivered apparent and real power to inlet $socketnumber of the Power Distribution Unit\n"; - + print "apparentpower.label Apparent power (kVA)\n"; print "apparentpower.draw LINE3\n"; print "apparentpower.type GAUGE\n"; - + print "realpower.label Real power (kW)\n"; print "realpower.draw AREA\n"; print "realpower.type COUNTER\n"; - + exit 0; } elsif ($graphtype eq "outletcurrent") { print "graph_title Outlet $socketnumber current\n"; - + print "graph_args --base 1000 -l 0\n"; print "graph_category sensors\n"; print "graph_info This graph shows the delivered current to outlet $socketnumber of the Power Distribution Unit\n"; - + print "current.label Delivered current (A)\n"; print "current.draw AREA\n"; print "current.type GAUGE\n"; } elsif ($graphtype eq "outletpower") { print "graph_title Outlet $socketnumber power\n"; - + print "graph_args --base 1000 -l 0\n"; print "graph_category sensors\n"; print "graph_info This graph shows the delivered apparent and real power to outlet $socketnumber of the Power Distribution Unit\n"; - + print "apparentpower.label Apparent power (kVA)\n"; print "apparentpower.draw LINE3\n"; print "apparentpower.type GAUGE\n"; - + print "realpower.label Real power (kW)\n"; print "realpower.draw AREA\n"; print "realpower.type COUNTER\n"; - + exit 0; } exit 0; @@ -342,7 +342,7 @@ elsif ($graphtype eq "inletcurrent") { } elsif ($graphtype eq "inletpower") { my ($current, $energy, $voltage, $apparentpower); - + if (defined ($response = $session->get_request($oid_inletcurrent.$socketnumber))) { $current = $response->{$oid_inletcurrent.$socketnumber}; } @@ -402,7 +402,7 @@ elsif ($graphtype eq "outletcurrent") { } elsif ($graphtype eq "outletpower") { my ($current, $energy, $voltage, $apparentpower); - + if (defined ($response = $session->get_request($oid_outletcurrent.$socketnumber))) { $current = $response->{$oid_outletcurrent.$socketnumber}; } diff --git a/plugins/power/snmp__sentry b/plugins/power/snmp__sentry index 4631b0c4..32ddece0 100755 --- a/plugins/power/snmp__sentry +++ b/plugins/power/snmp__sentry @@ -31,9 +31,9 @@ Sentry3-MIB::infeedID.1.3 = STRING: AC Sentry3-MIB::infeedName.1.1 = STRING: Master_X Sentry3-MIB::infeedName.1.2 = STRING: Master_Y Sentry3-MIB::infeedName.1.3 = STRING: Master_Z -Sentry3-MIB::infeedCapabilities.1.1 = BITS: C6 00 onSense(0) loadSense(1) voltageSense(5) powerSense(6) -Sentry3-MIB::infeedCapabilities.1.2 = BITS: C6 00 onSense(0) loadSense(1) voltageSense(5) powerSense(6) -Sentry3-MIB::infeedCapabilities.1.3 = BITS: C6 00 onSense(0) loadSense(1) voltageSense(5) powerSense(6) +Sentry3-MIB::infeedCapabilities.1.1 = BITS: C6 00 onSense(0) loadSense(1) voltageSense(5) powerSense(6) +Sentry3-MIB::infeedCapabilities.1.2 = BITS: C6 00 onSense(0) loadSense(1) voltageSense(5) powerSense(6) +Sentry3-MIB::infeedCapabilities.1.3 = BITS: C6 00 onSense(0) loadSense(1) voltageSense(5) powerSense(6) Sentry3-MIB::infeedStatus.1.1 = INTEGER: on(1) Sentry3-MIB::infeedStatus.1.2 = INTEGER: on(1) Sentry3-MIB::infeedStatus.1.3 = INTEGER: on(1) @@ -153,7 +153,7 @@ graph_info This shows the amperage drawn on your PDU. Per NEC, a PDU should not my $infeedName = $sentry_h->{$k}->{'infeedName'}; my $critical = ($sentry_h->{$k}->{'infeedCapacity'})*.9; # 90% of capacity my $warning = $sentry_h->{$k}->{'infeedLoadHighThresh'}; # 80% of capacity - + print "$infeedName.critical $critical\n"; print "$infeedName.draw LINE1\n"; print "$infeedName.label $infeedName\n"; @@ -175,7 +175,7 @@ graph_info Power factor represents the efficiency of the components connected to foreach my $k ( keys %{$sentry_h} ) { my $infeedName = $sentry_h->{$k}->{'infeedName'}; - + print "$infeedName.draw LINE1\n"; print "$infeedName.label $infeedName\n"; print "$infeedName.type GAUGE\n"; @@ -194,7 +194,7 @@ graph_info Crest factor relates the peak value of a signal to its root mean squa foreach my $k ( keys %{$sentry_h} ) { my $infeedName = $sentry_h->{$k}->{'infeedName'}; - + print "$infeedName.draw LINE1\n"; print "$infeedName.label $infeedName\n"; print "$infeedName.type GAUGE\n"; diff --git a/plugins/power5/consumed_cpu_cycles b/plugins/power5/consumed_cpu_cycles index 950c31a6..070f04bd 100755 --- a/plugins/power5/consumed_cpu_cycles +++ b/plugins/power5/consumed_cpu_cycles @@ -42,9 +42,9 @@ if [ "$1" = "config" ]; then echo 'graph_category cpu' echo 'graph_vlabel CPU cycles' echo 'graph_info This graph shows the CPU cycles on an uncapped LPAR' - + echo 'cpuCycles.label used CPU cycles' - + exit 0 fi diff --git a/plugins/power5/cpu_in_lpar b/plugins/power5/cpu_in_lpar index aab20829..9d91f63a 100755 --- a/plugins/power5/cpu_in_lpar +++ b/plugins/power5/cpu_in_lpar @@ -41,10 +41,10 @@ if [ "$1" = "config" ]; then echo 'graph_category cpu' echo 'graph_vlabel CPUs in LPAR' echo 'graph_info This graph shows potential and active processors for a LPAR.' - + echo 'potentialLparCpu.label partition potential processors' echo 'activeLparCpu.label partition active processors' - + exit 0 fi diff --git a/plugins/power5/weight_of_a_lpar b/plugins/power5/weight_of_a_lpar index 2d2e2b05..fbf32209 100755 --- a/plugins/power5/weight_of_a_lpar +++ b/plugins/power5/weight_of_a_lpar @@ -43,9 +43,9 @@ if [ "$1" = "config" ]; then echo 'graph_info This graph shows the weight of an uncapped LPAR' echo 'weight.min 0' echo 'weight.max 255' - + echo 'LparWeight.label weight' - + exit 0 fi diff --git a/plugins/powermta/pmta_ b/plugins/powermta/pmta_ index cace6ce9..6c1e70db 100755 --- a/plugins/powermta/pmta_ +++ b/plugins/powermta/pmta_ @@ -12,21 +12,21 @@ # Copyright (c) 2011, emarsys eMarketing Systems AG # All rights reserved. # -# Redistribution and use in source and binary forms, with or without modification, are permitted provided that +# Redistribution and use in source and binary forms, with or without modification, are permitted provided that # the following conditions are met: # -# Redistributions of source code must retain the above copyright notice, this list of conditions and the -# following disclaimer. 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. Neither the name of the emarsys eMarketing Systems AG nor the names of its contributors may +# Redistributions of source code must retain the above copyright notice, this list of conditions and the +# following disclaimer. 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. Neither the name of the emarsys eMarketing Systems AG nor the names of its contributors may # be used to endorse or promote products derived from this software without specific prior written permission. # -# 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 A PARTICULAR PURPOSE ARE -# DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, -# SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR -# SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, -# WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE +# 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 A PARTICULAR PURPOSE ARE +# DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, +# SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR +# SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, +# WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE # USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. # # @@ -53,7 +53,7 @@ # lrwxrwxrwx 1 root root 5 2011-11-15 16:31 pmta_top_domains -> pmta_ # # o alternative multi-host configuration: -# you can also link the pmta_ script to various hosts and configure munin to respond +# you can also link the pmta_ script to various hosts and configure munin to respond # to multiple REMOTEHOSTs, just link pmta_ in this schema and configure munin # accordingly - DO NOT USE DOTS IN YOUR IDENTIFIER VARIABLE, USE UNDERSCORE INSTEAD! # for example: @@ -63,7 +63,7 @@ # lrwxrwxrwx 1 root root 5 2011-11-18 12:18 mailhost4_domain_com_pmta_top_domains -> pmta_ # [...] # -# conf.: +# conf.: # [mailhost1_domain_com_pmta*] # env.REMOTEHOST somehostORip # env.PORT portnumber @@ -91,18 +91,18 @@ fi fetch_xml() { # o arg1 specifies xpath or false # o arg2 specifies sed/regex or false - # o arg3 specifies category ('status', 'domains',..) or false + # o arg3 specifies category ('status', 'domains',..) or false HTTPQUERY="GET /${3}?format=xml HTTP/1.1\n\n" REMOTE=`echo ${HTTPQUERY} | nc -q 1 -w 5 ${REMOTEHOST} ${PORT} | tail -1` XML_DATA=${REMOTE} - SED="s/.*<$2>\([^<]*\)<\/$2>.*/\1/p" - + SED="s/.*<$2>\([^<]*\)<\/$2>.*/\1/p" + if [ "$3" = "status" ]; then RET=`echo $XML_DATA | xpath -q -e $1 | sed -n $SED | cut -f1 -d '.'` elif [ "$3" = "domains" ]; then RET=`echo $XML_DATA | xpath -q -e '//domain/*[self::name or self::rcp]' | sed 's/<[^>]*>//g' | sed 's/\./_/g'` - fi - + fi + if [ "$RET" ]; then echo $RET return 0 @@ -122,15 +122,15 @@ case $NAME_SELF in CONF_TITLE="powermta ${WHAT}bound traffic" CONF_LABEL="traffic_${WHAT}" CONF_SELF="traffic_${WHAT}bound" - - if [ -z $1 ]; then - GET=`fetch_xml //traffic//lastMin/${WHAT} kb status` + + if [ -z $1 ]; then + GET=`fetch_xml //traffic//lastMin/${WHAT} kb status` RETURN=`echo $GET / 1024 | bc` - RCPT=`fetch_xml //traffic//lastMin/${WHAT} rcp status` - MSGS=`fetch_xml //traffic//lastMin/${WHAT} msg status` + RCPT=`fetch_xml //traffic//lastMin/${WHAT} rcp status` + MSGS=`fetch_xml //traffic//lastMin/${WHAT} msg status` echo "megabytes.value $RETURN" echo "recipients.value $RCPT" - echo "messages.value $MSGS" + echo "messages.value $MSGS" exit 0 elif [ $1 = config ]; then echo "megabytes.label megabytes" @@ -154,10 +154,10 @@ case $NAME_SELF in CONF_TITLE=`echo "powermta ${WHAT}bound connections" | tr [:upper:] [:lower:]` CONF_LABEL=`echo "conn_${WHAT}" | tr [:upper:] [:lower:]` CONF_SELF=`echo "connections_${WHAT}bound" | tr [:upper:] [:lower:]` - if [ -z $1 ]; then - GET=`fetch_xml //conn//smtp${WHAT} cur status` + if [ -z $1 ]; then + GET=`fetch_xml //conn//smtp${WHAT} cur status` echo "${CONF_SELF}.value $GET" - exit 0 + exit 0 elif [ $1 = config ]; then echo "${CONF_SELF}.label ${WHAT}bound connections" echo "${CONF_SELF}.draw LINE1" @@ -165,7 +165,7 @@ case $NAME_SELF in AUTOLABEL="no" fi ;; - *pmta_queue_domains | *pmta_queue_recipients | *pmta_queue_megabytes) + *pmta_queue_domains | *pmta_queue_recipients | *pmta_queue_megabytes) if [ `expr match "$NAME_SELF" ".*pmta_queue_domains"` != 0 ]; then WHAT="domains" elif [ `expr match "$NAME_SELF" ".*pmta_queue_recipients"` != 0 ]; then @@ -175,28 +175,28 @@ case $NAME_SELF in UNIT_KB="true" fi CONF_TITLE="powermta ${WHAT} in queue" - CONF_LABEL="queue_${WHAT}" - CONF_SELF="${WHAT}" - + CONF_LABEL="queue_${WHAT}" + CONF_SELF="${WHAT}" + if [ -z $1 ]; then if [ !$UNIT_KB ]; then - GET=`fetch_xml //queue/smtp dom status` + GET=`fetch_xml //queue/smtp dom status` echo "${CONF_SELF}.value $GET" - exit 0 - else - GET=`fetch_xml //queue/smtp kb status` + exit 0 + else + GET=`fetch_xml //queue/smtp kb status` RETURN=`echo $GET / 1024 | bc` echo "${CONF_SELF}.value $RETURN" - exit 0 + exit 0 fi - fi + fi ;; *pmta_top_domains) CONF_TITLE="powermta top 10 domains by recipients" CONF_LABEL="top_domains" CONF_SELF="domains" AUTOLABEL="no" - + GET=`fetch_xml false false domains` if [ -z $1 ]; then for values in $GET; do @@ -204,7 +204,7 @@ case $NAME_SELF in echo $values else echo -n "$values.value#" - fi + fi done | tr ' ' '\n' | tr '#' ' ' # restore newline - replace hashtag with whitespace exit 0 elif [ $1 = config ]; then @@ -239,11 +239,11 @@ case $1 in fi fi exit 0 - ;; + ;; autoconf) # tell munin this script supports autoconfiguration: echo "yes" - ;; + ;; *) exit 1 ;; diff --git a/plugins/powermta/powermta_vmta_recpients b/plugins/powermta/powermta_vmta_recpients index f4fb697e..5d7d2752 100755 --- a/plugins/powermta/powermta_vmta_recpients +++ b/plugins/powermta/powermta_vmta_recpients @@ -39,4 +39,4 @@ domain=`echo "${queue[7]}" | awk -F" " '{print $1}' | cut -d/ -f1 | sed -e 's/[\ recpts=${queue[8]} conns=${queue[10]} echo $domain'.value '$recpts -done +done diff --git a/plugins/printer/hp2600_count_ b/plugins/printer/hp2600_count_ index 185db3de..3ebffdd8 100755 --- a/plugins/printer/hp2600_count_ +++ b/plugins/printer/hp2600_count_ @@ -15,11 +15,11 @@ get_data (){ do_stats () { count=1 - for I in `get_data`; do - [ $count = 3 ] && echo "countb.value $I" - [ $count = 6 ] && echo "county.value $I" - [ $count = 9 ] && echo "countc.value $I" - [ $count = 12 ] && echo "countm.value $I" + for I in `get_data`; do + [ $count = 3 ] && echo "countb.value $I" + [ $count = 6 ] && echo "county.value $I" + [ $count = 9 ] && echo "countc.value $I" + [ $count = 12 ] && echo "countm.value $I" count=$(($count + 1)) done @@ -33,7 +33,7 @@ graph_title HP 2600 pages by cartridge statistics graph_vlabel Count (Pages) graph_category printing graph_info Pages count by color. -graph_args -l 0 +graph_args -l 0 graph_scale no line.label --- line.line 0 diff --git a/plugins/printer/hp2600_status_ b/plugins/printer/hp2600_status_ index dcb36a24..a02e91c0 100755 --- a/plugins/printer/hp2600_status_ +++ b/plugins/printer/hp2600_status_ @@ -15,11 +15,11 @@ get_data (){ do_stats () { count=1 - for I in `get_data`; do - [ $count = 1 ] && echo "statb.value $I" - [ $count = 4 ] && echo "staty.value $I" - [ $count = 7 ] && echo "statc.value $I" - [ $count = 10 ] && echo "statm.value $I" + for I in `get_data`; do + [ $count = 1 ] && echo "statb.value $I" + [ $count = 4 ] && echo "staty.value $I" + [ $count = 7 ] && echo "statc.value $I" + [ $count = 10 ] && echo "statm.value $I" count=$(($count + 1)) done @@ -29,11 +29,11 @@ case $1 in config) cat <<'EOF' host_name printers -graph_title HP 2600 cartridge status +graph_title HP 2600 cartridge status graph_vlabel Status (%) graph_category printing graph_info Toner status. -graph_args --upper-limit 400 -l 0 +graph_args --upper-limit 400 -l 0 line.label --- line.line 400 statb.label Black diff --git a/plugins/printer/snmp__hpclj b/plugins/printer/snmp__hpclj index ffa6083d..5b5b9e79 100755 --- a/plugins/printer/snmp__hpclj +++ b/plugins/printer/snmp__hpclj @@ -140,7 +140,7 @@ tray3.min 0 tray3.max 100 "; } - + print "multigraph hpclj_pagecount graph_category printing graph_title HP Printer Page Counters @@ -182,11 +182,11 @@ sub printPercentageValue { my $field = $_[0]; my $oid_cur = $_[1]; my $oid_max = $_[2]; - + if(not oidExists($oid_cur) || not oidExists($oid_max)){ return(0); } - + my $val_max = $session->get_single($oid_max) || 'U'; my $val_cur = $session->get_single($oid_cur); if ($val_max ne 'U') { @@ -199,11 +199,11 @@ sub printValue { } my $field = $_[0]; my $oid = $_[1]; - + if(not oidExists($oid)){ return(0); } - + my $val_cur = $session->get_single($oid) || 'U'; if ($val_cur ne 'U') { print $field, ".value ", $val_cur, "\n"; @@ -215,7 +215,7 @@ sub oidExists { } my $oid = $_[0]; my $val = $session->get_single($oid); - + if(!length $val || $val eq 'noSuchInstance' || $val eq 'U'){ return(0); }else{ diff --git a/plugins/printer/xerox-wc3220 b/plugins/printer/xerox-wc3220 index dc695333..983217e6 100755 --- a/plugins/printer/xerox-wc3220 +++ b/plugins/printer/xerox-wc3220 @@ -27,7 +27,7 @@ As is. #%# family=contrib #%# capabilities=autoconf - + =cut case $1 in @@ -51,7 +51,7 @@ esac wget -q -o /dev/null -O $TMP_DIR/$PRINTER_IP-Supplies.html http://$PRINTER_IP/status/Supplies.html -TONER_STR=$(grep "" "$TMP_DIR/$PRINTER_IP-Supplies.html") +TONER_STR=$(grep "" "$TMP_DIR/$PRINTER_IP-Supplies.html") #99% echo -n "black.value " @@ -59,4 +59,4 @@ echo $TONER_STR | egrep -o "5%>[0-9]{1,2}" | egrep -o "[0-9]{1,2}$" rm $TMP_DIR/$PRINTER_IP-Supplies.html - + diff --git a/plugins/printer/xerox-wc7232-consumables b/plugins/printer/xerox-wc7232-consumables index d427da3f..72c8ef30 100755 --- a/plugins/printer/xerox-wc7232-consumables +++ b/plugins/printer/xerox-wc7232-consumables @@ -27,7 +27,7 @@ As is. #%# family=contrib #%# capabilities=autoconf - + =cut case $1 in @@ -84,10 +84,10 @@ wget -q -o /dev/null -O $TMP_DIR/$PRINTER_IP-stsply.htm http://$PRINTER_IP/stspl #toner and drum cartriges have both status and percentage -TONER_STR=$(grep Toner "$TMP_DIR/$PRINTER_IP-stsply.htm") +TONER_STR=$(grep Toner "$TMP_DIR/$PRINTER_IP-stsply.htm") #info=info.concat([['Toner Cartridges',[['Cyan Toner [C]',0,77],['Magenta Toner [M]',7,1],['Yellow Toner [Y]',7,1],['Black Toner [K]',0,39]],3]]); -DRUM_STR=$(grep Drum "$TMP_DIR/$PRINTER_IP-stsply.htm") +DRUM_STR=$(grep Drum "$TMP_DIR/$PRINTER_IP-stsply.htm") #info=info.concat([['Drum Cartridges',[['Drum Cartridges',0,79]],1]]); echo -n "cyan.value " @@ -106,4 +106,4 @@ echo -n "drum.value " echo $DRUM_STR | egrep -o "s',[0-9],[0-9]{1,2}" | egrep -o "[0-9]{1,2}$" rm $TMP_DIR/$PRINTER_IP-stsply.htm - + diff --git a/plugins/qmail/qremote b/plugins/qmail/qremote index 2abe07ce..ddf8ec21 100755 --- a/plugins/qmail/qremote +++ b/plugins/qmail/qremote @@ -17,7 +17,7 @@ if [ "$1" = "config" ]; then cat < 0; my $where; @@ -82,7 +82,7 @@ sub do_stats { } } close $fh; - + save_state($stop_at); foreach my $rc (sort {$a<=>$b} keys %REJECT_CODES) { @@ -108,7 +108,7 @@ graph_total Total my $type; foreach $k (sort {$a<=>$b} keys %REJECT_CODES) { - print + print "r$k.label $REJECT_CODES{$k} r$k.type ABSOLUTE r$k.min 0 diff --git a/plugins/rabbitmq/rabbitmq_connections b/plugins/rabbitmq/rabbitmq_connections index f7adbc5a..fd755968 100755 --- a/plugins/rabbitmq/rabbitmq_connections +++ b/plugins/rabbitmq/rabbitmq_connections @@ -53,7 +53,7 @@ case $(whoami) in esac # If run with the "config"-parameter, give out information on how the -# graphs should look. +# graphs should look. if [ "$1" = "config" ]; then CONN_WARN=${conn_warn:-500} diff --git a/plugins/rabbitmq/rabbitmq_consumers b/plugins/rabbitmq/rabbitmq_consumers index 76ce6759..b3ac555b 100755 --- a/plugins/rabbitmq/rabbitmq_consumers +++ b/plugins/rabbitmq/rabbitmq_consumers @@ -1,5 +1,5 @@ #!/bin/sh -# +# # Plugin to monitor the queues of a virtual_host in RabbitMQ # # Usage: Link or copy into /etc/munin/node.d/ @@ -26,14 +26,14 @@ if [ "$1" = "autoconf" ]; then fi # If run with the "config"-parameter, give out information on how the -# graphs should look. +# graphs should look. HOME=/tmp/ VHOST=${vhost:-"/"} QUEUES=$(HOME=$HOME rabbitmqctl list_queues -p $VHOST name | \ grep -v '^Listing' | \ grep -v 'done\.$' | sed -e 's/[.=-]/_/g' ) - + if [ "$1" = "config" ]; then QUEUE_WARN=${queue_warn:-100} QUEUE_CRIT=${queue_crit:-500} diff --git a/plugins/rabbitmq/rabbitmq_messages b/plugins/rabbitmq/rabbitmq_messages index a1b8f688..ca7cece9 100755 --- a/plugins/rabbitmq/rabbitmq_messages +++ b/plugins/rabbitmq/rabbitmq_messages @@ -1,5 +1,5 @@ #!/bin/sh -# +# # Plugin to monitor the queues of a virtual_host in RabbitMQ # # Usage: Link or copy into /etc/munin/node.d/ @@ -26,14 +26,14 @@ if [ "$1" = "autoconf" ]; then fi # If run with the "config"-parameter, give out information on how the -# graphs should look. +# graphs should look. HOME=/tmp/ VHOST=${vhost:-"/"} QUEUES=$(HOME=$HOME rabbitmqctl list_queues -p $VHOST name | \ grep -v '^Listing' | \ grep -v 'done\.$' | sed -e 's/[.=-]/_/g' ) - + if [ "$1" = "config" ]; then QUEUE_WARN=${queue_warn:-10000} QUEUE_CRIT=${queue_crit:-20000} diff --git a/plugins/rabbitmq/rabbitmq_messages_unacknowledged b/plugins/rabbitmq/rabbitmq_messages_unacknowledged index d5d8f60f..a36a0a4d 100755 --- a/plugins/rabbitmq/rabbitmq_messages_unacknowledged +++ b/plugins/rabbitmq/rabbitmq_messages_unacknowledged @@ -1,5 +1,5 @@ #!/bin/sh -# +# # Plugin to monitor the queues of a virtual_host in RabbitMQ # # Usage: Link or copy into /etc/munin/node.d/ @@ -26,14 +26,14 @@ if [ "$1" = "autoconf" ]; then fi # If run with the "config"-parameter, give out information on how the -# graphs should look. +# graphs should look. HOME=/tmp/ VHOST=${vhost:-"/"} QUEUES=$(HOME=$HOME rabbitmqctl list_queues -p $VHOST name | \ grep -v '^Listing' | \ grep -v 'done\.$' | sed -e 's/[.=-]/_/g' ) - + if [ "$1" = "config" ]; then QUEUE_WARN=${queue_warn:-10000} QUEUE_CRIT=${queue_crit:-20000} diff --git a/plugins/rabbitmq/rabbitmq_messages_uncommitted b/plugins/rabbitmq/rabbitmq_messages_uncommitted index 179d2e60..c3e6fadf 100755 --- a/plugins/rabbitmq/rabbitmq_messages_uncommitted +++ b/plugins/rabbitmq/rabbitmq_messages_uncommitted @@ -1,5 +1,5 @@ #!/bin/sh -# +# # Plugin to monitor the queues of a virtual_host in RabbitMQ # # Usage: Link or copy into /etc/munin/node.d/ @@ -26,14 +26,14 @@ if [ "$1" = "autoconf" ]; then fi # If run with the "config"-parameter, give out information on how the -# graphs should look. +# graphs should look. HOME=/tmp/ VHOST=${vhost:-"/"} QUEUES=$(HOME=$HOME rabbitmqctl list_queues -p $VHOST name | \ grep -v '^Listing' | \ grep -v 'done\.$' | sed -e 's/[.=-]/_/g' ) - + if [ "$1" = "config" ]; then QUEUE_WARN=${queue_warn:-10000} QUEUE_CRIT=${queue_crit:-20000} diff --git a/plugins/rabbitmq/rabbitmq_queue_memory b/plugins/rabbitmq/rabbitmq_queue_memory index fef2cc7b..253a15a6 100755 --- a/plugins/rabbitmq/rabbitmq_queue_memory +++ b/plugins/rabbitmq/rabbitmq_queue_memory @@ -1,5 +1,5 @@ #!/bin/sh -# +# # Plugin to monitor the queues of a virtual_host in RabbitMQ # # Usage: Link or copy into /etc/munin/node.d/ @@ -26,14 +26,14 @@ if [ "$1" = "autoconf" ]; then fi # If run with the "config"-parameter, give out information on how the -# graphs should look. +# graphs should look. HOME=/tmp/ VHOST=${vhost:-"/"} QUEUES=$(HOME=$HOME rabbitmqctl list_queues -p $VHOST name | \ grep -v '^Listing' | \ grep -v 'done\.$' | sed -e 's/[.=-]/_/g' ) - + if [ "$1" = "config" ]; then QUEUE_WARN=${queue_warn:-104857600} # 100 MB QUEUE_CRIT=${queue_crit:-209715200} # 200 MB diff --git a/plugins/rackspace/README b/plugins/rackspace/README index 9faf8c8d..25ba1fd1 100644 --- a/plugins/rackspace/README +++ b/plugins/rackspace/README @@ -1,5 +1,5 @@ ====================================================================================== -These plugins are made to monitor RackSpace Cloudfiles storage usage and files +These plugins are made to monitor RackSpace Cloudfiles storage usage and files count. ====================================================================================== diff --git a/plugins/rackspace/rackspace_cdn_count.php b/plugins/rackspace/rackspace_cdn_count.php index d1ee8cbb..111d6590 100755 --- a/plugins/rackspace/rackspace_cdn_count.php +++ b/plugins/rackspace/rackspace_cdn_count.php @@ -5,7 +5,7 @@ # Parameters: # # config (required) -# +# # #%# family=manual diff --git a/plugins/raspberry-pi/cpu_freq_1sec b/plugins/raspberry-pi/cpu_freq_1sec index 62a26523..6bd0d6bf 100755 --- a/plugins/raspberry-pi/cpu_freq_1sec +++ b/plugins/raspberry-pi/cpu_freq_1sec @@ -1,8 +1,8 @@ #! /bin/sh -# -# This is a small supersampling plugin that does +# +# This is a small supersampling plugin that does # cpu sampling every 1 second. -# +# # (c) 2013 - LGPL - Steve Schnepp pluginfull="$0" # full name of plugin diff --git a/plugins/reddit_karma/reddit_karma_ b/plugins/reddit_karma/reddit_karma_ index 9ff633c7..3d3ead68 100755 --- a/plugins/reddit_karma/reddit_karma_ +++ b/plugins/reddit_karma/reddit_karma_ @@ -3,7 +3,7 @@ # reddit_karma_ ########################## # Munin Plugin to track the karma activity of a Reddit user. -# +# # Copyright 2012 Mark Caudill # # This program is free software: you can redistribute it and/or modify @@ -12,7 +12,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. # diff --git a/plugins/redis/redis_ b/plugins/redis/redis_ index 55474435..77c506d2 100755 --- a/plugins/redis/redis_ +++ b/plugins/redis/redis_ @@ -128,7 +128,7 @@ switch ($0) { print "missratio.draw STACK\n"; exit 0; } - + my $total = $hash->{'keyspace_hits'} + $hash->{'keyspace_misses'}; my $hitratio = 0; my $missratio = 0; @@ -177,7 +177,7 @@ switch ($0) { print "used_memory_rss.value ". $hash->{'used_memory_rss'} ."\n"; print "used_memory_peak.value ". $hash->{'used_memory_peak'} ."\n"; } - + case "used_keys" { my $dbs; foreach my $key (keys %{$hash}) { @@ -210,18 +210,18 @@ switch ($0) { close ($sock); sub get_conn { - + my $sock; - + if( $UNIX_SOCKET && -S $UNIX_SOCKET ){ - + $sock = IO::Socket::UNIX->new( Type => SOCK_STREAM(), Peer => $UNIX_SOCKET, ); - + }else{ - + $sock = IO::Socket::INET->new( PeerAddr => $HOST, PeerPort => $PORT, @@ -229,7 +229,7 @@ sub get_conn { Proto => 'tcp' ); } - + if ( defined( $PASSWORD ) ) { print $sock "AUTH ", $PASSWORD, "\r\n"; my $result = <$sock> || die "can't read socket: $!"; diff --git a/plugins/redis/resque b/plugins/redis/resque index 23b75c73..c1a0dc58 100755 --- a/plugins/redis/resque +++ b/plugins/redis/resque @@ -120,8 +120,8 @@ elsif ($opt eq 'queues_size') { my $name = $queue; $name =~ s/:/_/; - my $size = $r->llen("${NAMESPACE}:queue:${queue}") || 0; - + my $size = $r->llen("${NAMESPACE}:queue:${queue}") || 0; + $total += $size; print "${name}_size.value ${size}\n"; diff --git a/plugins/router/ag241-adsl b/plugins/router/ag241-adsl index 9a3d7e63..19ebcbf4 100755 --- a/plugins/router/ag241-adsl +++ b/plugins/router/ag241-adsl @@ -9,7 +9,7 @@ # as per the instructions on the munin wiki # http://munin.projects.linpro.no/wiki/Using_SNMP_plugins # By default the SNMP server is disabled, you can enable it in the web admin -# You will need to set up the "virtual node" configuration as detailed +# You will need to set up the "virtual node" configuration as detailed # for snmp plugins # Plugin will require some configuration in /etc/munin/plugin-conf.d/ag241_MODEMADDRESS @@ -35,7 +35,7 @@ require 'net/http' #default parameters -host = nil +host = nil port = ENV['port'] || 80 user = ENV['user'] || 'admin' pass = ENV['pass'] || 'forhax' #dont remember what the default admin password was diff --git a/plugins/router/avm-fritzbox-wan-traffic b/plugins/router/avm-fritzbox-wan-traffic index adda3a73..164e9faf 100755 --- a/plugins/router/avm-fritzbox-wan-traffic +++ b/plugins/router/avm-fritzbox-wan-traffic @@ -6,7 +6,7 @@ # # Author: Andreas Kreisl # -# Licence: Creative Commons - Attribution-ShareAlike 3.0 Unported (CC BY-SA 3.0) +# Licence: Creative Commons - Attribution-ShareAlike 3.0 Unported (CC BY-SA 3.0) # http://creativecommons.org/licenses/by-sa/3.0/ # ############################## diff --git a/plugins/router/cisco-epc3010_ b/plugins/router/cisco-epc3010_ index e1b83638..d795587e 100755 --- a/plugins/router/cisco-epc3010_ +++ b/plugins/router/cisco-epc3010_ @@ -5,7 +5,7 @@ =head1 NAME -epc3010_ - munin-plugin to monitor Upstream/Downstream Power Levels and Signal to Noise Ratio on Cisco EPC3010 EuroDocsis 3.0 Data Modem +epc3010_ - munin-plugin to monitor Upstream/Downstream Power Levels and Signal to Noise Ratio on Cisco EPC3010 EuroDocsis 3.0 Data Modem =head1 CONFIGURATION @@ -43,9 +43,9 @@ DIRECTION=${0##*epc3010_} # Check if argument is autoconfig or config case "$1" in -autoconfig) +autoconfig) # Does your network have a Cisco EPC3010? - curl -s http://192.168.100.1/Docsis_system.asp | grep -q "Cisco EPC3010" + curl -s http://192.168.100.1/Docsis_system.asp | grep -q "Cisco EPC3010" if [ $? -eq 0 ]; then echo "yes" exit 0 @@ -54,7 +54,7 @@ autoconfig) exit 1 fi ;; -config) +config) if [ $DIRECTION == "downstream" ]; then printf "graph_title Cisco EPC3010 Downstream measurements\n"; printf "graph_args -l 0 --base 1000\n" diff --git a/plugins/router/conexant_adsl b/plugins/router/conexant_adsl index acf4b186..71ca6053 100755 --- a/plugins/router/conexant_adsl +++ b/plugins/router/conexant_adsl @@ -1,6 +1,6 @@ #!/bin/bash -# -# +# +# # Script to show adsl router stats for routers with Conexant based chips and the standard Conexant web admin gui like the eTec EpicRouter... # # Parameters understood: diff --git a/plugins/router/d-link-dir-655-router-statistics-plugin b/plugins/router/d-link-dir-655-router-statistics-plugin index 202e0538..7379c73d 100755 --- a/plugins/router/d-link-dir-655-router-statistics-plugin +++ b/plugins/router/d-link-dir-655-router-statistics-plugin @@ -43,15 +43,15 @@ def output agent = Mechanize.new x = agent.get(router_path) salt = x.body.match(/salt = "(.*)"/)[1] - + # pad the pasword to length 16 pad_size = (16 - password.length) padded_password = password + "\x01" * pad_size - + # pad it the rest of the way, length 64 for user salted_password = salt + padded_password + ("\x01" * (63 - salt.length - padded_password.length)) + "U" login_hash = salt + Digest::MD5.hexdigest(salted_password) - + # authenticate against the router using the hash that we just built login_path = "#{router_path}/post_login.xml?hash=#{login_hash}" x = agent.get(login_path) @@ -120,7 +120,7 @@ def output puts "#{i}_coll.value " + nics[i]["tx_collisions"] puts "#{i}_err.value " + nics[i]["rx_errors"] end - + # graph stats for each interface for i in [ "LAN", "WAN", "WLAN" ] do puts "multigraph if_packets.#{i}" @@ -215,7 +215,7 @@ def config puts 'send.type DERIVE' puts 'send.negative recv' puts 'send.min 0' - + puts "multigraph if_drop.#{i}" puts "graph_title D-Link DIR-655 #{i} drops" puts 'graph_category network' @@ -229,7 +229,7 @@ def config puts 'send.type DERIVE' puts 'send.negative recv' puts 'send.min 0' - + puts "multigraph if_collerr.#{i}" puts "graph_title D-Link DIR-655 #{i} collisions & errors" puts 'graph_category network' diff --git a/plugins/router/dsl-connection-speed b/plugins/router/dsl-connection-speed index 06984f1e..eb5a03c4 100755 --- a/plugins/router/dsl-connection-speed +++ b/plugins/router/dsl-connection-speed @@ -28,7 +28,7 @@ fi # create temp file for storing wget output TMPFILE=$(mktemp) -# if we have auth variables then add them to +# if we have auth variables then add them to # wget cmdline if [[ "$DSLUSER" != "" && "$DSLPASS" != "" ]] then diff --git a/plugins/router/dsl-stats b/plugins/router/dsl-stats index 58b4bf20..cfdeaf9c 100755 --- a/plugins/router/dsl-stats +++ b/plugins/router/dsl-stats @@ -41,7 +41,7 @@ fi TMPFILE=$(mktemp) -# if we have auth variables then add them to +# if we have auth variables then add them to # wget cmdline if [[ "$DSLUSER" != "" && "$DSLPASS" != "" ]] then diff --git a/plugins/router/freeboxuptime b/plugins/router/freeboxuptime index c7dcb654..7202f82d 100755 --- a/plugins/router/freeboxuptime +++ b/plugins/router/freeboxuptime @@ -22,7 +22,7 @@ # Running: HP embedded # OS details: HP Onboard Administrator management console # Uptime: 7.226 days (since Thu Dec 9 21:01:44 2010) -# +# # OS detection performed. Please report any incorrect results at http://nmap.org/submit/ . # Nmap done: 1 IP address (1 host up) scanned in 29.279 seconds # ---------------------------------------------------------------------------------------------------- @@ -71,7 +71,7 @@ if [ "$1" = "autoconf" ]; then echo "no (Freebox not reachable)" exit 2 else - echo yes + echo yes exit 0 fi fi @@ -87,7 +87,7 @@ if [ "$1" = "config" ]; then graph_info="Shows the uptime of your freebox (cache: ${CACHE_HOURS}h" if [ -f $CACHE_FILE ]; then lastCheck=$(stat -c %z $CACHE_FILE | cut -d"." -f1) - lastReboot=$(awk -F"@" '{print $2}' $CACHE_FILE) + lastReboot=$(awk -F"@" '{print $2}' $CACHE_FILE) graph_info="${graph_info} - last check: ${lastCheck} - last reboot: $lastReboot" else graph_info="${graph_info})" diff --git a/plugins/router/snmp__juniper b/plugins/router/snmp__juniper index da332ea8..e6568461 100755 --- a/plugins/router/snmp__juniper +++ b/plugins/router/snmp__juniper @@ -126,7 +126,7 @@ class JunOSSnmpClient(object): return int(varBindTable[0][1]) - + def get_data(self): devs = self.get_devices() @@ -179,7 +179,7 @@ else: if not (host and port and community): print "# Bad configuration. Cannot run with Host=%s, port=%s and community=%s" % (host, port, community) sys.exit(1) - + if "config" in sys.argv[1:]: c.print_config() else: diff --git a/plugins/router/snmp__juniper_spu b/plugins/router/snmp__juniper_spu index 920f0b83..5ceab231 100755 --- a/plugins/router/snmp__juniper_spu +++ b/plugins/router/snmp__juniper_spu @@ -222,7 +222,7 @@ else: if not (host and port and community): print "# Bad configuration. Cannot run with Host=%s, port=%s and community=%s" % (host, port, community) sys.exit(1) - + if "config" in sys.argv[1:]: c.print_config() else: diff --git a/plugins/router/snmp__linksys_poe b/plugins/router/snmp__linksys_poe index 886326db..0e5c9a4d 100755 --- a/plugins/router/snmp__linksys_poe +++ b/plugins/router/snmp__linksys_poe @@ -33,7 +33,7 @@ PoE ports. Information is gathered from Linksys' private MIB space, so it's probably only applicable to Linksys devices. I have been unable to get an actual copy of -the appropriate MIB, so I don't know the actual names of the values I'm +the appropriate MIB, so I don't know the actual names of the values I'm retrieving. =head1 MAGIC MARKERS diff --git a/plugins/router/speedport_300 b/plugins/router/speedport_300 index 4b5cd531..7f780b1d 100755 --- a/plugins/router/speedport_300 +++ b/plugins/router/speedport_300 @@ -1,8 +1,8 @@ #!/bin/bash # # -# Munin plugin to show the up- / download stream of the actual -# internet connection by reading the top_status.htm from the +# Munin plugin to show the up- / download stream of the actual +# internet connection by reading the top_status.htm from the # Speedport 300 # # diff --git a/plugins/router/tg585v7__ b/plugins/router/tg585v7__ index d410e893..1bf4e576 100755 --- a/plugins/router/tg585v7__ +++ b/plugins/router/tg585v7__ @@ -13,7 +13,7 @@ Requires perl and either WWW::Mechanize or Net::Telnet. =head1 CONFIGURATION The plugin needs HTML access to the router. If you can get to http://YOUR_ROUTER/, -and are greeting with a page titled "THOMSON TG585 v7", then you can probably use this plugin. +and are greeting with a page titled "THOMSON TG585 v7", then you can probably use this plugin. This is a wildcard plugin, so you will need to create symlinks to this plugin (or create copies if your filesystem doesn't support linking). Links should be of the form: diff --git a/plugins/rsync/rsyncd_bytes b/plugins/rsync/rsyncd_bytes index d290282b..985086e7 100755 --- a/plugins/rsync/rsyncd_bytes +++ b/plugins/rsync/rsyncd_bytes @@ -12,7 +12,7 @@ mktempfile () { mktemp -t $1 -} +} RSYNCD_LOG=${logfile:-/var/log/rsyncd.log} LOGTAIL=${logtail:-`which logtail`} diff --git a/plugins/rsync/rsyncd_count b/plugins/rsync/rsyncd_count index 9b3a8afd..ec04c3f4 100755 --- a/plugins/rsync/rsyncd_count +++ b/plugins/rsync/rsyncd_count @@ -12,7 +12,7 @@ mktempfile () { mktemp -t $1 -} +} RSYNCD_LOG=${logfile:-/var/log/rsyncd.log} LOGTAIL=${logtail:-`which logtail`} diff --git a/plugins/rtorrent/rtom_mem b/plugins/rtorrent/rtom_mem index eb8a5850..afb00cef 100755 --- a/plugins/rtorrent/rtom_mem +++ b/plugins/rtorrent/rtom_mem @@ -34,7 +34,7 @@ # user username # env.src socket # env.socket /home/user/torrent/.socket/rpc.socket -# env.category Category +# env.category Category # # [rtom_mem] # env.ip 127.0.0.1 diff --git a/plugins/s3/s3_items b/plugins/s3/s3_items index 44511240..d31c149f 100755 --- a/plugins/s3/s3_items +++ b/plugins/s3/s3_items @@ -3,7 +3,7 @@ use strict; -my $s3_id = exists $ENV{'s3_id'} ? $ENV{'s3_id'} : "user"; +my $s3_id = exists $ENV{'s3_id'} ? $ENV{'s3_id'} : "user"; my $s3cmd = 's3curl.pl --id ' . $s3_id . ' http://s3.amazonaws.com/'; @@ -29,14 +29,14 @@ sub get_bucket_list() { my @bucket_list = (); my $pos = 0; - + while ($str =~ /.([\w._-]+)<\/Name>/) { $bucket_list[$pos++] = $1; $str = $'; - } + } - return @bucket_list; + return @bucket_list; } @@ -47,16 +47,16 @@ my ($name) = @_; my $stats = `$s3cmd_local`; my %res; - - $res{'size'} = 0; - $res{'count'} = 0; - + + $res{'size'} = 0; + $res{'count'} = 0; + while ($stats =~ /.([\w._-]+)<\/Size>/) { $stats = $'; - + $res{'size'} += $1; $res{'count'}++; - } + } return %res; } @@ -69,32 +69,32 @@ if ( $ARGV[0] eq "config" ) { print "graph_category cloud\n"; print "graph_vlabel items\n"; print 'graph_info Plugin available at http://www.ohardt.com/dev/munin/' . "\n"; - + my @bucket_list = get_bucket_list(); - + my $bucket_name; - + foreach $bucket_name ( @bucket_list ) { - - print $bucket_name . ".label Bucket " . $bucket_name . "\n"; - - } + + print $bucket_name . ".label Bucket " . $bucket_name . "\n"; + + } exit; - - + + } my @bucket_list = get_bucket_list(); my $bucket_name; - + foreach $bucket_name ( @bucket_list ) { - - my %stats = get_bucket_stats( $bucket_name ); - + + my %stats = get_bucket_stats( $bucket_name ); + print $bucket_name . ".value " . $stats{'count'} . "\n"; } - \ No newline at end of file + diff --git a/plugins/s3/s3_storage b/plugins/s3/s3_storage index ac73a125..3fda1d7c 100755 --- a/plugins/s3/s3_storage +++ b/plugins/s3/s3_storage @@ -3,7 +3,7 @@ use strict; use warnings; -my $s3_id = exists $ENV{'s3_id'} ? $ENV{'s3_id'} : "user"; +my $s3_id = exists $ENV{'s3_id'} ? $ENV{'s3_id'} : "user"; my $s3curl = "perl s3-curl/s3curl.pl --id $s3_id -- -s -S"; sub get_bucket_list() @@ -11,13 +11,13 @@ sub get_bucket_list() my $buckets = `$s3curl http://s3.amazonaws.com`; my $str = $buckets; my @bucket_list; - + while ($buckets =~ s/.([\w._-]+)<\/Name>//) { push @bucket_list, $1; - } + } - return @bucket_list; + return @bucket_list; } my @bucket_list = split /\s+/, ($ENV{'buckets'} || ''); @@ -45,9 +45,9 @@ sub get_bucket_stats my ($name) = @_; my $stats = `$s3curl http://$name.s3.amazonaws.com`; my %res; - + $res{'size'} = 0; - + while ($stats =~ s/.([\w._-]+)<\/Size>//) { $res{'size'} += $1; @@ -65,18 +65,18 @@ if ($ARGV[0] and $ARGV[0] eq "config") print "graph_args --base 1024 -l 0\n"; print "graph_vlabel bytes\n"; print "graph_info Plugin available at https://github.com/aptivate/munin-contrib/blob/master/plugins/s3/s3_storage\n"; - + foreach my $bucket_name (@bucket_list) { print "$bucket_name.label Bucket $bucket_name\n"; - } + } exit; } foreach my $bucket_name (@bucket_list) { - my %stats = get_bucket_stats($bucket_name); + my %stats = get_bucket_stats($bucket_name); print "$bucket_name.value " . $stats{'size'} . "\n"; } diff --git a/plugins/sabnzbd/sabnzbd_dataleft b/plugins/sabnzbd/sabnzbd_dataleft index 1f56ea8b..3eed92c8 100755 --- a/plugins/sabnzbd/sabnzbd_dataleft +++ b/plugins/sabnzbd/sabnzbd_dataleft @@ -6,7 +6,7 @@ # # SABnzbd : http://sabnzbd.org/ # -# This program is free software: you can redistribute it and/or modify +# 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 3 of the License, or # (at your option) any later version. @@ -26,7 +26,7 @@ # [sabnzbd*] # env.host http://host:port/ # env.api apikey -# +# use strict; use XML::Simple; @@ -62,7 +62,7 @@ my $req = $get->get($sURL); my $vals = $req->content(); my $xmlvals = $xml->XMLin($vals); -#get/output vals +#get/output vals my $left = $xmlvals->{mbleft}; $left =~ /(\d+)\./; print "rem.value ".$1."\n"; diff --git a/plugins/sabnzbd/sabnzbd_speed b/plugins/sabnzbd/sabnzbd_speed index fb466c7b..af48066d 100755 --- a/plugins/sabnzbd/sabnzbd_speed +++ b/plugins/sabnzbd/sabnzbd_speed @@ -6,7 +6,7 @@ # # SABnzbd : http://sabnzbd.org/ # -# This program is free software: you can redistribute it and/or modify +# 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 3 of the License, or # (at your option) any later version. @@ -26,7 +26,7 @@ # [sabnzbd*] # env.host http://host:port/ # env.api apikey -# +# use strict; use XML::Simple; @@ -65,4 +65,4 @@ my $xmlvals = $xml->XMLin($vals); #get/output vals my $speed = $xmlvals->{kbpersec}; $speed =~ /(\d+)\./; -print "speed.value ".$1."\n"; +print "speed.value ".$1."\n"; diff --git a/plugins/samba/samba_locked b/plugins/samba/samba_locked index d591510e..a9b00e18 100755 --- a/plugins/samba/samba_locked +++ b/plugins/samba/samba_locked @@ -8,8 +8,8 @@ # autoconf (optional - used by munin-config) # # $Log$ -# Revision 1.0 2007/04/16 Jon Higgs -# Initial Release - Adapted from jimmyo's processses plugin. +# Revision 1.0 2007/04/16 Jon Higgs +# Initial Release - Adapted from jimmyo's processses plugin. # # Magick markers (optional - used by munin-config and som installation # scripts): @@ -17,7 +17,7 @@ #%# capabilities=autoconf if [ "$1" = "autoconf" ]; then - echo yes + echo yes exit 0 fi @@ -25,7 +25,7 @@ if [ "$1" = "config" ]; then echo 'graph_title Samba Locked Files' echo 'graph_args --base 1000 -l 0 ' - echo 'graph_vlabel number of locked files' + echo 'graph_vlabel number of locked files' echo 'graph_category fs' echo 'graph_info This graph shows the number locked Samba Files.' echo 'samba_locked.label Locked Files' diff --git a/plugins/samba/samba_users b/plugins/samba/samba_users index 4bf00d56..e125e52c 100755 --- a/plugins/samba/samba_users +++ b/plugins/samba/samba_users @@ -8,13 +8,13 @@ # autoconf (optional - used by munin-config) # # $Log$ -# Revision 1.0 2007/04/16 Jon Higgs -# Initial Release - Adapted from jimmyo's processses plugin. +# Revision 1.0 2007/04/16 Jon Higgs +# Initial Release - Adapted from jimmyo's processses plugin. # # Revision 1.1 2014/07/24 MangaII # Add exit 0 # WARNING : Samba 3.6 and newer block access to smbstatus for no root user -# On Debian make a "chmod a+w /run/samba/sessionid.tdb" +# On Debian make a "chmod a+w /run/samba/sessionid.tdb" # smbstatus must open this file with RW option # # Magick markers (optional - used by munin-config and som installation @@ -23,7 +23,7 @@ #%# capabilities=autoconf if [ "$1" = "autoconf" ]; then - echo yes + echo yes exit 0 fi @@ -31,7 +31,7 @@ if [ "$1" = "config" ]; then echo 'graph_title Samba Users' echo 'graph_args --base 1000 -l 0 ' - echo 'graph_vlabel number of Samba users.' + echo 'graph_vlabel number of Samba users.' echo 'graph_category fs' echo 'graph_info This graph shows the number Samba users.' echo 'samba_users.label Samba Users' diff --git a/plugins/san/emc_comprehensive/emc_comprehensive b/plugins/san/emc_comprehensive/emc_comprehensive index 174944aa..2d5c3742 100755 --- a/plugins/san/emc_comprehensive/emc_comprehensive +++ b/plugins/san/emc_comprehensive/emc_comprehensive @@ -46,14 +46,14 @@ FILE: for my $file (@files) { my $object_name = shift @row; my $epoch = shift @row; my $owner_array_name = shift @row; - + # Ignore if too old next if ($epoch <= $spool_fetch_epoch); # Don't do too much work : 4h each time is enough $first_epoch ||= $epoch; next if $epoch > $first_epoch + 60 * 60 * 4; - + # Store Values for (my $idx = 0; $idx < $nb_headers; $idx ++) { @@ -91,26 +91,26 @@ multigraph san graph_title Vue globale graph_order \ cpu_sp_a=san.cpu.sp_a \ - cpu_sp_b=san.cpu.sp_b + cpu_sp_b=san.cpu.sp_b EOF ; # CPU my @object_names = keys %$values; - gen_multigraph( - $values, + gen_multigraph( + $values, "cpu", [ grep { /^SP / } @object_names ], ); # DISK - gen_multigraph( + gen_multigraph( $values, "disk", [ grep { /^Bus \d+/ } @object_names ], ); # Port - gen_multigraph( + gen_multigraph( $values, "port", [ grep { /^Port / } @object_names ], @@ -118,7 +118,7 @@ EOF ); # Pool - gen_multigraph( + gen_multigraph( $values, "pool", [ grep { /^Pool / } @object_names ], @@ -130,17 +130,17 @@ multigraph san.lun graph_title Luns Global graph_order \ cpu_sp_a=san.cpu.sp_a \ - cpu_sp_b=san.cpu.sp_b + cpu_sp_b=san.cpu.sp_b EOF ; # LUN Per Host my %host_seen; - my @hosts = grep { $_ ne "" } grep { ! $host_seen{$_}++ } + my @hosts = grep { $_ ne "" } grep { ! $host_seen{$_}++ } map { $1 if /^\w+ \[\d+; (\w+)/ } @object_names; for my $host (@hosts) { my $host_field = $host; $host_field =~ tr/./_/; - gen_multigraph( + gen_multigraph( $values, "lun.$host_field", [ grep { /^\w+ \[\d+; $host/ } @object_names ], @@ -153,7 +153,7 @@ EOF last; } -sub gen_multigraph +sub gen_multigraph { my ($values, $category, $object_names, $convert_to_label, $convert_to_field) = @_; @@ -169,7 +169,7 @@ multigraph san.$category graph_title $category Global graph_order \ cpu_sp_a=san.cpu.sp_a \ - cpu_sp_b=san.cpu.sp_b + cpu_sp_b=san.cpu.sp_b EOF ; @@ -191,7 +191,7 @@ EOF } } -sub hash_field_name +sub hash_field_name { my $name = shift; $name = lc($name); @@ -212,7 +212,7 @@ sub trim sub file_mtime { my ($dev,$ino,$mode,$nlink,$uid,$gid,$rdev,$size, $atime,$mtime,$ctime,$blksize,$blocks) = stat(shift); - return $mtime; + return $mtime; } __DATA__ @@ -254,7 +254,7 @@ EOF print ".\n"; my %MONTHS = get_months(); -sub convert_to_epoch +sub convert_to_epoch { # converts "05/12/2011 03:57" to EPOCH my ($date, $time) = split(/ /); @@ -302,7 +302,7 @@ multigraph san graph_title Vue globale graph_order \ cpu_sp_a=san.cpu.cpu_sp_a \ - cpu_sp_b=san.cpu.cpu_sp_b + cpu_sp_b=san.cpu.cpu_sp_b multigraph san.cpu graph_title Utilization (%) cpu_sp_a.label Utilization (%) for SP A diff --git a/plugins/scalix/scalix_clients b/plugins/scalix/scalix_clients index a4bdfc88..d4880116 100755 --- a/plugins/scalix/scalix_clients +++ b/plugins/scalix/scalix_clients @@ -1,12 +1,12 @@ #!/bin/sh -# +# # Plugin to monitor the Scalix email system: Client statistics # # (C) 2008 P.Holzleitner # #%# family=contrib -OMSTAT="/opt/scalix/bin/omstat" +OMSTAT="/opt/scalix/bin/omstat" if [ "$1" = "config" ]; then diff --git a/plugins/scalix/scalix_indexwork b/plugins/scalix/scalix_indexwork index 2b1a0a57..4b53a052 100755 --- a/plugins/scalix/scalix_indexwork +++ b/plugins/scalix/scalix_indexwork @@ -1,12 +1,12 @@ #!/usr/bin/perl -# +# # Plugin to monitor the Scalix email system. # # $Log$ # # # Parameters: -# +# # config (required) # autoconf (optional - used by munin-config) # diff --git a/plugins/scalix/scalix_processes b/plugins/scalix/scalix_processes index 6c39052e..6a620c6e 100755 --- a/plugins/scalix/scalix_processes +++ b/plugins/scalix/scalix_processes @@ -1,5 +1,5 @@ #!/bin/sh -# +# # Plugin to monitor the Scalix email system: Process statistics # # (C) 2008 P.Holzleitner diff --git a/plugins/scalix/scalix_queues b/plugins/scalix/scalix_queues index 50ea7607..802a44bc 100755 --- a/plugins/scalix/scalix_queues +++ b/plugins/scalix/scalix_queues @@ -1,5 +1,5 @@ #!/bin/sh -# +# # Plugin to monitor the Scalix email system: Queue statistics # # (C) 2008 P.Holzleitner @@ -7,7 +7,7 @@ # #%# family=contrib -OMSTAT="/opt/scalix/bin/omstat" +OMSTAT="/opt/scalix/bin/omstat" if [ "$1" = "config" ]; then diff --git a/plugins/security/forefront_ b/plugins/security/forefront_ index 951db439..eb9b61d4 100755 --- a/plugins/security/forefront_ +++ b/plugins/security/forefront_ @@ -3,7 +3,7 @@ # Plugin to monitor Forefront Client Security status in MOM database # # Copyright (c) 2008 Rune Nordbøe Skillingstad - -# +# # 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; version 2 dated June, 1991. @@ -18,17 +18,17 @@ # Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, # USA. # -# Parameters: +# Parameters: # # config # autoconf # suggest # # Config variables -# +# # dsn - If DSN name differs from hostname # dbuser - Valid MS SQL user (Windows authentication is possible using "DOMAIN\user") -# dbpass - Password +# dbpass - Password # # Install guide: # This plugin relies on correct configured ODBC for the MOM database @@ -36,28 +36,28 @@ # * Install and configure FreeTDS and DBD::Sybase (packages tdsodbc and libdbd-sybase-perl on Ubuntu) # - DBD::Sybase is preferred over ODBC because of strange TEXT field handling in DBD::ODBC # -# Example +# Example # /etc/freetds/freetds.conf: # [MyHost] # host = MyHost.domain.tld # port = 1433 # tds version = 7.0 -# +# # Copy this script to /usr/share/munin/plugins and run "munin-node-configure --shell" # If freetds.conf has one or more lines containing "host = ", the output will be something like this: # ln -s /usr/share/munin/plugins/forefront_ /etc/munin/plugins/forefront_MyHost.Domain.tld_computers # ln -s /usr/share/munin/plugins/forefront_ /etc/munin/plugins/forefront_MyHost.domain.tld_deployments # ln -s /usr/share/munin/plugins/forefront_ /etc/munin/plugins/forefront_MyHost.domain.tld_status # -# To manually add, symlink forefront_ to forefront_MyHost.domain.tld_computers, -# forefront_MyHost.domain.tld_deployments and forefront_MyHost.domain.tld_status +# To manually add, symlink forefront_ to forefront_MyHost.domain.tld_computers, +# forefront_MyHost.domain.tld_deployments and forefront_MyHost.domain.tld_status # # Add your DSN and user/password to /etc/munin/plugin-conf.d/munin-node: # [forefront_MyHost.domain.tld_*] # env.dsn MyHost # env.dbuser # env.dbpass -# +# # On your munin server, add this to /etc/munin/munin.conf # # [MyHost.domain.tld] @@ -211,7 +211,7 @@ EOF my %profiles = &deployments_general(); foreach my $policy (sort(keys(%profiles))) { my $field = encode_base64($policy); - chomp($field); + chomp($field); print $field . ".label " . $profiles{$policy}{'name'} . "\n"; print $field . ".draw LINE2\n"; print $field . ".info Numer of computers having the " .$profiles{$policy}{'name'} . " profile.\n"; @@ -268,7 +268,7 @@ sub status_fetch { while(my @row = $sth->fetchrow_array) { $alerts{$row[0]} = 0; } - $sth = $dbh->prepare("SELECT al.Level, COUNT(a.AlertLevel) FROM Alert a, AlertLevel al WHERE a.AlertLevel = al.Level AND a.ResolutionState <> 255 GROUP BY al.Level", + $sth = $dbh->prepare("SELECT al.Level, COUNT(a.AlertLevel) FROM Alert a, AlertLevel al WHERE a.AlertLevel = al.Level AND a.ResolutionState <> 255 GROUP BY al.Level", {odbc_exec_direct => 1}); $sth->execute(); while(my @row = $sth->fetchrow_array) { @@ -300,7 +300,7 @@ sub deployments_general { $profiles{'d3b75be9-7125-4db1-8b24-93004bd9d88e'}{'instance'} = ""; $profiles{'d3b75be9-7125-4db1-8b24-93004bd9d88e'}{'count'} = 0; my $dbh = DBI->connect("DBI:Sybase:$dsn", $dbuser, $dbpass, { PrintError => 1, AutoCommit => 1}); - + my $sth = $dbh->prepare("SELECT Id, Name, LatestInstanceID From fcs_Profiles", {odbc_exec_direct => 1}); $sth->execute(); while(my @row = $sth->fetchrow_array) { diff --git a/plugins/senderscore/senderscore b/plugins/senderscore/senderscore index 4c6eb236..a7c2886f 100755 --- a/plugins/senderscore/senderscore +++ b/plugins/senderscore/senderscore @@ -2,7 +2,7 @@ # # Here's a plugin which lets you monitor your senderscore.org reputation. For # people sending a large amount of email - this might be useful. -# +# # Config env var used: # [senderscore] # env.senderscore_check_ip xxx.yyy.zzz.ttt @@ -75,7 +75,7 @@ if __name__ == "__main__": if os.environ['senderscore_check_ip'] == '': print "env.senderscore_check_ip not defined in munin config" sys.exit(1) - + ip = os.environ['senderscore_check_ip'] if len(sys.argv) > 1 and sys.argv[1] != '': diff --git a/plugins/sendmail/sendmail_mailq b/plugins/sendmail/sendmail_mailq index 64139226..e2bd69f7 100755 --- a/plugins/sendmail/sendmail_mailq +++ b/plugins/sendmail/sendmail_mailq @@ -46,7 +46,7 @@ Jose-Marcio Martins da Cruz - mailto:Jose-Marcio.Martins@mines-paristech.fr Ecole Nationale Superieure des Mines de Paris -=head1 VERSION +=head1 VERSION 1.0 - Jan, 04, 2014 diff --git a/plugins/sensors/alertme_keyfobsathome b/plugins/sensors/alertme_keyfobsathome index 1fbe3a1b..35179606 100755 --- a/plugins/sensors/alertme_keyfobsathome +++ b/plugins/sensors/alertme_keyfobsathome @@ -4,7 +4,7 @@ # alertme_power relies on http://code.google.com/p/alertmepi/ # to have been installed and working # -# 20110120 - update to use correct mixed case for AlertMe and remove cruft +# 20110120 - update to use correct mixed case for AlertMe and remove cruft # left over from creating this plugin from another script # # add to the plugins-conf.d/munin so that it can read the /etc/alertme files @@ -26,7 +26,7 @@ echo -n "KeyfobsAtHome.value " KFC=`/usr/local/bin/alertmepi.pl -k | wc -l` if [ $? -eq 0 ] ; then - echo $KFC + echo $KFC else echo U fi diff --git a/plugins/sensors/alertme_power b/plugins/sensors/alertme_power index d64aec40..303d03c8 100755 --- a/plugins/sensors/alertme_power +++ b/plugins/sensors/alertme_power @@ -4,7 +4,7 @@ # alertme_power relies on http://code.google.com/p/alertmepi/ # to have been installed and working # -# 20110120 - update to use correct mixed case for AlertMe and remove cruft +# 20110120 - update to use correct mixed case for AlertMe and remove cruft # left over from creating this plugin from another script # # add to the plugins-conf.d/munin so that it can read the /etc/alertme files diff --git a/plugins/sensors/allnet__ b/plugins/sensors/allnet__ index d27d309f..dcd70a6d 100755 --- a/plugins/sensors/allnet__ +++ b/plugins/sensors/allnet__ @@ -77,7 +77,7 @@ use XML::Simple; { package AuthAgent; use base 'LWP::UserAgent'; - + sub get_basic_credentials { if (defined($ENV{'username'}) && defined($ENV{'password'})) { return $ENV{'username'}, $ENV{'password'}; diff --git a/plugins/sensors/ip_thermo_125 b/plugins/sensors/ip_thermo_125 index 01dbe765..3ba4fce3 100755 --- a/plugins/sensors/ip_thermo_125 +++ b/plugins/sensors/ip_thermo_125 @@ -1,7 +1,7 @@ #!/usr/bin/perl # # Copyright (C) 2008 Yuriy Sabov -# Version 0.1 +# Version 0.1 # # Plugin to fetch temperature from "IP Thermo 125" ethernet thermometer # available at http://www.procontrol.hu/GyartasFejlesztes/Termekeink/IPThermoSimple/IPThermo125_eng.htm @@ -18,7 +18,7 @@ my ($hostname, $port, $line, $telnet); # "C" = Celsius, "F" = Fahrenheit -my $unit = $ENV{unit} || "C"; +my $unit = $ENV{unit} || "C"; $hostname = "10.10.10.10"; $port = 23; @@ -38,7 +38,7 @@ if (defined $ARGV[0] and $ARGV[0] eq "config") print "graph_args --base 1000 -l 0\n"; print "graph_category sensors\n"; print "graph_info This graph shows temperature using IP Thermo 125 server.\n"; - + if ($unit =~ /F/) { print "graph_vlabel temp in °F\n"; @@ -48,8 +48,8 @@ if (defined $ARGV[0] and $ARGV[0] eq "config") print "graph_vlabel temp in °C\n"; } print "temperature.label temperature\n"; - - exit 0 + + exit 0; } $telnet = new Net::Telnet (Telnetmode => 0); diff --git a/plugins/sensors/mbmon b/plugins/sensors/mbmon index da8c4480..0044bafe 100755 --- a/plugins/sensors/mbmon +++ b/plugins/sensors/mbmon @@ -37,16 +37,16 @@ temp2.label Temperature2 EOF ## more info from mbmon -# fan0 -# fan1 -# fan2 -# vc0 -# vc1 -# v33 -# v50p -# V12P -# V12N -# V50N +# fan0 +# fan1 +# fan2 +# vc0 +# vc1 +# v33 +# v50p +# V12P +# V12N +# V50N } else { my(@res) = `$mbmon -r -c 1`; diff --git a/plugins/sensors/nvclock b/plugins/sensors/nvclock index c15e59b7..c140c7c6 100755 --- a/plugins/sensors/nvclock +++ b/plugins/sensors/nvclock @@ -1,5 +1,5 @@ #!/bin/sh -# +# # plugin to monitor a nvidia graphic card temperature(s) # dynamically shows the sensor name (gpu, board...) # written by Dju diff --git a/plugins/sensors/voltcraft_tcm220_ b/plugins/sensors/voltcraft_tcm220_ index 130503ee..b2da4e2c 100755 --- a/plugins/sensors/voltcraft_tcm220_ +++ b/plugins/sensors/voltcraft_tcm220_ @@ -1,10 +1,10 @@ #!/usr/bin/perl -w ########################################################################################################## # -# Munin plugin to monitor values reported by a Voltcraft TCM 220 or 320 temperature swicth module -# connected to a serial port. A cable needs to be soldered to the module's dedicated data output pads: -# pad no. 9 (GND) to pin no. 5 of the serial port, pad no. 17 (DATA_OUT) to pin no. 2 of the serial port -# and pad no. 18 (CLOCK) to pin no. 3 of the serial port. For more details, check out the documentation +# Munin plugin to monitor values reported by a Voltcraft TCM 220 or 320 temperature swicth module +# connected to a serial port. A cable needs to be soldered to the module's dedicated data output pads: +# pad no. 9 (GND) to pin no. 5 of the serial port, pad no. 17 (DATA_OUT) to pin no. 2 of the serial port +# and pad no. 18 (CLOCK) to pin no. 3 of the serial port. For more details, check out the documentation # that came with your Voltcraft TCM 220/320 temperature swicth module. # # In order to use this plugin, copy it to the munin's plugin directory (eg. /usr/share/munin/plugins) @@ -15,7 +15,7 @@ # # Important: make sure to use the same names in your symlinks and other config places! # -# 2. In /etc/munin/plugin-conf.d/munin-node add the following, to be able to contact the modules via +# 2. In /etc/munin/plugin-conf.d/munin-node add the following, to be able to contact the modules via # serial ports (obviously replacing these with your own data): # # [voltcraft_tcm220_serverroom1] @@ -30,11 +30,11 @@ # # 3. Restart the munin node by 'service munin-node restart'. # -# If all went well, after 5 minutes or so you should have tne new module's graphs listed on the Web +# If all went well, after 5 minutes or so you should have tne new module's graphs listed on the Web # Interface of Munin. # # Note: the plugin waits maximum 11 seconds for the module to report the current temperature values to -# the serial port. If no value is reported, or the serial cable is unplugged, it returns Undefined to +# the serial port. If no value is reported, or the serial cable is unplugged, it returns Undefined to # Munin. According to the documentation, the module can be configured to report values every 2 seconds # instead the 10 seconds default - this can be used to speed up the data acquisition process, however # it can decrease battery life (with default values, two AAA alkaline batteries last cca 2 years). @@ -119,7 +119,7 @@ my $ch1temp = "U"; my $ch2temp = "U"; if ($response // "") { - my $hex = unpack 'H*', $response; + my $hex = unpack 'H*', $response; # print "$hex\n"; #$hex should be something like "abc102999babc2017677" for +29.9 and +17.6 my $ch1sum = substr($hex, 4, 1) + substr($hex, 5, 1) + substr($hex, 6, 1) + substr($hex, 7, 1); diff --git a/plugins/sfsnmp/snmp__sfsnmp_fan b/plugins/sfsnmp/snmp__sfsnmp_fan index fac3751d..09f6894e 100755 --- a/plugins/sfsnmp/snmp__sfsnmp_fan +++ b/plugins/sfsnmp/snmp__sfsnmp_fan @@ -5,17 +5,17 @@ # Copyright (C) 2010 Nils Henrik Tvetene # # Author: Nils Henrik Tvetene -# +# # 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 Street, Fifth Floor, Boston, MA 02110-1301 USA. @@ -53,7 +53,7 @@ Nils Henrik Tvetene GPLv2 -=cut +=cut use strict; use warnings; diff --git a/plugins/sfsnmp/snmp__sfsnmp_temp b/plugins/sfsnmp/snmp__sfsnmp_temp index 9161b6a9..a40de986 100755 --- a/plugins/sfsnmp/snmp__sfsnmp_temp +++ b/plugins/sfsnmp/snmp__sfsnmp_temp @@ -5,17 +5,17 @@ # Copyright (C) 2010 Nils Henrik Tvetene # # Author: Nils Henrik Tvetene -# +# # 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 Street, Fifth Floor, Boston, MA 02110-1301 USA. @@ -53,7 +53,7 @@ Nils Henrik Tvetene GPLv2 -=cut +=cut use strict; use warnings; diff --git a/plugins/sfsnmp/snmp__sfsnmp_volt b/plugins/sfsnmp/snmp__sfsnmp_volt index ecb0c7f6..4c274bdd 100755 --- a/plugins/sfsnmp/snmp__sfsnmp_volt +++ b/plugins/sfsnmp/snmp__sfsnmp_volt @@ -5,17 +5,17 @@ # Copyright (C) 2010 Nils Henrik Tvetene # # Author: Nils Henrik Tvetene -# +# # 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 Street, Fifth Floor, Boston, MA 02110-1301 USA. @@ -53,7 +53,7 @@ Nils Henrik Tvetene GPLv2 -=cut +=cut use strict; use warnings; diff --git a/plugins/sge/sge_queue_ b/plugins/sge/sge_queue_ index 791ee9ae..6b57ab6b 100755 --- a/plugins/sge/sge_queue_ +++ b/plugins/sge/sge_queue_ @@ -22,7 +22,7 @@ # # env.sge_settings - Path to SGE settings.sh script, defaults to /opt/sge/default/common/settings.sh # env.title - Graph title, overrides "SGE Queue state". -# env.options - Additional command line options to qstat. +# env.options - Additional command line options to qstat. # # Revisions: # v1.0 2009-07-19 @@ -93,7 +93,7 @@ if [ "$1" = "autoconf" ]; then if which qstat > /dev/null; then echo "yes" exit 0 - else + else echo "no" exit 1 fi @@ -102,8 +102,8 @@ fi # env.options OPTIONS="-g c -q $QUEUE $options" -# qstat -g c example output: -# CLUSTER QUEUE CQLOAD USED RES AVAIL TOTAL aoACDS cdsuE +# qstat -g c example output: +# CLUSTER QUEUE CQLOAD USED RES AVAIL TOTAL aoACDS cdsuE # -------------------------------------------------------------------------------- # all.q 0.00 16 8 48 64 0 0 qstat $OPTIONS | tail -n 1 | awk '{print "unavailable.value " $8 "\nreserved.value " $4 "\nused.value " $3 "\nfree.value " $5-$4}' diff --git a/plugins/sge/sge_queue_xml_ b/plugins/sge/sge_queue_xml_ index b20d088f..6adc3e2c 100755 --- a/plugins/sge/sge_queue_xml_ +++ b/plugins/sge/sge_queue_xml_ @@ -21,7 +21,7 @@ # # env.sge_settings - Path to SGE settings.sh script, defaults to /opt/sge/default/common/settings.sh # env.title - Graph title, overrides "SGE Queue state". -# env.options - Additional command line options to qstat. +# env.options - Additional command line options to qstat. # env.queues - list of queues to summarize # # Revisions: @@ -35,7 +35,7 @@ SGE_SETTINGS=${sge_settings:-/opt/sge/default/common/settings.sh} -# queues to monitor +# queues to monitor # priority 1: queue name in symlink QUEUE=${0##*_} # priority 2: queue names from environment @@ -92,17 +92,17 @@ if [ "$1" = "autoconf" ]; then if [ -n "$QSTAT" -a -n "$XMLSTARLET" ]; then echo "yes" exit 0 - else + else echo "no" exit 1 fi fi -# check requirements -[ -z "$QSTAT" ] && { echo "qstat not found" 1>&2 ; exit 1; } -[ -z "$XMLSTARLET" ] && { echo "xmlstarlet not found" 1>&2 ; exit 1; } +# check requirements +[ -z "$QSTAT" ] && { echo "qstat not found" 1>&2 ; exit 1; } +[ -z "$XMLSTARLET" ] && { echo "xmlstarlet not found" 1>&2 ; exit 1; } -ALL_QUEUES=$( $QSTAT -g c -xml | $XMLSTARLET sel -T -t -m "//cluster_queue_summary/name" -v "node()" -o "," ) +ALL_QUEUES=$( $QSTAT -g c -xml | $XMLSTARLET sel -T -t -m "//cluster_queue_summary/name" -v "node()" -o "," ) [ "$QUEUE" == "Summary" ] && QUEUE="$ALL_QUEUES" if [ "$1" = "suggest" ]; then @@ -130,7 +130,7 @@ xmldemangle() { printvalues() { local IFSBAK=$IFS; unset IFS for i in ${!_SGE_QUEUE_KEYS[@]} - do + do echo "${_SGE_QUEUE_KEYS[$i]}.value ${_SGE_QUEUE_VALUES[$i]}" done IFS=$IFSBAK @@ -153,7 +153,7 @@ do xmldemangle || echo "Error on QUEUE: $qu" 1>&2 for i in ${!_SGE_QUEUE_KEYS[@]} - do + do _SGE_QUEUE_VALUES[$i]=${_SGE_QUEUE_VALUES[$i]:-0} let "_SGE_QUEUE_VALUES[$i] += ${_SGE_XML[$i]:-0}" done diff --git a/plugins/shoutcast/shoutcast b/plugins/shoutcast/shoutcast index 386bf225..b27bb3c7 100755 --- a/plugins/shoutcast/shoutcast +++ b/plugins/shoutcast/shoutcast @@ -85,7 +85,7 @@ if ( exists $ARGV[0] and $ARGV[0] eq "config" ) { print "ax_used_connections.label Peak Listeners\n"; print "ax_used_connections.type GAUGE\n"; - # DJ-Online tag must be eq to Peak Listeners + # DJ-Online tag must be eq to Peak Listeners print "djonline_tag.draw AREA\n"; print "djonline_tag.colour e5ff60\n"; print "djonline_tag.min 0\n"; diff --git a/plugins/shoutcast/shoutcast2_multi b/plugins/shoutcast/shoutcast2_multi index 5f922ba1..310a2cf7 100755 --- a/plugins/shoutcast/shoutcast2_multi +++ b/plugins/shoutcast/shoutcast2_multi @@ -200,7 +200,7 @@ sub print_active_data { foreach my $sid (sort keys %{$sidDataRef}) { print "multigraph shoutcast2_active.active_sid_$sid\n"; foreach my $dsrc (@{$graphsRef->{sid_active}->{datasrc}}) { - print "$dsrc->{name}.value $sidDataRef->{$sid}->{$dsrc->{xmlkey}}\n"; + print "$dsrc->{name}.value $sidDataRef->{$sid}->{$dsrc->{xmlkey}}\n"; if ($sidDataRef->{$sid}->{$dsrc->{xmlkey}} == 1) { $globalActive = 1; } @@ -216,7 +216,7 @@ sub print_active_data { =head2 print_listener_data This subroutine prints out the listener graph values for each stream and ultimately - adds all of the current users together to show that against the maxserver count in + adds all of the current users together to show that against the maxserver count in the global graph. Clicking on the global graph will reveal a bit more information about the users on a stream by stream basis. @@ -228,7 +228,7 @@ sub print_listener_data { foreach my $sid (sort keys %{$sidDataRef}) { print "multigraph shoutcast2_listeners.listeners_sid_$sid\n"; foreach my $dsrc (@{$graphsRef->{sid_listeners}->{datasrc}}) { - print "$dsrc->{name}.value $sidDataRef->{$sid}->{$dsrc->{xmlkey}}\n"; + print "$dsrc->{name}.value $sidDataRef->{$sid}->{$dsrc->{xmlkey}}\n"; if ($dsrc->{name} eq 'currlisteners') { $globalListeners += $sidDataRef->{$sid}->{$dsrc->{xmlkey}}; } @@ -283,7 +283,7 @@ sub config { } print_active_config($sidDataRef); print_listener_config($sidDataRef); - return; + return; } =head2 print_active_config @@ -409,7 +409,7 @@ sub fetch_sid_data { my $response = $ua->get($url); if ($response->is_success) { my $returnRef = XMLin($response->decoded_content); - return (1, $returnRef); + return (1, $returnRef); } else { return (0, $response->status_line); } @@ -431,7 +431,7 @@ sub fetch_admin_data { if ($response->is_success) { my $returnRef = XMLin($response->decoded_content); if (($returnRef->{STREAMCONFIGS}->{TOTALCONFIGS} > 0) && (defined($returnRef->{STREAMCONFIGS}->{STREAMCONFIG}))) { - return (1, $returnRef); + return (1, $returnRef); } else { return (0, 'Unable to Detect any Stream Configurations'); } diff --git a/plugins/sickbeard/sickbeard_episodes b/plugins/sickbeard/sickbeard_episodes index 81d67811..e4f38a24 100755 --- a/plugins/sickbeard/sickbeard_episodes +++ b/plugins/sickbeard/sickbeard_episodes @@ -7,7 +7,7 @@ # # Sick-Beard : http://sickbeard.com/ # -# This program is free software: you can redistribute it and/or modify +# 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 3 of the License, or # (at your option) any later version. @@ -27,7 +27,7 @@ # [sickbeard*] # env.host http://host:port/ # env.api apikey -# +# use strict; use JSON::Any; diff --git a/plugins/sickbeard/sickbeard_shows b/plugins/sickbeard/sickbeard_shows index 2407d83e..ed755ac5 100755 --- a/plugins/sickbeard/sickbeard_shows +++ b/plugins/sickbeard/sickbeard_shows @@ -7,7 +7,7 @@ # # Sick-Beard : http://sickbeard.com/ # -# This program is free software: you can redistribute it and/or modify +# 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 3 of the License, or # (at your option) any later version. @@ -27,7 +27,7 @@ # [sickbeard*] # env.host http://host:port/ # env.api apikey -# +# use strict; use JSON::Any; diff --git a/plugins/smf/smf_errors b/plugins/smf/smf_errors index 5a2dc249..a5f88bfa 100755 --- a/plugins/smf/smf_errors +++ b/plugins/smf/smf_errors @@ -53,5 +53,5 @@ EOC #Errors count my $errors = `$MYSQL $MYSQLOPTS -e 'SELECT COUNT(*) FROM ${DATABASE}.${PREFIX}log_errors'`; -$errors =~ /(\d+)/; +$errors =~ /(\d+)/; print "errors.value ".$1."\n"; diff --git a/plugins/smf/smf_mail_queue b/plugins/smf/smf_mail_queue index 99def0a7..4d40c605 100755 --- a/plugins/smf/smf_mail_queue +++ b/plugins/smf/smf_mail_queue @@ -53,5 +53,5 @@ EOC #Emails count my $emails = `$MYSQL $MYSQLOPTS -e 'SELECT COUNT(*) FROM ${DATABASE}.${PREFIX}mail_queue'`; -$emails =~ /(\d+)/; +$emails =~ /(\d+)/; print "emails.value ".$1."\n"; diff --git a/plugins/smf/smf_online b/plugins/smf/smf_online index e9e609b7..2739e5a2 100755 --- a/plugins/smf/smf_online +++ b/plugins/smf/smf_online @@ -65,12 +65,12 @@ EOC #Guests count my $guests = `$MYSQL $MYSQLOPTS -e 'SELECT COUNT(*) FROM ${DATABASE}.${PREFIX}log_online WHERE id_member = 0 AND id_spider = 0'`; -$guests =~ /(\d+)/; +$guests =~ /(\d+)/; print "guests.value ".$1."\n"; #Spiders count my $spiders = `$MYSQL $MYSQLOPTS -e 'SELECT COUNT(*) FROM ${DATABASE}.${PREFIX}log_online WHERE id_spider > 0'`; -$spiders =~ /(\d+)/; +$spiders =~ /(\d+)/; print "spiders.value ".$1."\n"; #Users count diff --git a/plugins/smf/smf_stats b/plugins/smf/smf_stats index 7e25f691..47758732 100755 --- a/plugins/smf/smf_stats +++ b/plugins/smf/smf_stats @@ -59,12 +59,12 @@ EOC #Members count my $members = `$MYSQL $MYSQLOPTS -e 'SELECT value FROM ${DATABASE}.${PREFIX}settings WHERE variable = "totalMembers"'`; -$members =~ /(\d+)/; +$members =~ /(\d+)/; print "members.value ".$1."\n"; #Messages count my $messages = `$MYSQL $MYSQLOPTS -e 'SELECT value FROM ${DATABASE}.${PREFIX}settings WHERE variable="totalMessages"'`; -$messages =~ /(\d+)/; +$messages =~ /(\d+)/; print "messages.value ".$1."\n"; #Topics count diff --git a/plugins/smstools/smstools_ b/plugins/smstools/smstools_ index 0066d9b8..e5e4644d 100755 --- a/plugins/smstools/smstools_ +++ b/plugins/smstools/smstools_ @@ -16,7 +16,7 @@ # Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. # -# +# # Plugin to monitor an smstools installation # # Usage: Link or copy into the munin-node plugin directory, name it according @@ -85,8 +85,8 @@ fi # If run with the "config"-parameter, give out information on how the -# graphs should look. - +# graphs should look. + if [ "$1" = "config" ]; then echo 'graph_title SMSTools Report for '${MODEM} echo 'graph_args --base 1000 -l 0' diff --git a/plugins/snmp/multi_snmp_querier b/plugins/snmp/multi_snmp_querier index 0048c6af..4894ff77 100755 --- a/plugins/snmp/multi_snmp_querier +++ b/plugins/snmp/multi_snmp_querier @@ -6,8 +6,8 @@ multi_snmp_querier - Munin plugin to query several SNMP hosts =head1 SYNOPSIS -This plugin is meant to be called from Munin. You should at least set the -'hosts' environment variable from Munin's configuration (i.e. +This plugin is meant to be called from Munin. You should at least set the +'hosts' environment variable from Munin's configuration (i.e. /etc/munin/munin.conf) to specify which hosts and how to query. =head1 DESCRIPTION @@ -20,7 +20,7 @@ This plugin is meant to be called from Munin. You should at least set the Which SNMP OID should we query on; it defaults to 1.3.6.1.2.1.43.10.2.1.4.1.1 (total printed pages - of course, it only -makes sense to query a printer on this ;-) ). +makes sense to query a printer on this ;-) ). Other known and useful OIDs for printers are 1.3.6.1.2.1.43.11.1.1.9.1.1 (total number of pages printed with this @@ -111,7 +111,7 @@ $oid = $ENV{snmp_oid} || $defaults{oid}; total => 'Total', units => 'pages' }, - '1.3.6.1.2.1.43.11.1.1.8.1.1' => + '1.3.6.1.2.1.43.11.1.1.8.1.1' => { title => 'Total projected capacity of this cartridge', vlabel => 'Total capacity', category => 'printing', @@ -120,7 +120,7 @@ $oid = $ENV{snmp_oid} || $defaults{oid}; total => 'Total', units => 'pages' }, - '1.3.6.1.2.1.43.11.1.1.9.1.1' => + '1.3.6.1.2.1.43.11.1.1.9.1.1' => { title => 'Pages printed with this cartridge', vlabel => 'Printed pages', category => 'printing', @@ -129,7 +129,7 @@ $oid = $ENV{snmp_oid} || $defaults{oid}; total => 'Total', units => 'pages' }, - 'default' => + 'default' => { title => "Results for SNMP OID $oid", vlabel => 'units', category => 'Other', @@ -144,7 +144,7 @@ die "Hosts not set - cannot continue" unless @hosts; $cmd_arg = $ARGV[0] || ''; if($cmd_arg eq "config") { my $labels = $known_oids{$oid} || $known_oids{default}; - # See http://munin.projects.linpro.no/wiki/HowToWritePlugins for + # See http://munin.projects.linpro.no/wiki/HowToWritePlugins for # explanation on the following fields print "graph_title $labels->{title}\n"; print "graph_args --base 1000 -l 0\n"; @@ -184,7 +184,7 @@ sub ck_alive{ $ping = Net::Ping->new("tcp", 1); $ping->ping($host); } - + sub get_hosts { # Hosts are defined in the 'hosts' environment variable. It's a list of # hosts (and optionally ports) - We parse the list and arrange it neatly diff --git a/plugins/snmp/snmp__brocade_ifs b/plugins/snmp/snmp__brocade_ifs index de555afd..b43691d2 100755 --- a/plugins/snmp/snmp__brocade_ifs +++ b/plugins/snmp/snmp__brocade_ifs @@ -1,7 +1,7 @@ #!/usr/bin/env python """ -Munin plugin which reports selected counters regarding ports on a +Munin plugin which reports selected counters regarding ports on a Brocade SAN FC-switch. Only enabled ports are considered. The counters shown: @@ -14,7 +14,7 @@ enc_out: Encoding errors outside FC frame. enc_out_per_mframe: As above, but per million frames of traffic. If there is a high number for this counter, it could reflect: - - If there is also a high value for + - If there is also a high value for rx_crcs for the port, then there is likely a GBIC/SFP problem. - If there the value of rx_crcs for the port @@ -22,7 +22,7 @@ enc_out_per_mframe: As above, but per million frames of traffic. problem. rx_crcs: CRC errors detected in received frames. - Together with enc_out errors, CRC errors + Together with enc_out errors, CRC errors indicate a GBIC/SFP problem. bits: Number of bits transmitted(tx)/received(rx) @@ -38,7 +38,7 @@ snmp_HOSTNAME_brocade_ifs """ # Note: In the SNMP output from brocade switches, the interesting -# counters are named with numbers starting with 1, while the +# counters are named with numbers starting with 1, while the # ports' real names on the box and in the administration interface # start with 0. And there doesn't seem to be a way to map between # ifDesc and the interesting crc and enc_out counters :-( @@ -63,7 +63,7 @@ snmp_HOSTNAME_brocade_ifs # Released according to the "New BSD License" AKA the 3-clause # BSD License: -# ==================================================================== +# ==================================================================== # Copyright (c) 2011, Danish National Board of Health. # All rights reserved. # @@ -88,7 +88,7 @@ snmp_HOSTNAME_brocade_ifs # ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT # (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS # SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -# ==================================================================== +# ==================================================================== # $Id: brocade_san_switch_ports_ 15443 2011-03-03 12:23:56Z tra $ @@ -140,7 +140,7 @@ def debug(msg): print('Debug: %s\n' % msg) # Break OID-string in to a tuple of elements -def oidstr2tuple(oidstr): +def oidstr2tuple(oidstr): int_list = [ int(s) for s in oidstr.split('.') ] return tuple(int_list) diff --git a/plugins/snmp/snmp__cpu_usage b/plugins/snmp/snmp__cpu_usage index 00aa86f2..2bb58ed6 100755 --- a/plugins/snmp/snmp__cpu_usage +++ b/plugins/snmp/snmp__cpu_usage @@ -119,7 +119,7 @@ my $cpuIdle = "1.3.6.1.4.1.2021.11.11"; my $cpu = 0; -my %cpuCounters = ( +my %cpuCounters = ( cpuUser => "1.3.6.1.4.1.2021.11.9.$cpu", # The percentage of CPU time spent processing user-level code, calculated over the last minute cpuSystem => "1.3.6.1.4.1.2021.11.10.$cpu", # The percentage of CPU time spent processing system-level code, calculated over the last minute cpuIdle => "1.3.6.1.4.1.2021.11.11.$cpu", # The percentage of processor time spent idle, calculated over the last minute @@ -147,7 +147,7 @@ if ($ARGV[0] and $ARGV[0] eq "config") foreach my $c (keys %cpuCounters) { print $c . ".label $c\n"; print $c . ".type GAUGE\n"; - if ($firstCounter) { + if ($firstCounter) { print $c . ".draw AREA\n"; $firstCounter = 0; } else { @@ -156,7 +156,7 @@ if ($ARGV[0] and $ARGV[0] eq "config") print $c . ".min 0\n"; } - exit 0; + exit 0; } foreach my $c (keys %cpuCounters) { diff --git a/plugins/snmp/snmp__cyberpower b/plugins/snmp/snmp__cyberpower index 8b3c9ee3..c6797bb8 100755 --- a/plugins/snmp/snmp__cyberpower +++ b/plugins/snmp/snmp__cyberpower @@ -75,7 +75,7 @@ charge.type GAUGE charge.min 0 charge.max 100 "; - + print "multigraph cyberpower_runtime graph_title CyberPower UPS Runtime graph_info This graph shows expected runtime informatiom. @@ -86,7 +86,7 @@ graph_vlabel minutes runtime.draw AREA runtime.type GAUGE "; - + print "multigraph cyberpower_voltage graph_title CyberPower UPS Voltages graph_info This graph shows voltage information. @@ -101,7 +101,7 @@ input.type GAUGE output.draw LINE1 output.type GAUGE "; - + if(oidExists(oid_cps_env_temp) && oidExists(oid_cps_env_humidity)){ print "multigraph cyberpower_environment graph_title CyberPower UPS Environment @@ -120,7 +120,7 @@ humidity.min 0 humidity.max 100 "; } - + exit 0; } @@ -177,7 +177,7 @@ sub oidExists { } my $oid = $_[0]; my $val = $session->get_single($oid); - + if(!length $val || $val eq 'noSuchInstance' || $val eq 'U'){ return(0); }else{ diff --git a/plugins/snmp/snmp__fn b/plugins/snmp/snmp__fn index e6122725..521b19a9 100755 --- a/plugins/snmp/snmp__fn +++ b/plugins/snmp/snmp__fn @@ -3,11 +3,11 @@ # File: snmp__fn # Description: SNMP plugin to monitor open sessions, sslvpn, CPU and Memory on a # Fortinet Fortigate firewall. -# +# # Author: Thom Diener # 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; version 2 dated +# as published by the Free Software Foundation; version 2 dated # June, 1991. # # Version: v1.00 30.10.2011 First draft of the fortigate plugin @@ -22,21 +22,21 @@ # (Example: ln -s /usr/share/munin/plugins/snmp__fn \ # /etc/munin/plugins/snmp_foo.example.com_fn) # -# Add global community string +# Add global community string # vi /etc/munin/plugin-conf.d/munin-node # [snmp_*] # env.community private # timeout 45 # In case low latency or timeout # -# Fortigate Activate snmp on your Fortigate firewall. -# Fortigate documentation at https://support.fortinet.com +# Fortigate Activate snmp on your Fortigate firewall. +# Fortigate documentation at https://support.fortinet.com # # MIB Download and copy the original Fortigate MIB definition files to: # /usr/share/snmp/mibs/FORTINET-CORE-MIB.mib.txt # /usr/share/snmp/mibs/FORTINET-FORTIGATE-MIB.mib # -# Testing This plugin has been tested with the following OS/software: -# +# Testing This plugin has been tested with the following OS/software: +# # Appliance/Firmware: # Fortigate-50B 3.00-b0662(MR6 Patch 1) work with v1.00-1.02 # Fortigate-50B 3.00-b0678(MR6 Patch 6) work with v1.00-1.02 @@ -44,10 +44,10 @@ # Fortigate-50B 4.00-b0217(MR1 Patch 10) work with v1.00-1.02 # Fortigate-50B 4.00-b0217(MR2 Patch 4) work with v1.00-1.02 # Fortigate-50B 4.00-b0521(MR3 Patch 6) work with v1.03 -# +# # Munin-Version: -# Munin 1.4.4 (1.4.4-1ubuntu1) -# OS-Version: +# Munin 1.4.4 (1.4.4-1ubuntu1) +# OS-Version: # Ubuntu 10.04.3 LTS (lucid) x86_32/64 # #%# family=manual @@ -148,7 +148,7 @@ config() echo "graph_title $UNIT - SSLvpn Sessions" echo 'graph_category fw' echo 'graph_vlabel Sessions/Users' - echo 'graph_info Loged in users with SSLvpn (WebSession or Tunnel-Mode)' + echo 'graph_info Loged in users with SSLvpn (WebSession or Tunnel-Mode)' echo 'fortiuser.label Users' echo 'fortiuser.info Loged in SSLvpn users' echo 'fortiwebs.label WebSessions' diff --git a/plugins/snmp/snmp__webthermometer b/plugins/snmp/snmp__webthermometer index 34a2a827..b0b4f51b 100755 --- a/plugins/snmp/snmp__webthermometer +++ b/plugins/snmp/snmp__webthermometer @@ -72,7 +72,7 @@ if [ "$1" = "config" ]; then SENSOR_2_CRITICAL=`$SNMPGET WebGraph-2xThermometer-MIB::wtWebioAn2GraphAlarmMax.2 | sed s/.*STRING:// | sed s/\"//g` # echo the result to munin - echo "graph_title $GRAPH_TITLE" + echo "graph_title $GRAPH_TITLE" echo "graph_info $GRAPH_INFO" echo "graph_vlabel $GRAPH_VLABEL" echo "Sensor_1.label $SENSOR_1_LABEL" diff --git a/plugins/snmp/snmp__wmsconnectedplayers b/plugins/snmp/snmp__wmsconnectedplayers index 506f31f4..2c3f9a1a 100755 --- a/plugins/snmp/snmp__wmsconnectedplayers +++ b/plugins/snmp/snmp__wmsconnectedplayers @@ -16,13 +16,13 @@ # along with this program; if not, write to the Free Software # Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. # -# Derived from SNMP plugin code written by +# Derived from SNMP plugin code written by # Jimmy Olsen, Dagfinn Ilmari Mannsaaker # ####################################################################### # # You must enable SNMP for Windows Media Services by running: -# +# # regsvr32 "%systemroot%\system32\windows media\server\wmssnmp.dll # ####################################################################### @@ -86,7 +86,7 @@ if (defined $ARGV[0] and $ARGV[0] eq "config") { print "host_name $host\n"; print "graph_title wmsConnectedPlayers -graph_args --base 1000 -l 0 +graph_args --base 1000 -l 0 graph_vlabel wmsConnectedPlayers graph_category streaming graph_info This graph shows wmsConnectedPlayers. diff --git a/plugins/snmp/snmp__wmsplayerallocatedbandwidth b/plugins/snmp/snmp__wmsplayerallocatedbandwidth index a29cc123..8f5209ee 100755 --- a/plugins/snmp/snmp__wmsplayerallocatedbandwidth +++ b/plugins/snmp/snmp__wmsplayerallocatedbandwidth @@ -16,13 +16,13 @@ # along with this program; if not, write to the Free Software # Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. # -# Derived from SNMP plugin code written by +# Derived from SNMP plugin code written by # Jimmy Olsen, Dagfinn Ilmari Mannsaaker # ####################################################################### # # You must enable SNMP for Windows Media Services by running: -# +# # regsvr32 "%systemroot%\system32\windows media\server\wmssnmp.dll # ####################################################################### @@ -92,7 +92,7 @@ if (defined $ARGV[0] and $ARGV[0] eq "config") { print "host_name $host\n"; print "graph_title wmsPlayerAllocatedBandwidth -graph_args --base 1000 -l 0 +graph_args --base 1000 -l 0 graph_vlabel wmsPlayerAllocatedBandwidth graph_category streaming graph_info This graph shows wmsPlayerAllocatedBandwidth. diff --git a/plugins/snmp/snmp__wmsstreaminghttpplayers b/plugins/snmp/snmp__wmsstreaminghttpplayers index c3a8492e..3118478c 100755 --- a/plugins/snmp/snmp__wmsstreaminghttpplayers +++ b/plugins/snmp/snmp__wmsstreaminghttpplayers @@ -16,13 +16,13 @@ # along with this program; if not, write to the Free Software # Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. # -# Derived from SNMP plugin code written by +# Derived from SNMP plugin code written by # Jimmy Olsen, Dagfinn Ilmari Mannsaaker # ####################################################################### # # You must enable SNMP for Windows Media Services by running: -# +# # regsvr32 "%systemroot%\system32\windows media\server\wmssnmp.dll # ####################################################################### @@ -87,7 +87,7 @@ if (defined $ARGV[0] and $ARGV[0] eq "config") { print "host_name $host\n"; print "graph_title wmsStreamingHttpPlayers -graph_args --base 1000 -l 0 +graph_args --base 1000 -l 0 graph_vlabel wmsStreamingHttpPlayers graph_category streaming graph_info This graph shows wmsStreamingHttpPlayers. diff --git a/plugins/snmp/snmp__wmsstreamingmmsplayers b/plugins/snmp/snmp__wmsstreamingmmsplayers index 2608e731..29f8e258 100755 --- a/plugins/snmp/snmp__wmsstreamingmmsplayers +++ b/plugins/snmp/snmp__wmsstreamingmmsplayers @@ -16,13 +16,13 @@ # along with this program; if not, write to the Free Software # Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. # -# Derived from SNMP plugin code written by +# Derived from SNMP plugin code written by # Jimmy Olsen, Dagfinn Ilmari Mannsaaker # ####################################################################### # # You must enable SNMP for Windows Media Services by running: -# +# # regsvr32 "%systemroot%\system32\windows media\server\wmssnmp.dll # ####################################################################### @@ -87,7 +87,7 @@ if (defined $ARGV[0] and $ARGV[0] eq "config") { print "host_name $host\n"; print "graph_title wmsStreamingMmsPlayers -graph_args --base 1000 -l 0 +graph_args --base 1000 -l 0 graph_vlabel wmsStreamingMmsPlayers graph_category streaming graph_info This graph shows wmsStreamingMmsPlayers. diff --git a/plugins/snmp/snmp__wmsstreamingplayers b/plugins/snmp/snmp__wmsstreamingplayers index 7f93b605..2cf4c8c6 100755 --- a/plugins/snmp/snmp__wmsstreamingplayers +++ b/plugins/snmp/snmp__wmsstreamingplayers @@ -16,13 +16,13 @@ # along with this program; if not, write to the Free Software # Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. # -# Derived from SNMP plugin code written by +# Derived from SNMP plugin code written by # Jimmy Olsen, Dagfinn Ilmari Mannsaaker # ####################################################################### # # You must enable SNMP for Windows Media Services by running: -# +# # regsvr32 "%systemroot%\system32\windows media\server\wmssnmp.dll # ####################################################################### @@ -84,7 +84,7 @@ if (defined $ARGV[0] and $ARGV[0] eq "config") { print "host_name $host\n"; print "graph_title wmsStreamingPlayers -graph_args --base 1000 -l 0 +graph_args --base 1000 -l 0 graph_vlabel wmsStreamingPlayers graph_category streaming graph_info This graph shows wmsStreamingPlayers. diff --git a/plugins/snmp/snmp__wmsstreamingrtspplayers b/plugins/snmp/snmp__wmsstreamingrtspplayers index 333a8283..300b24cb 100755 --- a/plugins/snmp/snmp__wmsstreamingrtspplayers +++ b/plugins/snmp/snmp__wmsstreamingrtspplayers @@ -16,13 +16,13 @@ # along with this program; if not, write to the Free Software # Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. # -# Derived from SNMP plugin code written by +# Derived from SNMP plugin code written by # Jimmy Olsen, Dagfinn Ilmari Mannsaaker # ####################################################################### # # You must enable SNMP for Windows Media Services by running: -# +# # regsvr32 "%systemroot%\system32\windows media\server\wmssnmp.dll # ####################################################################### @@ -86,7 +86,7 @@ if (defined $ARGV[0] and $ARGV[0] eq "config") { print "host_name $host\n"; print "graph_title wmsStreamingRtspPlayers -graph_args --base 1000 -l 0 +graph_args --base 1000 -l 0 graph_vlabel wmsStreamingRtspPlayers graph_category streaming graph_info This graph shows wmsStreamingRtspPlayers. diff --git a/plugins/solaris/forks b/plugins/solaris/forks index 1744bdf3..97874d4b 100755 --- a/plugins/solaris/forks +++ b/plugins/solaris/forks @@ -66,7 +66,7 @@ config() { echo "$global_attr" | sed -e 's/^ *//' -e '/^$/d' # print data source attributes - # split line into field,type,draw,label + # split line into field,type,draw,label local field type draw label echo "$data_attr" | while read -r field type draw label do diff --git a/plugins/solaris/fsstat_act_ b/plugins/solaris/fsstat_act_ index 3332e0a8..71b6f759 100755 --- a/plugins/solaris/fsstat_act_ +++ b/plugins/solaris/fsstat_act_ @@ -12,9 +12,9 @@ Tested with Solaris 10 and 11. And should work with Solaris 10 11/06 or above. Note: - In Solaris 11, fsstat command can get stats for each non-global zones in + In Solaris 11, fsstat command can get stats for each non-global zones in global zone. (see man fsstat) - In global zone, this plugin gets stats of only global zone. + In global zone, this plugin gets stats of only global zone. In non-global zones, this plugin reports stats of the non-global zones. =head1 CONFIGURATION @@ -63,7 +63,7 @@ stat_regexp='/^(?!(class|crtime|snaptime|.*_bytes))/' # Graph settings global_attr=" graph_title File system statictics - Activities of $( echo "$fs_type" | tr '[:lower:]' '[:upper:]' ) - graph_category disk + graph_category disk graph_args --base 1000 graph_vlabel Counts per second graph_info File system statictics - Activities of $( echo "$fs_type" | tr '[:lower:]' '[:upper:]' ) @@ -78,7 +78,7 @@ get_zone_id() { zoneid=0 osver=$( uname -r | cut -d. -f2 ) - + if [ "$osver" -ge 11 ]; then zonename=$( zonename ) zoneid=$( /usr/sbin/zoneadm list -p | awk -F: '$2 == "'"$zonename"'" { print $1 }' ) @@ -101,7 +101,7 @@ suggest() { kstat -p "unix:${zone_id}:${name_regexp}:/^(read_bytes|write_bytes)\$/" \ | sed -e 's/vopstats_//' -e 's/:/ /g' \ | awk '{ - sum[ $3 ] += $5 + sum[ $3 ] += $5 } END { for ( i in sum ) { diff --git a/plugins/solaris/fsstat_bytes b/plugins/solaris/fsstat_bytes index 4fb5e7e1..45d256c0 100755 --- a/plugins/solaris/fsstat_bytes +++ b/plugins/solaris/fsstat_bytes @@ -9,9 +9,9 @@ Tested with Solaris 10 and 11. Note: - In Solaris 11, fsstat command can get stats for each non-global zones in + In Solaris 11, fsstat command can get stats for each non-global zones in global zone. (see man fsstat) - In global zone, this plugin gets stats of only global zone. + In global zone, this plugin gets stats of only global zone. In non-global zones, this plugin reports stats of the non-global zones. =head1 CONFIGURATION @@ -86,7 +86,7 @@ get_zone_id() { zoneid=0 osver=$( uname -r | cut -d. -f2 ) - + if [ "$osver" -ge 11 ]; then zonename=$( zonename ) zoneid=$( /usr/sbin/zoneadm list -p | awk -F: '$2 == "'"$zonename"'" { print $1 }' ) diff --git a/plugins/solaris/interrupts b/plugins/solaris/interrupts index 7f1f49cc..50169246 100755 --- a/plugins/solaris/interrupts +++ b/plugins/solaris/interrupts @@ -78,7 +78,7 @@ config() { echo "$global_attr" | sed -e 's/^ *//' -e '/^$/d' # print data source attributes - # split line into field,type,draw,label + # split line into field,type,draw,label local field type draw label echo "$data_attr" | while read -r field type draw label do diff --git a/plugins/solaris/io_disk b/plugins/solaris/io_disk index 34ec68f0..164d2df6 100755 --- a/plugins/solaris/io_disk +++ b/plugins/solaris/io_disk @@ -8,7 +8,7 @@ These functions are implemented: ops : similar to iostat r/s, w/s - bytes : similar to iostat kr/s, kw/s + bytes : similar to iostat kr/s, kw/s busy : similar to iostat %b, %w (%w usually indicates 0 in Sol10,11) queue : similar to iostat actv, wait latency : similar to iostat asvc_t, wsvc_t @@ -25,11 +25,11 @@ cd /path/to/munin/etc/plugins ln -s /path/to/munin/lib/plugins/io_disk . - The RRD files generated by io_busy_, io_ops_, io_bytes_ can be taken over + The RRD files generated by io_busy_, io_ops_, io_bytes_ can be taken over by this plugin. Thus, please remove symlinks of those plugins before using this plugin. - By default, this plugin monitors disk devices. And also it can monitor + By default, this plugin monitors disk devices. And also it can monitor NFS and Tape devices as much as io_* plugins with setting environments. Note that instance names of nfs (e.g. nfs1) can be changed after reboot or @@ -41,7 +41,7 @@ example: env.class /disk|nfs|tape/ default: disk - env.module - Module name. Only used in internal graph name. + env.module - Module name. Only used in internal graph name. example: env.module something default: sd @@ -102,7 +102,7 @@ functions='ops bytes busy queue latency size' : "${graph_width:=}" # Create map of instance name (e.g. sd0) and logical device name (e.g. c0t0d0) -# Example: +# Example: # name_sd1=c0t0d0 # name_ssd2=c0tAB_1234d0 (shorten long target) # ... @@ -213,7 +213,7 @@ do_config() { latency|size) for stat in reads writes do - echo "${dev}_${stat}.label dummy" + echo "${dev}_${stat}.label dummy" echo "${dev}_${stat}.graph no" echo "${dev}_${stat}.type DERIVE" echo "${dev}_${stat}.min 0" @@ -243,7 +243,7 @@ do_config() { esac # Print data attributes - echo "${dev}_${conf_out}.label dummy" + echo "${dev}_${conf_out}.label dummy" echo "${dev}_${conf_out}.graph no" echo "${dev}_${conf_out}.type DERIVE" echo "${dev}_${conf_out}.min 0" diff --git a/plugins/solaris/solaris-memstat b/plugins/solaris/solaris-memstat index 71957f53..d6c58931 100755 --- a/plugins/solaris/solaris-memstat +++ b/plugins/solaris/solaris-memstat @@ -98,11 +98,11 @@ BEGIN { phys=0 } -/^Kernel/ { kernel=$2 } +/^Kernel/ { kernel=$2 } /^ZFS File Data/ { zfs=$4 } -/^Anon/ { anon=$2 } +/^Anon/ { anon=$2 } /^Exec and libs/ { exec=$4 } -/^Page cache/ { cacheused=$3 } +/^Page cache/ { cacheused=$3 } /^Free \(cachelist\)/ { cachefree=$3 } /^Free \(freelist\)/ { free=$3 } diff --git a/plugins/solr/solr b/plugins/solr/solr index 647ea5e9..836da03a 100755 --- a/plugins/solr/solr +++ b/plugins/solr/solr @@ -1,5 +1,5 @@ #!/usr/bin/python -import sys, os +import sys, os import urllib2 try: from xml.etree import cElementTree as ET @@ -12,7 +12,7 @@ except ImportError: SOLR_PORT=8389 SOLR_HOST="localhost" # Parameters: -# +# # config (required) # autoconf (optional - used by munin-config) # @@ -84,7 +84,7 @@ if len(sys.argv) > 1: sys.exit(0) elif sys.argv[1] == "config": params = parseArgs() - + print 'graph_title Solr %s' % params['valueName'] print 'graph_args -l 0 ' print 'graph_vlabel Size %s' % params['valueName'] diff --git a/plugins/solr/solr-stats b/plugins/solr/solr-stats index e023d339..424d9e39 100755 --- a/plugins/solr/solr-stats +++ b/plugins/solr/solr-stats @@ -9,7 +9,7 @@ * Verify the server where the munin-node instance is can access that URL * * You need to have a PHP 5.2.6+ CLI installed too - * + * * Once the plugin is available you can simlink it with the following naming convention : * solr-[name of the core]-[name of the stats section - ex.: CORE]-[name of the entry in the xml - ex.: searcher]-[name of the stat to graph - ex.: numDocs] */ diff --git a/plugins/solr/solr4_ b/plugins/solr/solr4_ index 247c0810..3de709e3 100755 --- a/plugins/solr/solr4_ +++ b/plugins/solr/solr4_ @@ -1,7 +1,7 @@ #!/usr/bin/env python # # Copyright (c) 2013, Antonio Verni, me.verni@gmail.com -# +# # Permission is hereby granted, free of charge, to any person obtaining a # copy of this software and associated documentation files (the "Software"), # to deal in the Software without restriction, including without limitation @@ -32,7 +32,7 @@ # # Example: # [solr_*] -# env.host_port solrhost:8080 +# env.host_port solrhost:8080 # env.url /solr # env.qpshandler_select /select # @@ -301,7 +301,7 @@ graph_vlabel docs docs.label Docs graph_category search""" -INDEXSIZE_GRAPH_TPL = """graph_args --base 1024 -l 0 +INDEXSIZE_GRAPH_TPL = """graph_args --base 1024 -l 0 graph_vlabel Bytes graph_title Index Size graph_category search @@ -313,7 +313,7 @@ xmx.colour ff0000 """ INDEXSIZECORE_GRAPH_TPL = """{core}.label {core} -{core}.draw STACK""" +{core}.draw STACK""" MEMORYUSAGE_GRAPH_TPL = """graph_args --base 1024 -l 0 --upper-limit {availableram} graph_vlabel Bytes @@ -387,10 +387,10 @@ class SolrMuninGraph: cores = self._getCores() graph = [QPSCORE_GRAPH_TPL.format(core=c, gtype='LINESTACK1') for pos,c in enumerate(cores) ] return QPSMAIN_GRAPH_TPL.format( - cores_qps_graphs='\n'.join(graph), - handler=self.params['params']['handler'], - core=self.params['core'], - cores_qps_cdefs='%s,%s' % (','.join(map(lambda x: 'qps_%s' % x, cores)),','.join(['+']*(len(cores)-1))), + cores_qps_graphs='\n'.join(graph), + handler=self.params['params']['handler'], + core=self.params['core'], + cores_qps_cdefs='%s,%s' % (','.join(map(lambda x: 'qps_%s' % x, cores)),','.join(['+']*(len(cores)-1))), gorder=','.join(cores) ) @@ -481,7 +481,7 @@ if __name__ == '__main__': SOLR_HOST_PORT = os.environ.get('host_port', 'localhost:8080').replace('http://', '') SOLR_URL = os.environ.get('url', '/solr') if SOLR_URL[0] != '/': - SOLR_URL = '/' + SOLR_URL + SOLR_URL = '/' + SOLR_URL mb = SolrMuninGraph(SOLR_HOST_PORT, SOLR_URL, params) if hasattr(mb, params['op']): print getattr(mb, params['op'])(params['type']) diff --git a/plugins/solr/solrmulticore b/plugins/solr/solrmulticore index b210246f..a3c22149 100755 --- a/plugins/solr/solrmulticore +++ b/plugins/solr/solrmulticore @@ -1,42 +1,42 @@ #!/usr/bin/python -# +# # Copyright (C) Rodolphe Franceschi -# +# # 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 Street, Fifth Floor, Boston, MA 02110-1301, USA. -# -# +# +# # This plugin monitors a SOLR server configured for multicore by automatically # getting core names from SOLR default page. -# +# # Tested on SOLR 1.4.0 -# +# # Parameters: # config (required) # autoconf (optional - used by munin-config) # # For the full list of options, refer to PLUGINOPTIONSLIST variable -# +# # Example of symlink creation on Debian Lenny # ln -s /usr/share/munin/plugins/solrmulticore_ /etc/munin/plugins/solrmulticore_avgRequestsPerSecond -# +# # Magic markers (Used by munin-config and some installation scripts. # Optional): #%# family=auto #%# capabilities=autoconf -import sys, os +import sys, os import urllib2 import HTMLParser, urllib @@ -101,7 +101,7 @@ def parseArgs(): params = { } params['valueName'] = parts[1] - + # Automatic / Manual Mode for core names if (len(SOLR_CORES) == 0): params['cores'] = getSolrCoreNameList() @@ -173,7 +173,7 @@ if len(sys.argv) > 1: params = parseArgs() for core in params['cores']: #print core, params['valueName'] - queues = fetchUrl(core, PLUGINOPTIONSLIST[params['valueName']]['xmlpath']) + queues = fetchUrl(core, PLUGINOPTIONSLIST[params['valueName']]['xmlpath']) searcher = getEntry(queues, PLUGINOPTIONSLIST[params['valueName']]['xmlparententryname']) value = getValue(searcher, params['valueName']).strip() print "%s.value %s" % (core, value) diff --git a/plugins/solr/wfsolr_ b/plugins/solr/wfsolr_ index fa5d5025..708aaa1d 100755 --- a/plugins/solr/wfsolr_ +++ b/plugins/solr/wfsolr_ @@ -14,7 +14,7 @@ * * You need to have a PHP 5.2.6+ CLI installed too with curl extension or * allow_url_fopen directive on - * + * * Once the plugin is available you can symlink it with the following naming convention : * wfsolr-[name of the core]-[name of the stats section - ex.: CORE]-[name of the entry in the xml - ex.: searcher]-[name of the stat to graph - ex.: numDocs] * diff --git a/plugins/sphinx/sphinx_documents b/plugins/sphinx/sphinx_documents index 9b73e15d..3a4cb67a 100755 --- a/plugins/sphinx/sphinx_documents +++ b/plugins/sphinx/sphinx_documents @@ -27,7 +27,7 @@ done exit 0;; esac -for i in `ls $idxpath/*.sph`; do +for i in `ls $idxpath/*.sph`; do echo -n "`basename $i .sph`.value " echo `indextool --dumpheader $i | grep ^total-doc | cut -f2 -d\:` done diff --git a/plugins/spotweb/spotweb_average b/plugins/spotweb/spotweb_average index 4e906ac0..a05b7784 100755 --- a/plugins/spotweb/spotweb_average +++ b/plugins/spotweb/spotweb_average @@ -8,7 +8,7 @@ # Original idea : smeerbartje (http://gathering.tweakers.net/forum/myreact/190949) # slommer (http://gathering.tweakers.net/forum/myreact/353335) # -# This program is free software: you can redistribute it and/or modify +# 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 3 of the License, or # (at your option) any later version. @@ -68,7 +68,7 @@ EOC # Spot count my $spots = `$MYSQL $MYSQLOPTS -e 'SELECT count(*) as spots FROM $DATABASE.spots WHERE stamp > $FROMSTAMP;'`; -$spots =~ /(\d+)/; +$spots =~ /(\d+)/; print "spots.value ".$1."\n"; # Downloaded diff --git a/plugins/spotweb/spotweb_cat_average b/plugins/spotweb/spotweb_cat_average index 0929fc19..4349151e 100755 --- a/plugins/spotweb/spotweb_cat_average +++ b/plugins/spotweb/spotweb_cat_average @@ -6,7 +6,7 @@ # # Spotweb : http://github.com/spotweb/spotweb # -# This program is free software: you can redistribute it and/or modify +# 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 3 of the License, or # (at your option) any later version. @@ -69,13 +69,13 @@ EOC # Output of values. We just call a subroutine here to prevent much duplicate code -if($COUNTPORN eq 'yes') { +if($COUNTPORN eq 'yes') { &print_value(0); } -else { +else { # 11-04-2011 - New pr0n filters # &print_value(0, " AND subcatd NOT LIKE '%23%' AND subcatd NOT LIKE '%24%' AND subcatd NOT LIKE '%25%' AND subcatd NOT LIKE '%26%'"); - &print_value(0, " AND subcatz NOT LIKE '%4%' AND subcatd NOT LIKE '%23%' AND subcatd NOT LIKE '%24%' AND subcatd NOT LIKE '%25%' AND subcatd NOT LIKE '%26%' AND subcatd NOT LIKE '%72%' AND subcatd NOT LIKE '%73%' AND subcatd NOT LIKE '%74%' AND subcatd NOT LIKE '%75%' AND subcatd NOT LIKE '%76%' AND subcatd NOT LIKE '%77%' AND subcatd NOT LIKE '%78%' AND subcatd NOT LIKE '%79%' AND subcatd NOT LIKE '%80%' AND subcatd NOT LIKE '%81%' AND subcatd NOT LIKE '%82%' AND subcatd NOT LIKE '%83%' AND subcatd NOT LIKE '%84%' AND subcatd NOT LIKE '%85%' AND subcatd NOT LIKE '%86%' AND subcatd NOT LIKE '%87%' AND subcatd NOT LIKE '%88%' AND subcatd NOT LIKE '%88%' AND subcatd NOT LIKE '%89%'"); + &print_value(0, " AND subcatz NOT LIKE '%4%' AND subcatd NOT LIKE '%23%' AND subcatd NOT LIKE '%24%' AND subcatd NOT LIKE '%25%' AND subcatd NOT LIKE '%26%' AND subcatd NOT LIKE '%72%' AND subcatd NOT LIKE '%73%' AND subcatd NOT LIKE '%74%' AND subcatd NOT LIKE '%75%' AND subcatd NOT LIKE '%76%' AND subcatd NOT LIKE '%77%' AND subcatd NOT LIKE '%78%' AND subcatd NOT LIKE '%79%' AND subcatd NOT LIKE '%80%' AND subcatd NOT LIKE '%81%' AND subcatd NOT LIKE '%82%' AND subcatd NOT LIKE '%83%' AND subcatd NOT LIKE '%84%' AND subcatd NOT LIKE '%85%' AND subcatd NOT LIKE '%86%' AND subcatd NOT LIKE '%87%' AND subcatd NOT LIKE '%88%' AND subcatd NOT LIKE '%88%' AND subcatd NOT LIKE '%89%'"); } &print_value(1); &print_value(2); @@ -85,6 +85,6 @@ else { # Subroutine to print the values sub print_value { my $spots = `$MYSQL $MYSQLOPTS -e "SELECT count(*) as spots FROM $DATABASE.spots WHERE stamp > $FROMSTAMP AND category = $_[0]$_[1];"`; - $spots =~ /(\d+)/; - print "cat".$_[0].".value ".$1."\n"; + $spots =~ /(\d+)/; + print "cat".$_[0].".value ".$1."\n"; } diff --git a/plugins/spotweb/spotweb_cat_total b/plugins/spotweb/spotweb_cat_total index 3b5f789d..ed09e79c 100755 --- a/plugins/spotweb/spotweb_cat_total +++ b/plugins/spotweb/spotweb_cat_total @@ -62,10 +62,10 @@ exit 0; if($COUNTPORN eq 'yes') { &print_value(0); } -else { +else { # 11-04-2011 - Added the new pr0n filters -# &print_value(0, " AND subcatd NOT LIKE '%23%' AND subcatd NOT LIKE '%24%' AND subcatd NOT LIKE '%25%' AND subcatd NOT LIKE '%26%'"); - &print_value(0, " AND (subcatz IS NULL OR subcatz NOT LIKE '%z4%') AND subcatd NOT LIKE '%d23%' AND subcatd NOT LIKE '%d24%' AND subcatd NOT LIKE '%d25%' AND subcatd NOT LIKE '%d26%' AND subcatd NOT LIKE '%d72%' AND subcatd NOT LIKE '%d73%' AND subcatd NOT LIKE '%d74%' AND subcatd NOT LIKE '%d75%' AND subcatd NOT LIKE '%d76%' AND subcatd NOT LIKE '%d77%' AND subcatd NOT LIKE '%d78%' AND subcatd NOT LIKE '%d79%' AND subcatd NOT LIKE '%d80%' AND subcatd NOT LIKE '%d81%' AND subcatd NOT LIKE '%d82%' AND subcatd NOT LIKE '%d83%' AND subcatd NOT LIKE '%d84%' AND subcatd NOT LIKE '%d85%' AND subcatd NOT LIKE '%d86%' AND subcatd NOT LIKE '%d87%' AND subcatd NOT LIKE '%d88%' AND subcatd NOT LIKE '%d88%' AND subcatd NOT LIKE '%d89%'"); +# &print_value(0, " AND subcatd NOT LIKE '%23%' AND subcatd NOT LIKE '%24%' AND subcatd NOT LIKE '%25%' AND subcatd NOT LIKE '%26%'"); + &print_value(0, " AND (subcatz IS NULL OR subcatz NOT LIKE '%z4%') AND subcatd NOT LIKE '%d23%' AND subcatd NOT LIKE '%d24%' AND subcatd NOT LIKE '%d25%' AND subcatd NOT LIKE '%d26%' AND subcatd NOT LIKE '%d72%' AND subcatd NOT LIKE '%d73%' AND subcatd NOT LIKE '%d74%' AND subcatd NOT LIKE '%d75%' AND subcatd NOT LIKE '%d76%' AND subcatd NOT LIKE '%d77%' AND subcatd NOT LIKE '%d78%' AND subcatd NOT LIKE '%d79%' AND subcatd NOT LIKE '%d80%' AND subcatd NOT LIKE '%d81%' AND subcatd NOT LIKE '%d82%' AND subcatd NOT LIKE '%d83%' AND subcatd NOT LIKE '%d84%' AND subcatd NOT LIKE '%d85%' AND subcatd NOT LIKE '%d86%' AND subcatd NOT LIKE '%d87%' AND subcatd NOT LIKE '%d88%' AND subcatd NOT LIKE '%d88%' AND subcatd NOT LIKE '%d89%'"); } &print_value(1); &print_value(2); @@ -73,6 +73,6 @@ else { sub print_value { my $spots = `$MYSQL $MYSQLOPTS -e "SELECT count(*) as spots FROM $DATABASE.spots WHERE category = $_[0]$_[1];"`; - $spots =~ /(\d+)/; - print "cat".$_[0].".value ".$1."\n"; + $spots =~ /(\d+)/; + print "cat".$_[0].".value ".$1."\n"; } diff --git a/plugins/spotweb/spotweb_catsize_average b/plugins/spotweb/spotweb_catsize_average index f938954f..2f3f65ed 100755 --- a/plugins/spotweb/spotweb_catsize_average +++ b/plugins/spotweb/spotweb_catsize_average @@ -6,7 +6,7 @@ # # Spotweb : http://github.com/spotweb/spotweb # -# This program is free software: you can redistribute it and/or modify +# 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 3 of the License, or # (at your option) any later version. @@ -68,13 +68,13 @@ EOC } # Output of values. We just call a subroutine here to prevent much duplicate code -if($COUNTPORN eq 'yes') { +if($COUNTPORN eq 'yes') { &print_value(0); } -else { +else { # 11-04-2011 - New pr0n filters # &print_value(0, " AND subcatd NOT LIKE '%23%' AND subcatd NOT LIKE '%24%' AND subcatd NOT LIKE '%25%' AND subcatd NOT LIKE '%26%'"); - &print_value(0, " AND (subcatz IS NULL OR subcatz NOT LIKE '%4%') AND subcatd NOT LIKE '%23%' AND subcatd NOT LIKE '%24%' AND subcatd NOT LIKE '%25%' AND subcatd NOT LIKE '%26%' AND subcatd NOT LIKE '%72%' AND subcatd NOT LIKE '%73%' AND subcatd NOT LIKE '%74%' AND subcatd NOT LIKE '%75%' AND subcatd NOT LIKE '%76%' AND subcatd NOT LIKE '%77%' AND subcatd NOT LIKE '%78%' AND subcatd NOT LIKE '%79%' AND subcatd NOT LIKE '%80%' AND subcatd NOT LIKE '%81%' AND subcatd NOT LIKE '%82%' AND subcatd NOT LIKE '%83%' AND subcatd NOT LIKE '%84%' AND subcatd NOT LIKE '%85%' AND subcatd NOT LIKE '%86%' AND subcatd NOT LIKE '%87%' AND subcatd NOT LIKE '%88%' AND subcatd NOT LIKE '%88%' AND subcatd NOT LIKE '%89%'"); + &print_value(0, " AND (subcatz IS NULL OR subcatz NOT LIKE '%4%') AND subcatd NOT LIKE '%23%' AND subcatd NOT LIKE '%24%' AND subcatd NOT LIKE '%25%' AND subcatd NOT LIKE '%26%' AND subcatd NOT LIKE '%72%' AND subcatd NOT LIKE '%73%' AND subcatd NOT LIKE '%74%' AND subcatd NOT LIKE '%75%' AND subcatd NOT LIKE '%76%' AND subcatd NOT LIKE '%77%' AND subcatd NOT LIKE '%78%' AND subcatd NOT LIKE '%79%' AND subcatd NOT LIKE '%80%' AND subcatd NOT LIKE '%81%' AND subcatd NOT LIKE '%82%' AND subcatd NOT LIKE '%83%' AND subcatd NOT LIKE '%84%' AND subcatd NOT LIKE '%85%' AND subcatd NOT LIKE '%86%' AND subcatd NOT LIKE '%87%' AND subcatd NOT LIKE '%88%' AND subcatd NOT LIKE '%88%' AND subcatd NOT LIKE '%89%'"); } &print_value(1); &print_value(2); @@ -89,6 +89,6 @@ sub print_value { print "cat".$_[0].".value 0\n"; } else { - print "cat".$_[0].".value ".$1."\n"; + print "cat".$_[0].".value ".$1."\n"; } } diff --git a/plugins/spotweb/spotweb_total b/plugins/spotweb/spotweb_total index 10d839e4..c61a7321 100755 --- a/plugins/spotweb/spotweb_total +++ b/plugins/spotweb/spotweb_total @@ -67,7 +67,7 @@ EOC # Spot count my $spots = `$MYSQL $MYSQLOPTS -e 'SELECT count(*) as spots FROM $DATABASE.spots;'`; -$spots =~ /(\d+)/; +$spots =~ /(\d+)/; print "spots.value ".$1."\n"; if($SPOTSFULL eq 'yes') { diff --git a/plugins/squid/squid b/plugins/squid/squid index 1f404431..3e894771 100755 --- a/plugins/squid/squid +++ b/plugins/squid/squid @@ -11,7 +11,7 @@ Any system running squid and avialable cache_object:// =head1 CONFIGURATION -The following environment settings are the default configuration. +The following environment settings are the default configuration. [squid] env.squidhost localhost @@ -82,9 +82,9 @@ _ return sprintf($r_text, $squid_host, $what, &make_auth_header()); } -sub make_auth_header +sub make_auth_header { - if(defined $squid_passwd && $squid_passwd ne "") + if(defined $squid_passwd && $squid_passwd ne "") { my $h_text = <<_; Authorization: Basic %s @@ -99,22 +99,22 @@ _ sub squid_requst { my $what = $_[0]; - die "Could not connect: $!\n" unless my $cachemgr = IO::Socket::INET->new(PeerAddr => $squid_host, - PeerPort => $squid_port, - Proto => 'tcp', + die "Could not connect: $!\n" unless my $cachemgr = IO::Socket::INET->new(PeerAddr => $squid_host, + PeerPort => $squid_port, + Proto => 'tcp', Timeout => $squid_request_timeout); my $request = &make_request($what); $cachemgr->syswrite($request, length($request)); return $cachemgr; } -if($ARGV[0] and $ARGV[0] eq "autoconf") +if($ARGV[0] and $ARGV[0] eq "autoconf") { if (squid_requst('menu')->getline ne "") { print "yes\n"; } exit 0; } -if($ARGV[0] and $ARGV[0] eq "config") +if($ARGV[0] and $ARGV[0] eq "config") { my %config; # ------------------------------------------------- squid_efficiency_ ----------------------------------------- @@ -349,7 +349,7 @@ my $cm; my %data; # ----------------- squid_efficiency_ and squid_memory -------------------- $cm = squid_requst('info'); -while (my $line = $cm->getline) +while (my $line = $cm->getline) { # ----------------- squid_efficiency_ -------------------- if($line =~ /Hits as % of all requests:.*/) { ($data{'squid_efficiency_5'}{'all'}, $data{'squid_efficiency_60'}{'all'}) = $line =~ /([\d.]+)%/g; next; } @@ -392,7 +392,7 @@ while (my $line = $cm->getline) # ----------------- squid_ipcache -------------------- $cm = squid_requst('ipcache'); -while (my $line = $cm->getline) +while (my $line = $cm->getline) { if($line =~ /IPcache Entries:.*/) { $data{'squid_ipcache'}{'entries'} = ($line =~ /(\d+)/g)[0]; next; } if($line =~ /IPcache Requests:.*/) { $data{'squid_ipcache'}{'request'} = ($line =~ /(\d+)/g)[0]; next; } diff --git a/plugins/squid/squid_efficiency b/plugins/squid/squid_efficiency index 6bbd28c4..286c9f3a 100755 --- a/plugins/squid/squid_efficiency +++ b/plugins/squid/squid_efficiency @@ -51,7 +51,7 @@ # # [squid_efficiency] # env.squidhost yourhost.example.com -# env.squidport 8080 +# env.squidport 8080 # host=${squidhost:-localhost} diff --git a/plugins/squid/squid_times b/plugins/squid/squid_times index 1a4b6d10..3e5311fc 100755 --- a/plugins/squid/squid_times +++ b/plugins/squid/squid_times @@ -4,7 +4,7 @@ # License GPL V2 or higher # # Abstract -# munin plugin that logs the cache mean services times +# munin plugin that logs the cache mean services times # Requires netcat (here nc) # # Authors @@ -19,7 +19,7 @@ port=${squidport:-3128} if [ "$1" = "autoconf" ]; then SQUID_STATS=`printf "GET cache_object://$host/info HTTP/1.0\n\n" | netcat $host $port` if [ -n "${SQUID_STATS}" ]; then - echo yes + echo yes exit 0 else echo "no (HTTP GET failed)" @@ -35,7 +35,7 @@ if [ "$1" = "config" ]; then echo 'graph_vlabel median response times (s)' echo 'mean_http.label Http' - echo 'mean_cmis.label Cache misses' + echo 'mean_cmis.label Cache misses' echo 'mean_chits.label Cache hits' echo 'mean_nhits.label Near hits' echo 'mean_nmr.label Not-modified replies' @@ -43,7 +43,7 @@ if [ "$1" = "config" ]; then echo 'mean_icpq.label Icp queries' exit 0 -fi +fi SQUID_TIME=$(printf "GET cache_object://$host/info HTTP/1.0\n\n" | nc $host $port) @@ -57,7 +57,7 @@ SQUID_TIME_ICP_QUERIES=$(echo "$SQUID_TIME" | grep "ICP Queries" | cut -d':' -f2 echo "mean_http.value $SQUID_TIME_HTTP" echo "mean_cmis.value $SQUID_TIME_CACHE_MISSES" -echo "mean_chits.value $SQUID_TIME_CACHE_HITS" +echo "mean_chits.value $SQUID_TIME_CACHE_HITS" echo "mean_nhits.value $SQUID_TIME_NEAR_HITS" echo "mean_nmr.value $SQUID_TIME_NM_REPLIES" echo "mean_dnsl.value $SQUID_TIME_DNS_LOOKUPS" diff --git a/plugins/ssh/hostdenied b/plugins/ssh/hostdenied index 9996f2d6..611c632e 100755 --- a/plugins/ssh/hostdenied +++ b/plugins/ssh/hostdenied @@ -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. # @@ -22,19 +22,19 @@ # # ------------------------------------------------------------------------------------------------------ # 20100310 v1.01 ls -# as threatened, shows now "temperatures" of active hosts.deny lines. Recent additions are +# as threatened, shows now "temperatures" of active hosts.deny lines. Recent additions are # displayed in bright red, turning to blue as older the addition rules are. # This requires denyhosts to add line to hosts.deny in a specific format. Also, times are currently # hardcoded, and not a lot of flexibility adjusting them through parameters. # A line in hosts.deny should come with a comment, looking like: # # DenyHosts: Sat Mar 6 01:11:57 2010 | sshd: 87.101.51.198 # 8 graphs are drawn from that depicting number of rules in 24 h increments. Different colours are -# assigned to graphs which are <24h, 24-48h, 48-72h ... old. The last (coldest) graph shows rules +# assigned to graphs which are <24h, 24-48h, 48-72h ... old. The last (coldest) graph shows rules # which have been added > 168h ago. # I'm considerering to change age granularity to hours, rather than days, and plot many graphs (64 or 128, -# which are nice for colour calculations), showing more of a colour cloud than discernible areas. +# which are nice for colour calculations), showing more of a colour cloud than discernible areas. # The plugin must have permission to read /etc/hosts.deny, of course. -# 20100308, v1.0, ls +# 20100308, v1.0, ls # Will probably add multiple stacked graphs, indicative for addition/removal date of denies, # instead of a boring single area graph. # ------------------------------------------------------------------------------------------------------ @@ -80,7 +80,7 @@ run_fetch() { TOTAL=0 NOW=$(date +%s) sed -n 's/^\# DenyHosts: //;s/ | .*//gp' $DENY | # strip all but date - while read DATE; do + while read DATE; do echo $(((NOW - $(date -d "$DATE" +%s))/86400)) # calculate rule age done > $STATEFILE # rather than going through temp file, the age could be for AGE in {0..6} ; do # used to increment an array element with that index. diff --git a/plugins/ssh/openssh-denyhosts b/plugins/ssh/openssh-denyhosts index 46c13bcd..9990975c 100755 --- a/plugins/ssh/openssh-denyhosts +++ b/plugins/ssh/openssh-denyhosts @@ -11,8 +11,8 @@ # mktempfile () { -mktemp -t -} +mktemp -t +} AUTH_LOG=${logfile:-/var/log/auth.log} STATEFILE=$MUNIN_PLUGSTATE/sshd.offset @@ -59,7 +59,7 @@ then $LOGTAIL ${AUTH_LOG} $STATEFILE | grep 'sshd' > ${TEMP_FILE} refused=`grep -ic 'refused' ${TEMP_FILE}` - accepted=`grep -ic 'accepted' ${TEMP_FILE}` + accepted=`grep -ic 'accepted' ${TEMP_FILE}` invalid=`grep -ic 'invalid user' ${TEMP_FILE}` failed=`grep -ic 'failed password' ${TEMP_FILE}` diff --git a/plugins/swap/swapspace-info b/plugins/swap/swapspace-info index 766afc36..a6d82cc3 100755 --- a/plugins/swap/swapspace-info +++ b/plugins/swap/swapspace-info @@ -44,7 +44,7 @@ http://www.brendangregg.com/K9Toolkit/swapinfo =head1 LICENSE -GPL 2. +GPL 2. =cut @@ -87,7 +87,7 @@ sub value my %VMinfo; # --- Fetch VM info --- - foreach my $count (0..12) + foreach my $count (0..12) { # # The values are counters that increment each second, here we @@ -97,16 +97,16 @@ sub value foreach my $var ("swap_avail","swap_alloc","swap_free") { $VMnow{$var} = $Kstat->{unix}->{0}->{vminfo}->{$var}; - unless ($count) + unless ($count) { $VMold{$var} = $VMnow{$var}; next; } - if (($VMnow{$var} != $VMold{$var}) && (! $VMinfo{$var})) + if (($VMnow{$var} != $VMold{$var}) && (! $VMinfo{$var})) { $VMinfo{$var} = $VMnow{$var} - $VMold{$var}; } - } + } select(undef, undef, undef, 0.1); $Kstat->update(); } @@ -152,7 +152,7 @@ sub config "Unalloc ", "Avail ", "\n"; - + print "Alloc.label Alloc \n"; print "Alloc.draw \n"; print "Alloc.info Swap used.\n"; diff --git a/plugins/syncthing/strelaysrv_ b/plugins/syncthing/strelaysrv_ index 5a30f27b..dabc504e 100755 --- a/plugins/syncthing/strelaysrv_ +++ b/plugins/syncthing/strelaysrv_ @@ -11,13 +11,13 @@ This plugin requires the curl utility : https://curl.haxx.se/ Available plugins : strelaysrv_goroutine # -strelaysrv_num # +strelaysrv_num # strelaysrv_proxied # strelaysrv_transfer # strelaysrv_uptime # =head1 CONFIGURATION -To make the plugin connect to the Syncthing relay server one has to use this type of +To make the plugin connect to the Syncthing relay server one has to use this type of configuration [strelaysrv_*] @@ -88,7 +88,7 @@ goroutine() { graph_title Syncthing relay go routines graph_vlabel number of go routines graph_category network -strelaysrv_goroutine.label routines +strelaysrv_goroutine.label routines EOM exit 0;; *) @@ -139,9 +139,9 @@ EOM cd "$(dirname "$0")" || exit CURL=$(which curl) -JQ=$(which jq) +JQ=$(which jq) -case $(basename "$0") in +case $(basename "$0") in strelaysrv_num) num "$1" exit 0;; diff --git a/plugins/syncthing/syncthing_ b/plugins/syncthing/syncthing_ index 7bfd0cd0..8c7fc8a9 100755 --- a/plugins/syncthing/syncthing_ +++ b/plugins/syncthing/syncthing_ @@ -11,14 +11,14 @@ This plugin requires the jq utility : https://stedolan.github.io/jq/ This plugin requires the cURL utility : https://curl.haxx.se/ Available plugins : -syncthing_cpu # +syncthing_cpu # syncthing_mem # syncthing_goroutine # syncthing_transfer # syncthing_uptime # =head1 CONFIGURATION -To make the plugin connect to the Syncthing server one has to use this type of +To make the plugin connect to the Syncthing server one has to use this type of configuration [syncthing_*] @@ -109,7 +109,7 @@ goroutine() { graph_title Syncthing server go routines graph_vlabel number of go routines graph_category network -syncthing_goroutine.label routines +syncthing_goroutine.label routines EOM exit 0;; *) @@ -152,7 +152,7 @@ cd "$(dirname "$0")" || exit CURL=$(which curl) JQ=$(which jq) -case $(basename "$0") in +case $(basename "$0") in syncthing_cpu) cpu "$1" exit 0;; diff --git a/plugins/synology/snmp__synology_hddtemp b/plugins/synology/snmp__synology_hddtemp index 57931c3d..17310197 100755 --- a/plugins/synology/snmp__synology_hddtemp +++ b/plugins/synology/snmp__synology_hddtemp @@ -4,7 +4,7 @@ =head1 NAME -snmp__syno_hddtemp - Munin plugin to monitor the temperature of +snmp__syno_hddtemp - Munin plugin to monitor the temperature of harddisks in an Synology NAS. =head1 APPLICABLE SYSTEMS @@ -33,7 +33,7 @@ The temperature of each disk installed in °C. =head1 MIB INFORMATION -This plugin requires support for the synoDisk. It reports +This plugin requires support for the synoDisk. It reports the temperature of the installed disks. =head1 MAGIC MARKERS diff --git a/plugins/synology/snmp__synology_temperature b/plugins/synology/snmp__synology_temperature index 522dfa75..a871897e 100755 --- a/plugins/synology/snmp__synology_temperature +++ b/plugins/synology/snmp__synology_temperature @@ -4,7 +4,7 @@ =head1 NAME -snmp__syno_temperature - Munin plugin to retrieve current temperature from a +snmp__syno_temperature - Munin plugin to retrieve current temperature from a Synology NAS. =head1 APPLICABLE SYSTEMS diff --git a/plugins/synology/snmp__synology_ups b/plugins/synology/snmp__synology_ups index 0b1ca5cb..2fd6e3f5 100755 --- a/plugins/synology/snmp__synology_ups +++ b/plugins/synology/snmp__synology_ups @@ -4,7 +4,7 @@ =head1 NAME -snmp__syno_ups - Munin plugin to retrieve various information of the +snmp__syno_ups - Munin plugin to retrieve various information of the UPS attached to a Synology NAS. =head1 APPLICABLE SYSTEMS diff --git a/plugins/system/auth b/plugins/system/auth index 7edd39ad..5782cf68 100755 --- a/plugins/system/auth +++ b/plugins/system/auth @@ -1,5 +1,5 @@ #!/bin/bash -# +# # A Munin Plugin to show auth stuff # Created by Dominik Schulz # http://developer.gauner.org/munin/ diff --git a/plugins/system/blockhosts b/plugins/system/blockhosts index 652752e5..400d7404 100755 --- a/plugins/system/blockhosts +++ b/plugins/system/blockhosts @@ -2,7 +2,7 @@ # Plugin to monitor the number of hosts denied by BlockHosts # # $Log$ -# based on: +# based on: # denyhosts plugin # Revision 1.0 2009/06/05 16:00:00 tjansson # @@ -11,7 +11,7 @@ # Parameters: # config (required) # autoconf (optional - used by munin-config) - + LOG=/etc/hosts.allow if [ "$1" = "autoconf" ]; then @@ -23,9 +23,9 @@ if [ "$1" = "autoconf" ]; then exit 1 fi fi - + if [ "$1" = "config" ]; then - + echo 'graph_title Hosts denied by BlockHosts' echo 'graph_args -l 0' echo 'graph_vlabel denied hosts ' @@ -34,6 +34,6 @@ if [ "$1" = "config" ]; then echo 'HostsWatched.label Hosts watched by BlockHosts' exit 0 fi - + echo HostsDenied.value `egrep -c " : deny" $LOG` echo HostsWatched.value `egrep -c "#bh: ip:" $LOG` diff --git a/plugins/system/cpu_linux_multi b/plugins/system/cpu_linux_multi index b45e8b47..a3363451 100755 --- a/plugins/system/cpu_linux_multi +++ b/plugins/system/cpu_linux_multi @@ -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 diff --git a/plugins/system/fresh-backups b/plugins/system/fresh-backups index e1215458..efde7930 100755 --- a/plugins/system/fresh-backups +++ b/plugins/system/fresh-backups @@ -24,7 +24,7 @@ daily archives. env.lifetime 2 env.archive_pattern *.tar.bz2 env.backup_number 4 - + This will also set the warning and critical values for this plugin to 2*4 and 4, respectively, meaning that if the number of fresh files goes below those limits, the relevant notifications will be triggerred. diff --git a/plugins/system/hugepages b/plugins/system/hugepages index 78eca8f5..40d1b4e3 100755 --- a/plugins/system/hugepages +++ b/plugins/system/hugepages @@ -9,7 +9,7 @@ # transparent_hugepages kernel command line parameter). All values are # shown in (KiBi/MeBi/GiBi)Bytes. # -# This plugin is used like many other munin plugins: put it in +# This plugin is used like many other munin plugins: put it in # /usr/share/munin/plugins (or another appropriate location) # and create a symlink in /etc/munin/plugins: # > ln -s /usr/share/munin/plugins/hugepages /etc/munin/plugins diff --git a/plugins/system/irq b/plugins/system/irq index 31f613e4..6949bea1 100755 --- a/plugins/system/irq +++ b/plugins/system/irq @@ -114,7 +114,7 @@ my $irq_types = 'sirq' => 'Software interrupts' }; -my $irq_descriptions = +my $irq_descriptions = { 'HI' => 'High priority tasklets', 'TIMER' => 'Timer bottom half', @@ -127,7 +127,7 @@ my $irq_descriptions = # ----------------- main ---------------- need_multigraph(); # -- autoconf -- -if (defined($ARGV[0]) and ($ARGV[0] eq 'autoconf')) +if (defined($ARGV[0]) and ($ARGV[0] eq 'autoconf')) { printf("%s\n", (-e "/proc/interrupts" and -e "/proc/softirqs") ? "yes" : "no (stats not exists)"); exit (0); @@ -309,15 +309,15 @@ sub prepare_graphs $gr->{'irq'}{'fields'}{$down_field_name}{'type'} = $fields->{'irq_sirq'}{'type'}; $gr->{'irq'}{'fields'}{$up_field_name}{'draw'} = $fields->{'irq_sirq'}{'draw'}; $gr->{'irq'}{'fields'}{$down_field_name}{'draw'} = $fields->{'irq_sirq'}{'draw'}; - + $gr->{'irq'}{'fields'}{$up_field_name}{'label'} = replace($fields->{'irq_sirq'}{'label'}, ':cpu:', $i); $gr->{'irq'}{'fields'}{$up_field_name}{'info'} = replace($fields->{'irq_sirq'}{'info'} , ':cpu:', $i); $gr->{'irq'}{'fields'}{$down_field_name}{'label'} = 'NaN'; $gr->{'irq'}{'fields'}{$down_field_name}{'info'} = 'NaN'; - + $gr->{'irq'}{'fields'}{$up_field_name}{'negative'} = $down_field_name; $gr->{'irq'}{'fields'}{$down_field_name}{'graph'} = 'no'; - + # --- child graphs --- for my $irq_type (qw(irq sirq)) { @@ -335,7 +335,7 @@ sub prepare_graphs my @irq_names = keys %{$IRQi->{'stat'}{$irq_type}{$i}}; # names split for better sorting for my $irq_name (( - (sort {int $a <=> int $b} grep{/^\d/} @irq_names), + (sort {int $a <=> int $b} grep{/^\d/} @irq_names), (sort grep{!/(^\d|ERR|MIS)/} @irq_names), (sort grep{/(ERR|MIS)/ } @irq_names) )) @@ -347,7 +347,7 @@ sub prepare_graphs { $gr->{$graph_name}{'fields'}{$field_name}{$fo} = replace($fields->{'irq'}{$fo}, ':irq:', $irq_name); $gr->{$graph_name}{'fields'}{$field_name}{$fo} = replace($gr->{$graph_name}{'fields'}{$field_name}{$fo}, - ':irqinfo:', + ':irqinfo:', exists($IRQi->{'description'}{$irq_type}{$irq_name}) ? $IRQi->{'description'}{$irq_type}{$irq_name} : ''); diff --git a/plugins/system/pagefaults_by_process b/plugins/system/pagefaults_by_process index 9396d42c..22eedcd0 100755 --- a/plugins/system/pagefaults_by_process +++ b/plugins/system/pagefaults_by_process @@ -18,7 +18,7 @@ # that die may not appear on the graph, and anyway their last chunk of # CPU usage before they died is lost. You could modify this plugin to # read SAR/psacct records if you care about that. -# +# # 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; version 2 dated June, diff --git a/plugins/system/raminfo b/plugins/system/raminfo index d0d0f77d..4f513c42 100755 --- a/plugins/system/raminfo +++ b/plugins/system/raminfo @@ -7,7 +7,7 @@ # RAM Used Anon, Exec + Libs, Page cache # RAM Avail Free memory that can be immediately used # -# Core logic developed by Brendan Gregg. +# Core logic developed by Brendan Gregg. # REFERENCE: http://www.brendangregg.com/k9toolkit.html - the swap diagram. # # COPYRIGHT: Copyright (c) 2004 Brendan Gregg. @@ -39,7 +39,7 @@ raminfo - Plugin for monitoring memory usage =head1 AUTHOR Christian Braum, chrisi_braum@web.de - + Core logic developed by Brendan Gregg. See K9Toolkit: http://www.brendangregg.com/K9Toolkit/swapinfo @@ -103,7 +103,7 @@ sub value # get value for variables my %VMinfo; my %VMold; - foreach my $count (0..12) + foreach my $count (0..12) { # # The values are counters that increment each second, here we @@ -111,7 +111,7 @@ sub value # get value for variables # (reading them once then again a second later was not reliable). # - foreach my $var ( "freemem" ) + foreach my $var ( "freemem" ) { $VMnow{$var} = $Kstat->{unix}->{0}->{vminfo}->{$var}; unless ($count) { @@ -148,18 +148,18 @@ sub value # get value for variables my $ram_used = $pagestotal - $freemem - $ram_kernel - $ram_locked; ### format values - + my $freemem_B = sprintf( "%d ", $freemem * $PAGETOBYTE ); my $pp_kernel_B = sprintf( "%d ", $pp_kernel * $PAGETOBYTE ); my $pageslocked_B = sprintf( "%d ", $pageslocked * $PAGETOBYTE ); my $pagestotal_B = sprintf( "%d ", $pagestotal * $PAGETOBYTE ); my $ram_unusable_B = sprintf( "%d ", $ram_unusable * $PAGETOBYTE ); - my $ram_kernel_B = sprintf( "%d ", $ram_kernel * $PAGETOBYTE ); + my $ram_kernel_B = sprintf( "%d ", $ram_kernel * $PAGETOBYTE ); my $ram_locked_B = sprintf( "%d ", $ram_locked * $PAGETOBYTE ); my $ram_used_B = sprintf( "%d ", $ram_used * $PAGETOBYTE ); my $ram_total_B = sprintf( "%d ", $ram_total * $PAGETOBYTE ); - # --- assign the variables --- + # --- assign the variables --- $h_ramvalues{"Unusable.value"} = "$ram_unusable_B"; $h_ramvalues{"Kernel.value"} = "$ram_kernel_B"; $h_ramvalues{"Locked.value"} = "$ram_locked_B"; @@ -201,7 +201,7 @@ sub config # print config message and exit. "Used ", "Avail ", "\n"; - + print "Unusable.label Unusable \n"; print "Unusable.draw AREA \n"; print "Unusable.info RAM consumed by the OBP and TSBs.\n"; diff --git a/plugins/system/read_serial_temperature b/plugins/system/read_serial_temperature index 4fef783a..dd4fcf44 100755 --- a/plugins/system/read_serial_temperature +++ b/plugins/system/read_serial_temperature @@ -2,7 +2,7 @@ """ Paul Wiegmans (p.wiegmans@bonhoeffer.nl) 2009 dec 18 -This munin-node plugin reads a temperature value from a serial port, +This munin-node plugin reads a temperature value from a serial port, provided by a Arduino with temperature sensor. For details see: http://amber.bonhoeffer.nl/temperatuur/ @@ -29,7 +29,7 @@ def gettemperature(): t += 1 ser.close() -# shamelessly copied from weather_temp_ +# shamelessly copied from weather_temp_ if len(sys.argv) == 2 and sys.argv[1] == "autoconf": @@ -50,4 +50,4 @@ else: print 'temperature.value %s' % gettemperature() - + diff --git a/plugins/system/total_by_process_ b/plugins/system/total_by_process_ index af4b4003..d374f463 100755 --- a/plugins/system/total_by_process_ +++ b/plugins/system/total_by_process_ @@ -18,7 +18,7 @@ # that die may not appear on the graph, and anyway their last chunk of # CPU usage before they died is lost. You could modify this plugin to # read SAR/psacct records if you care about that. -# +# # 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; version 2 dated June, diff --git a/plugins/tarsnap/README.md b/plugins/tarsnap/README.md index b66af942..f0d6de18 100644 --- a/plugins/tarsnap/README.md +++ b/plugins/tarsnap/README.md @@ -8,18 +8,18 @@ This plugin creates two graphs: * *tarsnap_total* - summarising the total amount of data the local tarsnap instance has stored on the service (total and compressed). * *tarsnap_unique* - summarising the total amount of unique (deduplicated) -data the local tarsnap instance has stored on the service (total and +data the local tarsnap instance has stored on the service (total and compressed). The compressed value here is the actual amount of data stored on the tarnap servers and what tarsnap uses for billing. Usage ----- -Add the following to your backup script (after tarsnap has run), or to a +Add the following to your backup script (after tarsnap has run), or to a cron job: /usr/local/bin/tarsnap --print-stats > /path/to/tarsnap-stats.txt - + N.B.: ensure `/path/to/munin-stats.txt` is readable by munin-node. Configuration diff --git a/plugins/tarsnap/tarsnap b/plugins/tarsnap/tarsnap index a5633cff..006d54ce 100755 --- a/plugins/tarsnap/tarsnap +++ b/plugins/tarsnap/tarsnap @@ -3,14 +3,14 @@ # Munin plugin for Tarsnap # # https://github.com/warrenguy/munin-tarsnap -# +# # USAGE: # # Add the following to your backup script (after tarsnap has run), or to a # cron job: # # /usr/local/bin/tarsnap --print-stats > /path/to/tarsnap-stats.txt -# +# # N.B.: ensure /path/to/munin-stats.txt is readable by munin-node. The # default path this script tries is /var/lib/munin/tarsnap-stats.txt # @@ -37,7 +37,7 @@ case $1 in multigraph tarsnap_total graph_title Tarsnap total data graph_vlabel bytes -graph_category backup +graph_category backup total_size.label Total size total_compressed.label Total size (compressed) diff --git a/plugins/teamspeak/teamspeak_user b/plugins/teamspeak/teamspeak_user index a2490e8d..14b1f5fd 100755 --- a/plugins/teamspeak/teamspeak_user +++ b/plugins/teamspeak/teamspeak_user @@ -26,7 +26,7 @@ use Net::Telnet; # CONFIG HERE! my $hostname = "localhost"; # serveraddress my $port = 10011; # querryport (default: 10011) -my @serverids = (1); # array of virtualserverids (1,2,3,4,...) +my @serverids = (1); # array of virtualserverids (1,2,3,4,...) my $username = ""; # only set if the default queryuser hasn´t enough rights (should work without this) my $password = ""; @@ -47,11 +47,11 @@ if(exists $ARGV[0] and $ARGV[0] eq "config") exit 0; } else -{ - my $telnet = new Net::Telnet(Timeout=>5, Errmode=>"return", Prompt=>"/\r/"); +{ + my $telnet = new Net::Telnet(Timeout=>5, Errmode=>"return", Prompt=>"/\r/"); if (!$telnet->open(Host=>$hostname, Port=>$port)) { die exit; - } + } $telnet->waitfor("/Welcome to the TeamSpeak 3 ServerQuery interface/"); foreach my $server (@serverids) { @@ -62,7 +62,7 @@ else $telnet->waitfor("/error id=0 msg=ok/"); } $telnet->cmd("serverinfo"); - + my $clients = 0; my $queryclients = 0; my $line = $telnet->getline(Timeout=>5); @@ -74,7 +74,7 @@ else } $telnet->waitfor("/error id=0 msg=ok/"); print "$server.value ".($clients - $queryclients)."\n"; - } + } $telnet->close; } exit; diff --git a/plugins/teamspeak/ts3v2_ b/plugins/teamspeak/ts3v2_ index be251358..969efb94 100755 --- a/plugins/teamspeak/ts3v2_ +++ b/plugins/teamspeak/ts3v2_ @@ -16,7 +16,7 @@ # ####################################################### # 02.10.10 - v0.3 -# -now works again with 3.0.0-beta29 +# -now works again with 3.0.0-beta29 # # 18.04.10 - v0.2 # -transfer mode added @@ -25,20 +25,20 @@ # -initial release # ###################################################### - + #%# family=auto #%# capabilities=autoconf suggest - + use strict; use Net::Telnet; - + # CONFIG HERE! my $hostname = $ENV{host} || "localhost"; # serveraddress my $port = $ENV{port} || 10011; # querryport my $user = $ENV{user} || "serveradmin"; my $password = $ENV{password} || ""; my $filename = "ts3v2_"; - + # SCRIPT START! #init telnet connection my $name = ""; my $server = ""; my @num; my $id = 0; my $i = 0; my $myserver; my $transfer; @@ -57,7 +57,7 @@ if ($password ne "") { die "ServerQuery login failed: ".$response; } } - + #get argument my $argument = ""; if ($0 =~ /$filename(\w+)$/i) { @@ -66,7 +66,7 @@ if ($0 =~ /$filename(\w+)$/i) { die "Error: We need to know what serverid you want, so link this plugin as " .$filename."1, ".$filename."2 or ".$filename."overview.\n"; } - + #check for overview, transfer or single server mode my $mode = ""; if ($argument eq "overview" or $argument eq "transfer" or (defined $ARGV[0] and ($ARGV[0] eq "suggest" or $ARGV[0] eq "autoconf"))) { @@ -92,7 +92,7 @@ if ($argument eq "overview" or $argument eq "transfer" or (defined $ARGV[0] and } else { die "ERROR: unknown plugin mode: $argument\n"; } - + #check for config mode if (exists $ARGV[0] and $ARGV[0] eq "autoconf") { print "yes"; @@ -111,7 +111,7 @@ if (exists $ARGV[0] and $ARGV[0] eq "autoconf") { $telnet->waitfor("/error id=0 msg=ok/"); $telnet->cmd("serverinfo"); my $line = $telnet->getline(Timeout=>1); - + if ($line =~ m/virtualserver_id=(\d+) virtual/) { my $id = $1; } else { @@ -124,7 +124,7 @@ if (exists $ARGV[0] and $ARGV[0] eq "autoconf") { die "ERROR: server string not recognized!\n"; } $telnet->waitfor("/error id=0 msg=ok/"); - + print "graph_title Teamspeak Users ".$name."\n"; print "graph_vlabel Connected Teamspeak Users\n"; print "graph_category voip\n"; @@ -132,7 +132,7 @@ if (exists $ARGV[0] and $ARGV[0] eq "autoconf") { print "users.label Users\n"; print "users.info Connected users to ".$name."\n"; print "users.type GAUGE\n"; - + exit 0; } elsif ($mode eq "o") { #overview mode @@ -140,7 +140,7 @@ if (exists $ARGV[0] and $ARGV[0] eq "autoconf") { print "graph_vlabel Connected Teamspeak Users\n"; print "graph_category voip\n"; print "graph_info This graph shows the number of connected users on a Teamspeak3 server\n"; - + foreach (@num) { $telnet->cmd("use sid=".$_); $telnet->waitfor("/error id=0 msg=ok/"); @@ -176,7 +176,7 @@ if (exists $ARGV[0] and $ARGV[0] eq "autoconf") { $telnet->cmd("use sid=".$server); $telnet->waitfor("/error id=0 msg=ok/"); $telnet->cmd("serverinfo"); - + my $line = $telnet->getline(Timeout=>1); if ($line =~ m/virtualserver_clientsonline=(\d+) /) { print "users.value ".($1-1)."\n"; @@ -191,7 +191,7 @@ if (exists $ARGV[0] and $ARGV[0] eq "autoconf") { $telnet->cmd("use sid=".$_); $telnet->waitfor("/error id=0 msg=ok/"); $telnet->cmd("serverinfo"); - + my $line = $telnet->getline(Timeout=>1); if ($line =~ m/virtualserver_clientsonline=(\d+) /) { print $_.".value ".($1-1)."\n"; @@ -211,10 +211,10 @@ if (exists $ARGV[0] and $ARGV[0] eq "autoconf") { die "ERROR: server string not recognized!\n"; } $telnet->waitfor("/error id=0 msg=ok/"); - + } } - + #close telnet connection $telnet->close; exit; diff --git a/plugins/teamspeak/tsuser b/plugins/teamspeak/tsuser index 30ea2e07..39507773 100755 --- a/plugins/teamspeak/tsuser +++ b/plugins/teamspeak/tsuser @@ -1,5 +1,5 @@ #!/usr/bin/perl -# +# # 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; version 2 dated June, @@ -68,7 +68,7 @@ elsif ( exists $ARGV[0] and $ARGV[0] eq "autoconf" ) } } } -else +else { foreach my $server (@uports) { @@ -76,7 +76,7 @@ else print $FS "si ".$server, "\n\n"; my $MASK = $string."=*"; - while(<$FS>) + while(<$FS>) { my $input_line = $_; if ( $input_line =~ m/($MASK)/ ) diff --git a/plugins/thin/thin_memory b/plugins/thin/thin_memory index 580ee91e..f4313166 100755 --- a/plugins/thin/thin_memory +++ b/plugins/thin/thin_memory @@ -4,8 +4,8 @@ # For Linux ONLY ! # DOES NOT WORK on OSX, Solaris or BSD. # only linux, because this script relies on proc filesystem -# -# Original author: +# +# Original author: # Frederico de Souza Araujo - fred.the.master@gmail.com # http://www.frederico-araujo.com # @@ -14,20 +14,20 @@ # http://www.furbism.com # # Originally based on: -# thin_process_memory - -# A munin plugin to monitor memory size of +# thin_process_memory - +# A munin plugin to monitor memory size of # each individual thin process # by Ben VandenBos and Avvo, Inc. # # This program is free software; you can redistribute it and/or modify -# it under the terms of the GNU General Public License version 2 +# it under the terms of the GNU General Public License version 2 # as published by the Free Software Foundation. -# +# # 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 Street, Fifth Floor, Boston, MA 02110-1301 USA. @@ -38,7 +38,7 @@ module Munin class ThinProcessMemory - + # run main method def run instances = get_pids() @@ -48,7 +48,7 @@ module Munin puts "thin_#{port}.value #{rss}" end end - + # only get the memory for each pid def pid_rss(pid) res = `grep "VmRSS" /proc/#{pid}/status`.split[1] @@ -58,7 +58,7 @@ module Munin return res end end - + # fetch all pids that match thin def get_pids pids = `pgrep -f 'thin' -l | awk -F " " '{ if (substr( $4, 10, 4)>=1) print $1"|"substr( $4, 10, 4)}' | sort -t'|' -nk 2`.split(/\r?\n/) @@ -67,7 +67,7 @@ module Munin def autoconf get_pids().length > 0 end - + end end diff --git a/plugins/thin/thin_threads b/plugins/thin/thin_threads index d559bd08..f07c280f 100755 --- a/plugins/thin/thin_threads +++ b/plugins/thin/thin_threads @@ -1,12 +1,12 @@ #!/usr/bin/env ruby -# thin_threads - +# thin_threads - # A munin plugin for Linux to monitor how many threads per thin process -# +# # For Linux ONLY ! # DOES NOT WORK on OSX, Solaris or BSD. # only linux, because this script relies on proc filesystem -# -# Original author: +# +# Original author: # Frederico de Souza Araujo - fred.the.master@gmail.com # http://www.frederico-araujo.com # @@ -15,20 +15,20 @@ # http://www.furbism.com # # Originally based on: -# thin_process_memory - -# A munin plugin to monitor memory size of +# thin_process_memory - +# A munin plugin to monitor memory size of # each individual thin process # by Ben VandenBos and Avvo, Inc. # # This program is free software; you can redistribute it and/or modify -# it under the terms of the GNU General Public License version 2 +# it under the terms of the GNU General Public License version 2 # as published by the Free Software Foundation. -# +# # 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 Street, Fifth Floor, Boston, MA 02110-1301 USA. @@ -39,7 +39,7 @@ module Munin class ThinThreads - + def run instances = get_pids() instances.each do |instance| @@ -48,7 +48,7 @@ module Munin puts "thin_#{port}.value #{rss}" end end - + # only get threads count for each pid # Using Proc filesystem # ONLY LINUX! because relies on proc filesystem @@ -62,7 +62,7 @@ module Munin return res end end - + # fetch all pids that match thin def get_pids pids = `pgrep -f 'thin' -l | awk -F " " '{ if (substr( $4, 10, 4)>=1) print $1"|"substr( $4, 10, 4)}' | sort -t'|' -nk 2`.split(/\r?\n/) @@ -71,7 +71,7 @@ module Munin def autoconf get_pids().length > 0 end - + end end @@ -86,7 +86,7 @@ when "config" puts "graph_scale yes" puts "graph_info Tracks how many threads per thin processes" mpm.get_pids.each do |instance| - pid, port = instance.split("|") + pid, port = instance.split("|") puts "thin_#{port}.label thin_#{port}" puts "thin_#{port}.info Threads per Thin process" puts "thin_#{port}.type GAUGE" diff --git a/plugins/thin/thins_peak_memory b/plugins/thin/thins_peak_memory index 3797cc44..762013d1 100755 --- a/plugins/thin/thins_peak_memory +++ b/plugins/thin/thins_peak_memory @@ -1,31 +1,31 @@ #!/usr/bin/env ruby -# thin_peak_memory - +# thin_peak_memory - # A munin plugin for Linux to monitor the maximum memory size # that an each individual thin process has reached -# +# # For Linux ONLY ! # DOES NOT WORK on OSX, Solaris or BSD. # only linux, because this script relies on proc filesystem # -# Author: +# Author: # Frederico de Souza Araujo - fred.the.master@gmail.com # http://www.frederico-araujo.com # # Based on: -# thin_process_memory - -# A munin plugin to monitor memory size of +# thin_process_memory - +# A munin plugin to monitor memory size of # each individual thin process # by Ben VandenBos and Avvo, Inc. # # This program is free software; you can redistribute it and/or modify -# it under the terms of the GNU General Public License version 2 +# it under the terms of the GNU General Public License version 2 # as published by the Free Software Foundation. -# +# # 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 Street, Fifth Floor, Boston, MA 02110-1301 USA. @@ -36,7 +36,7 @@ module Munin class ThinPeakMemory - + def run instances = get_pids() instances.each do |instance| @@ -45,7 +45,7 @@ module Munin puts "thin_#{port}.value #{hwm}" end end - + # only get VmHWM count for each pid # (Virtual Memory High Water Mark) # Using Proc filesystem @@ -60,7 +60,7 @@ module Munin return res end end - + # fetch all pids that match thin def get_pids pids = `pgrep -f 'thin' -l | awk -F " " '{ if (substr( $4, 10, 4)>=1) print $1"|"substr( $4, 10, 4)}' | sort -t'|' -nk 2`.split(/\r?\n/) @@ -69,7 +69,7 @@ module Munin def autoconf get_pids().length > 0 end - + end end @@ -84,7 +84,7 @@ when "config" puts "graph_scale yes" puts "graph_info Tracks the peak memory of thin processes, aka High Water Mark." mpm.get_pids.each do |instance| - pid, port = instance.split("|") + pid, port = instance.split("|") puts "thin_#{port}.label thin_#{port}" puts "thin_#{port}.info Peak Memory" puts "thin_#{port}.type GAUGE" diff --git a/plugins/tinydns/tinydns_err b/plugins/tinydns/tinydns_err index 2f57b768..20b11a45 100755 --- a/plugins/tinydns/tinydns_err +++ b/plugins/tinydns/tinydns_err @@ -25,7 +25,7 @@ if [ "$1" = "config" ]; then cat - < {Start => \&xml_start_elem, End => \&xml_end_elem, Char => \&xml_characters} ); - + if ($varnishname) { $arg .= " -n $varnishname"; } @@ -1009,7 +1009,7 @@ sub print_dynamic } my $counter = $ASPECTS{$self}{'values'}{$name}{'counter'}; my $type = $ASPECTS{$self}{'values'}{$name}{'family'}; - + foreach my $key (keys %{$data{$type}}) { my $pname = normalize_name($type . "_" . $key . "_" . $counter); print $pname . $suffix . " "; @@ -1097,7 +1097,7 @@ sub get_config } next; } - + if (!print_if_exist(\%values,$value,'label')) { print "$value.label $data{$value}{'description'}\n"; } diff --git a/plugins/vdr/vdr_ b/plugins/vdr/vdr_ index f759a620..35febff1 100755 --- a/plugins/vdr/vdr_ +++ b/plugins/vdr/vdr_ @@ -139,7 +139,7 @@ sub ermittelnTimer(){ $anzahlSerienMinuten+=$dauer*length($anzahl); } else { #print "keine Series"; - $anzahlTimer++; + $anzahlTimer++; $anzahlMinuten+=$dauer; } diff --git a/plugins/vmware/esxcli_env_ b/plugins/vmware/esxcli_env_ index 6b6dd7e3..036d1ba5 100755 --- a/plugins/vmware/esxcli_env_ +++ b/plugins/vmware/esxcli_env_ @@ -9,7 +9,7 @@ Configuration variables (/etc/munin/plugin-conf.d/): host_name - Name of you ESXi host as defined in munin.conf timeout - Plugin specific timeout Plugin specific: - env.esxi_host - (REQUIRED) hostname/ip esxcli connect to + env.esxi_host - (REQUIRED) hostname/ip esxcli connect to env.esxi_user - (REQUIRED) ESXi username to connect env.esxi_password - (REQUIRED) password for user given above env.cache_file - path to cache file (we do not want two or more sequential reconnections to ESXi host) diff --git a/plugins/vmware/esxi b/plugins/vmware/esxi index 7aef50a3..00c5b982 100755 --- a/plugins/vmware/esxi +++ b/plugins/vmware/esxi @@ -30,7 +30,7 @@ function get_vmlist () { vmlist_linenumber="$(echo "$summary" | $GREP -n "^Vmid")" vmlist_linenumber="${vmlist_linenumber/:*/}" - + vmlist="$(echo "$summary" | $TAIL -n $(($total_linenumber - $vmlist_linenumber)) | tr -s " ")" } @@ -74,7 +74,7 @@ function VMoverallCpuUsage () { temp="${c/*overallCpuUsage = /}" vmcpu[$n]="${temp/,*/}" if [ "${vmcpu[$n]}" == "" ]; then - vmcpu[$n]="0" + vmcpu[$n]="0" fi (( n++ )) done <" ]; then - vmmem[$n]="0" + vmmem[$n]="0" fi (( n++ )) done <" ]; then - vmmem[$n]="0" + vmmem[$n]="0" fi (( n++ )) done < To the extent possible under law, the author(s) have dedicated all copyright and related and neighboring rights to this software to the public domain worldwide -under a CC0 waiver. This software is distributed without any warranty. +under a CC0 waiver. This software is distributed without any warranty. http://creativecommons.org/publicdomain/zero/1.0/ diff --git a/plugins/vmware/fusion_ b/plugins/vmware/fusion_ index 6ae2eec6..75500297 100755 --- a/plugins/vmware/fusion_ +++ b/plugins/vmware/fusion_ @@ -63,37 +63,37 @@ my @lines=split(/\n/,$output); if ( exists $ARGV[0] and $ARGV[0] eq "config" ) { my $lcount = 0; my $base_config = "graph_category virtualization\n"; - + if( $type eq "pcpu" ) { print $base_config; - print "graph_args --base 1000 -l 0 -u 100 -r\n"; - print "graph_scale no\n"; + print "graph_args --base 1000 -l 0 -u 100 -r\n"; + print "graph_scale no\n"; print "graph_title CPU usage in % per VM\n"; print "graph_vlabel % of CPU usage\n"; - print "graph_info The Graph shows the CPU usage in % per VM\n"; + print "graph_info The Graph shows the CPU usage in % per VM\n"; foreach my $line(@lines) { - if( $line =~ /(? 2 ){ $vm[$count]=$entry; $count++; } - } + } $vm[3] =~ s/\.vmx//; - my $cat = clean_vmname($vm[3]); + my $cat = clean_vmname($vm[3]); if( $cat =~ /(? 0 ){ print $cat,"_pcpu.draw STACK\n"; } else { print $cat,"_pcpu.draw AREA\n"; } - $lcount++; + $lcount++; print $cat,"_pcpu.label $vm[3]\n"; print $cat,"_pcpu.type GAUGE\n"; - } + } } } } @@ -104,64 +104,64 @@ if ( exists $ARGV[0] and $ARGV[0] eq "config" ) { print "graph_scale no\n"; print "graph_title Memory usage in % per VM\n"; print "graph_vlabel % of Memory usage\n"; - print "graph_info The Graph shows the Memory usage in % per VM\n"; + print "graph_info The Graph shows the Memory usage in % per VM\n"; foreach my $line(@lines) { - if( $line =~ /(? 2 ){ - $vm[$count]=$entry; - $count++; - } - } - $vm[3] =~ s/\.vmx//; - my $cat = clean_vmname($vm[3]); - if( $cat =~ /(? 0 ){ - print $cat,"_pmem.draw STACK\n"; - } else { - print $cat,"_pmem.draw AREA\n"; - } - $lcount++; - print $cat,"_pmem.label $vm[3]\n"; - print $cat,"_pmem.type GAUGE\n"; - } - } - } - } - - if( $type eq "mem" ) { - print $base_config; - print "graph_args --base 1024 -r --lower-limit 0\n"; - print "graph_title absolute Memory usage per VM\n"; - print "graph_vlabel Memory usage\n"; - print "graph_info The Graph shows the absolute Memory usage per VM\n"; - foreach my $line(@lines) { - if( $line =~ /(? 2 ){ $vm[$count]=$entry; $count++; } } - $vm[3] = clean_vmname($vm[3]); - if( $vm[3] =~ /(? 0 ){ + print $cat,"_pmem.draw STACK\n"; + } else { + print $cat,"_pmem.draw AREA\n"; + } + $lcount++; + print $cat,"_pmem.label $vm[3]\n"; + print $cat,"_pmem.type GAUGE\n"; + } + } + } + } + + if( $type eq "mem" ) { + print $base_config; + print "graph_args --base 1024 -r --lower-limit 0\n"; + print "graph_title absolute Memory usage per VM\n"; + print "graph_vlabel Memory usage\n"; + print "graph_info The Graph shows the absolute Memory usage per VM\n"; + foreach my $line(@lines) { + if( $line =~ /(? 2 ){ + $vm[$count]=$entry; + $count++; + } + } + $vm[3] = clean_vmname($vm[3]); + if( $vm[3] =~ /(? 0 ){ print "$vm[3]_mem.draw STACK\n"; } else { print "$vm[3]_mem.draw AREA\n"; } print "$vm[3]_mem.label $vm[3]\n"; - print "$vm[3]_mem.type GAUGE\n"; - $lcount++; - } + print "$vm[3]_mem.type GAUGE\n"; + $lcount++; + } } - } + } } } else { @@ -169,7 +169,7 @@ if ( exists $ARGV[0] and $ARGV[0] eq "config" ) { if( $line =~ /(? 2 ){ $vm[$count]=$entry; @@ -177,7 +177,7 @@ if ( exists $ARGV[0] and $ARGV[0] eq "config" ) { } } $vm[3] = clean_vmname($vm[3]); - if( $vm[3] =~ /(? $_ENV['IceScret'] if (count($argv)==1) { do_count(); - } + } -switch ($argv[1]) +switch ($argv[1]) { case 'autoconf': do_autoconf(); break; - + case 'config': do_config(); break; - + default: do_count(); break; @@ -103,7 +103,7 @@ exit(1); function IceConnect() { global $ICE, $host, $port, $IceProfile, $IceSecret; - try + try { Ice_loadProfile($IceProfile); $iceproxy = $ICE->stringToProxy("Meta:tcp -h $host -p $port"); @@ -146,15 +146,15 @@ function do_config_header() function do_config_data() { global $ICE, $IceSecret; - - try + + try { $metaServer = IceConnect(); $AdefaultConf = $metaServer->getDefaultConf(); - + $AvirtualServer = $metaServer->getAllServers(); - foreach ($AvirtualServer as $numserver=>$s) + foreach ($AvirtualServer as $numserver=>$s) { $serverid = $s->ice_context($IceSecret)->id(); $servename = $s->ice_context($IceSecret)->getConf( 'registername'); @@ -189,14 +189,14 @@ function do_count() $totalMaxUsers="0"; $totalConnectedUsers="0"; - try + try { $metaServer = IceConnect(); $AdefaultConf = $metaServer->getDefaultConf(); - + $AvirtualServer = $metaServer->getAllServers(); - foreach ($AvirtualServer as $numserver=>$s) + foreach ($AvirtualServer as $numserver=>$s) { $maxusers = $s->ice_context($IceSecret)->getConf( 'users' ); if (!$maxusers) $maxusers = $AdefaultConf['users']; @@ -215,7 +215,7 @@ function do_count() fwrite(STDOUT, "vserver_".$serverid."_maxusers.value ".$maxusers."\n"); fwrite(STDOUT, "vserver_".$serverid."_online.value ".$connectedUsers."\n"); } - + fwrite(STDOUT, "total_maxusers.value ".$totalMaxUsers."\n"); fwrite(STDOUT, "total_online.value ".$totalConnectedUsers."\n"); exit(0); @@ -227,4 +227,4 @@ function do_count() } } -?> \ No newline at end of file +?> diff --git a/plugins/voip/murmur_users b/plugins/voip/murmur_users index 9da3df2a..23c4dd69 100755 --- a/plugins/voip/murmur_users +++ b/plugins/voip/murmur_users @@ -7,7 +7,7 @@ error_reporting( E_ALL &!E_NOTICE); //to avoid of the crap generation ///////////////////////////////////////////////////////////////////////////////////////////////////// Murmur users online grahpher -ver 0.2alpha 2008.12.02, 20:32 +ver 0.2alpha 2008.12.02, 20:32 author _KaszpiR_ kaszpir at gmail dot com code is under GPL @@ -18,9 +18,9 @@ Requirements: Notice: - script allows the usage of the 'config' and 'autoconf' parameters during startup, make fure you edt config section before running it -- $limit - number of lines to tail from the lgo file, better keep it below 5000 for lower cpu load, +- $limit - number of lines to tail from the lgo file, better keep it below 5000 for lower cpu load, additionally on busy servers you can keep it really low, suggested 3x maximum number of users online -- tested on +- tested on PHP 5.2.6-3 with Suhosin-Patch 0.9.6.2 (cli) (built: Aug 21 2008 17:02:32) murmur 1.1.4 precompiled binaries from sourceforge net, all running under debian etch - this is not the best way to get users connected to the murmur server, maybe in the beginningn of the 2009 gonna make another script @@ -60,7 +60,7 @@ if(isset($argv[1]) && $argv[1] == "autoconf") { fwrite(STDOUT, "Yes\n"); } - else + else { fwrite(STDOUT, "No\n"); fwrite(STDERR, "check if '$logfile' exists and it is allowed to be read by munin user group\n"); @@ -82,7 +82,7 @@ if(isset($argv[1]) && $argv[1] == "config") fwrite(STDOUT, "murmur.label Users on server\n"); fwrite(STDOUT, "murmur.type GAUGE\n"); return 0; - + }else { echo "check if '$logfile' exists and it is allowed to be read by munin user group\n"; return 1; @@ -125,15 +125,15 @@ for($i=count($fp);$i>(count($fp)-$limit);--$i) strpos($msg," Connection closed")!==FALSE || strpos($msg," Tiemout")!==FALSE ){ - $seen[$nick]['online'] = 0; + $seen[$nick]['online'] = 0; $offline+=1; } else { - $seen[$nick]['online'] = 1; + $seen[$nick]['online'] = 1; $online+=1; - + } } } @@ -147,4 +147,4 @@ return 0; ///////////////////////////////////////////////////////////////////////////////////////////////////// ///////////////////////////////////////////////////////////////////////////////////////////////////// //end of file -?> \ No newline at end of file +?> diff --git a/plugins/voip/murmurice_host_port_id_description b/plugins/voip/murmurice_host_port_id_description index 2deeb8f1..8f350d46 100755 --- a/plugins/voip/murmurice_host_port_id_description +++ b/plugins/voip/murmurice_host_port_id_description @@ -7,7 +7,7 @@ error_reporting( E_ALL & ~E_NOTICE ); //to avoid of the crap generation ///////////////////////////////////////////////////////////////////////////////////////////////////// Murmur users online grapher PHP using ICE -ver 0.4 2011.06.10, 15:44 +ver 0.4 2011.06.10, 15:44 author _KaszpiR_ kaszpir at gmail dot com code is under GPL @@ -31,8 +31,8 @@ By default script tries to connect 127.0.0.1:6502 and query server id 1 2. ice profile configuration This is not needed with ice 3.4.1 - Scroll down in this file and change - $ice_profile = 'Murmur'; + Scroll down in this file and change + $ice_profile = 'Murmur'; to the profile that is installed on the server, this is required if you have multiple Ice profiles for various applicaitions. @@ -82,7 +82,7 @@ $ice_profile = 'Murmur'; -// Define STDIN in case if it is not already defined by PHP for some reason +// Define STDIN in case if it is not already defined by PHP for some reason if(!defined("STDIN")) { define("STDIN", fopen('php://stdin','r')); @@ -108,7 +108,7 @@ if(isset($argv[1]) && $argv[1] == "autoconf") if(FALSE) { } - else + else { fwrite(STDOUT, "No\n"); fwrite(STDERR, "symlink ".$argv[0]." to somethilg like ".$argv[0]."_127.0.0.1_6502_1_description_here \n"); @@ -123,7 +123,7 @@ if(isset($argv[1]) && $argv[1] == "config") { if(TRUE) { - // yea dirty hack + // yea dirty hack echo "graph_title Mumble Users".($desc?" on ".str_replace("_"," ",$desc):"")."\n"; echo "graph_vlabel Connected Users\n"; echo "graph_category VoIP\n"; @@ -134,7 +134,7 @@ if(isset($argv[1]) && $argv[1] == "config") echo "unregistered.label Unregistered\n"; echo "chanlinks.label Linked chans\n"; echo "error.label Server status error\n"; - + $arr=array("channels","players","registered","unregistered","chanlinks","error"); foreach($arr as $field){ echo "".$field.".draw LINE1\n"; @@ -143,7 +143,7 @@ if(isset($argv[1]) && $argv[1] == "config") return 0; - + }else { echo "RTFM\n"; return 1; @@ -174,7 +174,7 @@ try { $initData->properties = Ice_createProperties(); $initData->properties->setProperty("Ice.MessageSizeMax", "65536"); $ICE = Ice_initialize($initData); - } + } $base = $ICE->stringToProxy("Meta:tcp -h ".$ip." -p ".$port); @@ -222,4 +222,4 @@ echo "unregistered.value ".$online_noreg."\n"; echo "chanlinks.value ".$links."\n"; echo "error.value 0\n"; return 0; -?> \ No newline at end of file +?> diff --git a/plugins/voip/murmurice_host_port_id_description_avg b/plugins/voip/murmurice_host_port_id_description_avg index 600232c0..4d0ddfee 100755 --- a/plugins/voip/murmurice_host_port_id_description_avg +++ b/plugins/voip/murmurice_host_port_id_description_avg @@ -7,7 +7,7 @@ error_reporting( E_ALL & ~E_NOTICE ); //to avoid of the crap generation ///////////////////////////////////////////////////////////////////////////////////////////////////// Murmur users online grapher PHP using ICE, shows averages -ver 0.2 2011.06.10, 15:44 +ver 0.2 2011.06.10, 15:44 author _KaszpiR_ kaszpir at gmail dot com code is under GPL @@ -31,8 +31,8 @@ By default script tries to connect 127.0.0.1:6502 and query server id 1 2. ice profile configuration This is not needed with ice 3.4.1 - Scroll down in this file and change - $ice_profile = 'Murmur'; + Scroll down in this file and change + $ice_profile = 'Murmur'; to the profile that is installed on the server, this is required if you have multiple Ice profiles for various applicaitions. @@ -80,7 +80,7 @@ Todo: $ice_profile = 'Murmur'; -// Define STDIN in case if it is not already defined by PHP for some reason +// Define STDIN in case if it is not already defined by PHP for some reason if(!defined("STDIN")) { define("STDIN", fopen('php://stdin','r')); @@ -106,7 +106,7 @@ if(isset($argv[1]) && $argv[1] == "autoconf") if(FALSE) { } - else + else { fwrite(STDOUT, "No\n"); fwrite(STDERR, "symlink ".$argv[0]." to somethilg like ".$argv[0]."_127.0.0.1_6502_1_description_here \n"); @@ -121,7 +121,7 @@ if(isset($argv[1]) && $argv[1] == "config") { if(TRUE) { - // yea dirty hack + // yea dirty hack echo "graph_title Mumble Average Users per chan ".($desc?" on ".str_replace("_"," ",$desc):"")."\n"; echo "graph_vlabel Number\n"; echo "graph_category VoIP\n"; @@ -133,7 +133,7 @@ if(isset($argv[1]) && $argv[1] == "config") echo "selfdeaf.label Self Deafen\n"; echo "avgperchan.label Users per chan\n"; echo "error.label Server status error\n"; - + $arr=array("mute","deaf","suppress","selfmute","selfdeaf","avgperchan","error"); foreach($arr as $field){ echo "".$field.".draw LINE1\n"; @@ -142,7 +142,7 @@ if(isset($argv[1]) && $argv[1] == "config") return 0; - + }else { echo "RTFM\n"; return 1; @@ -177,7 +177,7 @@ try { $initData->properties = Ice_createProperties(); $initData->properties->setProperty("Ice.MessageSizeMax", "65536"); $ICE = Ice_initialize($initData); - } + } $base = $ICE->stringToProxy("Meta:tcp -h ".$ip." -p ".$port); @@ -238,4 +238,4 @@ echo "selfdeaf.value ".$selfdeaf."\n"; echo "avgperchan.value ".$avg."\n"; echo "error.value 0\n"; return 0; -?> \ No newline at end of file +?> diff --git a/plugins/vpn/openvpn_as_mtime b/plugins/vpn/openvpn_as_mtime index 7dbf90ac..eb8ce58a 100755 --- a/plugins/vpn/openvpn_as_mtime +++ b/plugins/vpn/openvpn_as_mtime @@ -36,7 +36,7 @@ GPLv2 if [ "$1" = "autoconf" ]; then - echo yes + echo yes exit 0 fi @@ -62,7 +62,7 @@ if [ "$1" = "config" ]; then echo "time.label Users" echo "time.type GAUGE" echo "time.min 0" - + exit 0 fi @@ -78,5 +78,5 @@ fi # Total is total time between number of users between 60 for give it in minutes echo "time.value $(($(($SUM / $TOTU)) / 60))" - + diff --git a/plugins/vpn/openvpn_as_traffic b/plugins/vpn/openvpn_as_traffic index d59e7fee..718ff7f1 100755 --- a/plugins/vpn/openvpn_as_traffic +++ b/plugins/vpn/openvpn_as_traffic @@ -40,7 +40,7 @@ SUM2=0 NOW=`date +%s` if [ "$1" = "autoconf" ]; then - echo yes + echo yes exit 0 fi diff --git a/plugins/vpn/openvpn_as_ttime b/plugins/vpn/openvpn_as_ttime index 06809a92..2f514cba 100755 --- a/plugins/vpn/openvpn_as_ttime +++ b/plugins/vpn/openvpn_as_ttime @@ -36,7 +36,7 @@ GPLv2 if [ "$1" = "autoconf" ]; then - echo yes + echo yes exit 0 fi @@ -73,7 +73,7 @@ if [ "$1" = "config" ]; then echo "$NAME.min 0" COUNT=$((COUNT + 1)) done - + exit 0 fi diff --git a/plugins/vpn/openvpn_as_users b/plugins/vpn/openvpn_as_users index 3d655cb6..1fe54eb5 100755 --- a/plugins/vpn/openvpn_as_users +++ b/plugins/vpn/openvpn_as_users @@ -33,7 +33,7 @@ GPLv2 if [ "$1" = "autoconf" ]; then - echo yes + echo yes exit 0 fi @@ -59,9 +59,9 @@ if [ "$1" = "config" ]; then echo "users.type GAUGE" echo "users.draw AREA" echo "users.min 0" - - echo "users.warning $((VAL2 * $WARN / 100))" - echo "users.critical $VAL2" + + echo "users.warning $((VAL2 * $WARN / 100))" + echo "users.critical $VAL2" echo "limit.label Limit" @@ -76,5 +76,5 @@ fi echo "users.value $VAL1" echo "limit.value $VAL2" - + diff --git a/plugins/vserver/vserver_jiffies b/plugins/vserver/vserver_jiffies index dfb8dd41..f57c41e4 100755 --- a/plugins/vserver/vserver_jiffies +++ b/plugins/vserver/vserver_jiffies @@ -56,7 +56,7 @@ if [[ "$1" = "config" ]]; then echo 'graph_vlabel jiffies used per ${graph_period}' echo 'graph_info Shows jiffies used on each vserver.' - for i in $XIDS[@]; do + for i in $XIDS[@]; do LABEL=$(sed -n '/NodeName/s/^NodeName:[[:space:]]*//p' /proc/virtual/$i/$NAMELOC) LABEL=${LABEL%$STRIPDOMAIN} NAME=${LABEL//./_} @@ -74,7 +74,7 @@ if [[ "$1" = "config" ]]; then exit 0 fi -for i in $XIDS[@]; do +for i in $XIDS[@]; do LABEL=$(sed -n '/NodeName/s/^NodeName:[[:space:]]*//p' /proc/virtual/$i/$NAMELOC) LABEL=${LABEL%$STRIPDOMAIN} NAME=${LABEL//./_} diff --git a/plugins/vserver/vserver_limit_hits b/plugins/vserver/vserver_limit_hits index d4a690cc..d896ac1e 100755 --- a/plugins/vserver/vserver_limit_hits +++ b/plugins/vserver/vserver_limit_hits @@ -23,14 +23,14 @@ # # NOTE: If no configuration variables are set, the defaults will be used -# Example /etc/munin/plugin-conf.d/munin-node +# Example /etc/munin/plugin-conf.d/munin-node # # The first group monitors the vservers named "vserver1 vserver2 # vserver3 vserver4" and looks to see if the resource limit has been # breached, if so it sends a message to nagios via send_nsca, and # sends an email to notify that this has happened. # -# The second monitors the vservers "vserver5 vserver6 vserver7" and +# The second monitors the vservers "vserver5 vserver6 vserver7" and # has no limit notifications turned on. # # The third monitors all vservers on the system, in one graph, and it has @@ -73,7 +73,7 @@ # version 0.5 - 2008 Apr 12 - Chris Wilson # - Changed to display limit hits instead of resource usage # - Adapt to latest vserver kernel (lack of some variables in /proc/virtual) -# Note that your vserver names may change if the contents of +# Note that your vserver names may change if the contents of # /etc/vservers/* do not match the nodenames. Also you must specify # the vservers variable with context IDs (XIDs) rather than names. @@ -91,7 +91,7 @@ if [ "$1" = "config" ]; then echo "graph_vlabel $resource limit hits" echo 'graph_category virtualization' echo "graph_info Shows number of hits on $resource limits by each vserver.'" - + for vserver_xid in $vservers ; do longname=`/usr/sbin/vuname --xid $vserver_xid NODENAME | cut -f2` name=`echo $longname | cut -d. -f1` diff --git a/plugins/vserver/vserver_limits b/plugins/vserver/vserver_limits index ea4317c5..f724eed0 100755 --- a/plugins/vserver/vserver_limits +++ b/plugins/vserver/vserver_limits @@ -23,7 +23,7 @@ # # NOTE: If no configuration variables are set, the defaults will be used -# Example /etc/munin/plugin-conf.d/munin-node +# Example /etc/munin/plugin-conf.d/munin-node # # [vserver_limits_RSS] # user root @@ -68,7 +68,7 @@ if [ "$1" = "config" ]; then echo "graph_vlabel $resource limits" echo 'graph_category virtualization' echo "graph_info Shows current $resource limits for each vserver.'" - + for vserver_xid in $vservers ; do longname=`/usr/sbin/vuname --xid $vserver_xid NODENAME | cut -f2` name=`echo $longname | cut -d. -f1` diff --git a/plugins/weather/buienradar_ b/plugins/weather/buienradar_ index 663b3cd0..2fda3f52 100755 --- a/plugins/weather/buienradar_ +++ b/plugins/weather/buienradar_ @@ -6,12 +6,12 @@ # BuienRadar: http://www.buienradar.nl # # -# 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 3 of +# 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 3 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 +# 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. @@ -41,9 +41,9 @@ # env.rain = 'yes' # # -# +# ### Installation Example -# Below is a example to monitor station Venlo (6391). Codes for the station can be seen at the end of +# Below is a example to monitor station Venlo (6391). Codes for the station can be seen at the end of # this source or can be show with the command './buienradar_ stations' # # wget -O /usr/lib/munin/plugins/buienradar_ http://exchange.munin-monitoring.org/plugins/buienradar_/version/1/download @@ -101,7 +101,7 @@ if($stationName eq "") { # Darn, no station name found. This means we don't provided a correct id. die "Error:\n" ."You have provided an invalid station code. (".$station.") Please use a correct one.\n\n" - .print_stations(); + .print_stations(); } diff --git a/plugins/weather/novra_s300 b/plugins/weather/novra_s300 index ca20cbc7..e82fa9be 100755 --- a/plugins/weather/novra_s300 +++ b/plugins/weather/novra_s300 @@ -16,7 +16,7 @@ # @email icedown@gmail.com # # Usage: -# Copy this to your plugin folder (default: /usr/share/munin/plugins) +# Copy this to your plugin folder (default: /usr/share/munin/plugins) # Edit is file, replacing CMCS, IP, and PW with your values # Make a symlink to your active plugins folder (default: /etc/munin/plugins) # Finally run munin-node-config and restart munin-node @@ -59,15 +59,15 @@ if (defined($ARGV[0]) and ($ARGV[0] eq 'autoconf')) { if($status =~ m/Login unsuccessful/) { print "No (Invalid receiver details)\n"; exit(0); - } + } print "yes\n"; exit(0); } - + print "no (Cannot locate CMCS)\n"; exit(0); - - + + } require XML::Simple; diff --git a/plugins/weather/temperatures b/plugins/weather/temperatures index 52711c8b..a19cbdf4 100755 --- a/plugins/weather/temperatures +++ b/plugins/weather/temperatures @@ -65,7 +65,7 @@ if (defined $ARGV[0] and $ARGV[0] eq "config") { } else { print "graph_vlabel temp in C\n"; } - + for my $station (@wcode) { my $url = "$datasource$station.TXT"; my $response = $ua->request(HTTP::Request->new('GET',$url)); diff --git a/plugins/weather/wfrog b/plugins/weather/wfrog index 4fb5bd79..3c9d1243 100755 --- a/plugins/weather/wfrog +++ b/plugins/weather/wfrog @@ -19,8 +19,8 @@ use Data::Dumper; # 1. Install wfrog, get it up running with your weather station # 2. Locate your wfrog.csv file (wfrog creates after 10 mins) # 3. cd /etc/munin/plugins/ -# 4. ln -s /usr/share/munin/plugins/wfrog wfrog_temp -# 4. ln -s /usr/share/munin/plugins/wfrog wfrog_pressure +# 4. ln -s /usr/share/munin/plugins/wfrog wfrog_temp +# 4. ln -s /usr/share/munin/plugins/wfrog wfrog_pressure # 5. etc.. # 6. reload munin-node ;-) @@ -35,7 +35,7 @@ my %CONFIG = ( my $interesting; if ($0 =~ m#wfrog_(\w+)#) { - $interesting = $1; + $interesting = $1; } else { diff --git a/plugins/websphere/webspherelogin b/plugins/websphere/webspherelogin index e1744c55..b4b57cfc 100755 --- a/plugins/websphere/webspherelogin +++ b/plugins/websphere/webspherelogin @@ -7,12 +7,12 @@ SITEANALYZERLOG="/opt/WebSphere/SiteAnalyzer/sa.log" if [ "$1" = "config" ]; then - echo 'graph_title WebSphere Portal online users' - echo 'graph_category appserver' -# echo 'graph_order total actual' - echo 'graph_order actual' + echo 'graph_title WebSphere Portal online users' + echo 'graph_category appserver' +# echo 'graph_order total actual' + echo 'graph_order actual' echo 'graph_vlabel Users' - echo 'graph_scale no' + echo 'graph_scale no' # echo 'total.label Total logged' # echo 'total.draw LINE2' # echo 'total.colour DDDDDD' diff --git a/plugins/wifi/wifi_signal b/plugins/wifi/wifi_signal index 88ed22d1..a1e24306 100755 --- a/plugins/wifi/wifi_signal +++ b/plugins/wifi/wifi_signal @@ -24,7 +24,7 @@ do_config () { echo "graph_vlabel dB" echo "graph_category wireless" echo "graph_info This graph shows the noise and singal levels of your WiFi devices" - + awk -F'[ :]*' '/:/ { print $2"_noise.label Noise "$2; print $2"_signal.label Signal "$2; diff --git a/plugins/wordpress/wordpress b/plugins/wordpress/wordpress index f2f08a27..3f2f5976 100755 --- a/plugins/wordpress/wordpress +++ b/plugins/wordpress/wordpress @@ -1,6 +1,6 @@ #!/bin/sh # wordpress-munin plugin -# +# # Author Andre Darafarin # Improvements by Chris Bair # Version 0.2 15 Feb 2011 @@ -38,7 +38,7 @@ Add file plugin-conf.d/wordpress and fill like this # Replace your_db_pass =item * env.DB_HOST host_of_your_db -# Replace with host of database server. Will be localhost for many users. +# Replace with host of database server. Will be localhost for many users. =back diff --git a/plugins/wordpress/wordpress-mu-or-network b/plugins/wordpress/wordpress-mu-or-network index a23074fe..dfc9f6a4 100755 --- a/plugins/wordpress/wordpress-mu-or-network +++ b/plugins/wordpress/wordpress-mu-or-network @@ -1,11 +1,11 @@ #!/bin/bash # wordpress-mu-munin plugin -# +# # Author Andre Darafarin # Improvements by Chris Bair # Modified for Wordpress MU (or Network) by raT rat@espiv.net @ 22-04-2011 # Version 0.2 15 Feb 2011 -# +# # # : <<=cut @@ -40,7 +40,7 @@ Add file plugin-conf.d/wordpress and fill like this # Replace your_db_pass =item * env.DB_HOST host_of_your_db -# Replace with host of database server. Will be localhost for many users. +# Replace with host of database server. Will be localhost for many users. =back diff --git a/plugins/wordpress/wordpress2 b/plugins/wordpress/wordpress2 index c075b21a..f219225d 100755 --- a/plugins/wordpress/wordpress2 +++ b/plugins/wordpress/wordpress2 @@ -8,7 +8,7 @@ error_reporting(E_ALL & ~E_NOTICE & ~E_WARNING); it's a simple plugin to monitor users, comments, pingbacks and your posts from your wordpress homepage. - Simply put your path of wp-config.php in your munin-node + Simply put your path of wp-config.php in your munin-node configuration and this plugin does the rest for you. Happy monitoring! :) @@ -19,7 +19,7 @@ error_reporting(E_ALL & ~E_NOTICE & ~E_WARNING); ---- CONFIGURATION ---- You just need to provide the path to your wp-config.php of your wordpress installation. - + The configuration for munin-node is by default at: /etc/munin/plugin-conf.d/munin-node diff --git a/plugins/wowza/wowza-media-server b/plugins/wowza/wowza-media-server index 2cbb73cf..fd04aa5e 100755 --- a/plugins/wowza/wowza-media-server +++ b/plugins/wowza/wowza-media-server @@ -141,7 +141,7 @@ try: print ("graph_vlabel minutes") print ("avg.label average listening duration") print ("mdn.label median listening duration") - + elif plugin_name == "wowza_vhost_listeners": print ("graph_title Wowza listeners count by vhosts") print ("graph_args --base 1000 -l 0") @@ -157,7 +157,7 @@ try: is_first = False else: print (vname,".draw STACK",sep='') - + elif plugin_name == "wowza_vhost_duration": print ("graph_title Wowza clients listening duration by vhosts") print ("graph_args --base 1000 -l 0") @@ -168,7 +168,7 @@ try: vname = vh["Name"].strip("/").replace(".","_").replace("-","_") print (vname,"_avg.label average listening duration for ",vh["Name"],sep='') print (vname,"_mdn.label median listening duration for ",vh["Name"],sep='') - + elif plugin_name == "wowza_vhost_uptime": print ("graph_title Wowza vhosts uptime") print ("graph_args --base 1000 -l 0") @@ -178,7 +178,7 @@ try: for vh in vhosts: vname = vh["Name"].strip("/").replace(".","_").replace("-","_") print (vname,".label vhost: ",vh["Name"],sep='') - + elif plugin_name == "wowza_app_listeners": print ("graph_title Wowza listeners count by apps") print ("graph_args --base 1000 -l 0") @@ -196,7 +196,7 @@ try: is_first = False else: print (vname,"_",aname,".draw STACK",sep='') - + elif plugin_name == "wowza_app_duration": print ("graph_title Wowza clients listening duration by apps") print ("graph_args --base 1000 -l 0") @@ -209,7 +209,7 @@ try: aname = app["Name"].strip("/").replace(".","_").replace("-","_") print (vname,"_",aname,"_avg.label average listening duration for ",vh["Name"],".",app["Name"],sep='') print (vname,"_",aname,"_mdn.label median listening duration for ",vh["Name"],".",app["Name"],sep='') - + elif plugin_name == "wowza_app_uptime": print ("graph_title Wowza apps uptime") print ("graph_args --base 1000 -l 0") @@ -221,7 +221,7 @@ try: for app in vh["Applications"]: aname = app["Name"].strip("/").replace(".","_").replace("-","_") print (vname,"_",aname,".label vhost.app: ",vh["Name"],".",app["Name"],sep='') - + else: # wowza_listeners print ("graph_title Wowza listeners count") print ("graph_args --base 1000 -l 0") diff --git a/plugins/wuala/wuala_stats b/plugins/wuala/wuala_stats index bab9827c..f151b737 100755 --- a/plugins/wuala/wuala_stats +++ b/plugins/wuala/wuala_stats @@ -1,5 +1,5 @@ #!/usr/bin/perl -w -# +# # Plugin to monior the Wua.la Linux client # for shared, social storage from http://wua.la. # @@ -10,14 +10,14 @@ # # Set env.wualadir , e.g. /home/fred/wuala # and user fred. Please note, that if you don't run this -# plugin as the correct user it won't work, since the +# plugin as the correct user it won't work, since the # wualacmd command will only work when running as the correct user. # # The Plugin tries to detect if wuala is running and will # report unknown (U) as values if it is not running. # # This is a dual-personality plugin. If the file- or -# softlink-name of this plugin ends in _storage it will report +# softlink-name of this plugin ends in _storage it will report # the storage values and if it ends in _uptime it will report the # uptime. # diff --git a/plugins/xastir/xastir b/plugins/xastir/xastir index 5894b181..bd575173 100755 --- a/plugins/xastir/xastir +++ b/plugins/xastir/xastir @@ -1,6 +1,6 @@ #!/bin/bash -## Copyright (C) 2012 Robert Kilian +## Copyright (C) 2012 Robert Kilian ## ## This file is part of the Xastir plugin for Munin. ## @@ -106,7 +106,7 @@ NETTX=`cat $LOGDIR/net.log | grep -v '^\#' | grep ^$STATION_CALL | wc -l` TNC=`cat $LOGDIR/tnc.log | grep -v '^\#' | grep -v ^$STATION_CALL | wc -l` TNCTX=`cat $LOGDIR/tnc.log | grep -v '^\#' | grep ^$STATION_CALL | wc -l` -# Display values +# Display values echo "igatetonet.value $IGATETONET" echo "message.value $MESSAGE" echo "messagetx.value $MESSAGETX" diff --git a/plugins/xen/xen-cpu b/plugins/xen/xen-cpu index 90fabeaa..4c558134 100755 --- a/plugins/xen/xen-cpu +++ b/plugins/xen/xen-cpu @@ -3,7 +3,7 @@ # Script to minitor the cpu usage of Xen domains # # Author: Adam Crews shroom com> -# +# # License: GPL # Based on the original xen script from Matthias Pfafferodt, syntron at web.de # @@ -55,7 +55,7 @@ if (defined($ARGV[0])) { 'graph_vlabel' => 'Percent (%)', 'graph_category' => 'virtualization', 'graph_info' => 'Display the % of CPU Usage for each domain', - ); + ); my @domains = `$XM list`; shift(@domains); # we dont need the header line @@ -75,7 +75,7 @@ if (defined($ARGV[0])) { if ( "$cnt" == "0") { $cnf{$dom.'.draw'} = 'AREA'; } $cnt++; } - + foreach my $key (sort(keys(%cnf))) { print "$key $cnf{$key}\n"; } @@ -87,7 +87,7 @@ if (defined($ARGV[0])) { my @chunks; undef(@chunks); -{ +{ # run the xentop command a few times because the first reading is not always accurate local $/ = undef; @chunks = split(/^xentop - .*$/m, `$XMTOP -b -i2 -d2`); @@ -97,10 +97,10 @@ my @chunks; undef(@chunks); my @stats = split (/\n/,pop(@chunks)); # remove the first 4 items that are junk that we don't need. -shift(@stats); -shift(@stats); -shift(@stats); -shift(@stats); +shift(@stats); +shift(@stats); +shift(@stats); +shift(@stats); my %vals; undef(%vals); diff --git a/plugins/xen/xen_cpu_v2 b/plugins/xen/xen_cpu_v2 index 63e41248..4483cf96 100755 --- a/plugins/xen/xen_cpu_v2 +++ b/plugins/xen/xen_cpu_v2 @@ -7,8 +7,8 @@ # Based loosely on Adam Crews' xen_cpu script # # This script tries to measure the CPU usage of the Xen guests -# accurately. -# The problem with the current monitoring script is that these +# accurately. +# The problem with the current monitoring script is that these # scripts use the CPU output of xentop or xm list, which might be # inaccurate due to the resources used up at the time of the query by # the xm or xentop command. @@ -50,7 +50,7 @@ if ( defined($ARGV[0]) ) { $arg = 'autoconf'; } - + if ( $arg eq 'autoconf') { if ( -e $XM && -e $XMTOP ) @@ -102,7 +102,7 @@ if ( defined($ARGV[0]) ) exit 0; } } - + my @xmlist = `$XM list`; shift (@xmlist); @@ -124,7 +124,7 @@ if ( -e $TEMPFILE ) $_ =~ /(\S+)\s+\S+\s+\S+\s+\d+\s+\S+\s+(\S+)/; $dom{$1}->{'oldtime'} = $2; } - + close FH; } @@ -137,14 +137,14 @@ foreach my $domain ( @xmlist ) $diff = $dom{$1}->{'newtime'} - $dom{$1}->{'oldtime'}; $diff = sprintf("%.2f", $diff); - + # Calc the diff between old and new cputime, or reset the counter if ( $diff < 0 ) { $diff = $dom{$1}->{'newtime'}; } $dom{$1}->{'diff'} = $diff; - + # Calc a sum CPU usage $cpusum = $cpusum + $diff; } @@ -168,7 +168,7 @@ while (($key, $value) = each %dom) my $tmp = 0; $tmp = ( $dom{$key}->{'diff'} / $cpusum ) * 100; $dom{$key}->{'pc_time'} = sprintf("%.2f", $tmp); - + # Calc a percentage based on the _total_ available CPU time $tmp = 0; if ($tcpuavail != 0) { @@ -177,7 +177,7 @@ while (($key, $value) = each %dom) } else { $dom{$key}->{'pc_tcpu'} = "U"; } - + if ( $debug ) { print "$key newtime: ".$dom{$key}->{'newtime'}.", oldtime: ".$dom{$key}->{'oldtime'}.", diff: ".$dom{$key}->{'diff'}.", pc_bytime ".$dom{$key}->{'pc_time'}.", pc_bytcpu ".$dom{$key}->{'pc_tcpu'}."\n"; @@ -190,4 +190,4 @@ open(FH, ">", $TEMPFILE) or die $!; print FH $curtime."\n"; print FH @xmlist; close FH; - + diff --git a/plugins/xen/xen_traffic_all b/plugins/xen/xen_traffic_all index 7c5fa3d2..b22a594f 100755 --- a/plugins/xen/xen_traffic_all +++ b/plugins/xen/xen_traffic_all @@ -33,7 +33,7 @@ if [ "$1" = "config" ]; then name=$( echo "$dom" | tr .- __ ) #echo $name"UP.label $name" #echo $name"DOWN.label $name" - + echo "${name}Down.label received" echo "${name}Down.type COUNTER" echo "${name}Down.graph no" diff --git a/plugins/xen/xen_vbd b/plugins/xen/xen_vbd index 1f74c24b..55e8c701 100755 --- a/plugins/xen/xen_vbd +++ b/plugins/xen/xen_vbd @@ -16,13 +16,13 @@ $XM = '/usr/sbin/xm'; $XMTOP = '/usr/sbin/xentop'; -# ah, parameters coming in +# ah, parameters coming in if ( defined($ARGV[0])) { if ($ARGV[0] eq 'config') { $arg = 'config'; } if ($ARGV[0] eq 'autoconf') { $arg = 'autoconf'; } - - if ( $arg eq 'autoconf' ) + + if ( $arg eq 'autoconf' ) { if ( -e $XM && -e $XMTOP ) { @@ -35,7 +35,7 @@ if ( defined($ARGV[0])) exit 0; } } - + if ( $arg eq 'config' ) { %cnf = ( @@ -45,38 +45,38 @@ if ( defined($ARGV[0])) 'graph_category' => 'virtualization', 'graph_info' => 'Display the I/O operations for each domain', ); - + @domains = `$XM list`; shift(@domains); # we don't need the header line - + foreach $domain ( @domains ) { ($dom, undef) = split(/\s/, $domain); $dom =~ s/[-.]/_/g; - + $cnf{ $dom.'RD' . '.label' } = 'read'; $cnf{ $dom.'RD' . '.type' } = 'COUNTER'; $cnf{ $dom.'RD' . '.graph' } = 'no'; $cnf{ $dom.'RD' . '.cdef' } = $dom.'RD,8,*'; - + $cnf{ $dom.'WR' . '.label' } = $dom; $cnf{ $dom.'WR' . '.type' } = 'COUNTER'; $cnf{ $dom.'WR' . '.negative' } = $dom.'RD'; $cnf{ $dom.'WR' . '.cdef' } = $dom.'WR,8,*'; - + if ( "$cnt" == "0" ) { $cnf { "$dom" . '.draw' } = 'AREA'; } $cnt++; } - + foreach $key ( sort(keys(%cnf)) ) { print "$key $cnf{$key}\n"; } exit 0; - + } } @@ -98,12 +98,12 @@ foreach $domain (@stats) { $domain =~ s/^\s+//; @tmp = split(/\s+/, $domain); - + $domname = $tmp[0]; $domname =~ s/[-.]/_/g; $vbdrd = $tmp[14]; $vbdwr = $tmp[15]; - + $vals{$domname."RD"}{'value'} = $vbdrd; $vals{$domname."WR"}{'value'} = $vbdwr; } @@ -112,4 +112,4 @@ foreach $key ( sort(keys(%vals)) ) { print "$key.value " . ($vals{$key}{'value'}) . "\n"; } - + diff --git a/plugins/yacy/yacy b/plugins/yacy/yacy index 19589f4e..8c6348c3 100755 --- a/plugins/yacy/yacy +++ b/plugins/yacy/yacy @@ -29,7 +29,7 @@ yacy - Munin plugin to monitor YaCy distributed search engine network. =head1 APPLICABLE SYSTEMS -YaCy +YaCy =head1 CONFIGURATION @@ -59,14 +59,14 @@ GPLv2 =cut BEGIN { - if(!eval "require XML::Smart;") { + if(!eval "require XML::Smart;") { die("XML::Smart not found"); } - if(!eval "require LWP;") { + if(!eval "require LWP;") { die("LWP not found"); } } - + use XML::Smart; use strict; @@ -99,7 +99,7 @@ EOF die("PUDDI PUDDI PUDDI PUDDI PUDDI") unless ($action); # Config -if ($ARGV[0] and $ARGV[0] eq "config") +if ($ARGV[0] and $ARGV[0] eq "config") { my $titles = { network_peers => 'YaCy Network Online Peers', diff --git a/plugins/yum/yum_activity b/plugins/yum/yum_activity index bad9a4dd..5b02ea9b 100755 --- a/plugins/yum/yum_activity +++ b/plugins/yum/yum_activity @@ -4,14 +4,14 @@ # # Parameters: # -# config -# autoconf +# config +# autoconf # if [ "$1" = "autoconf" ]; then if [ -r /var/log/yum.log ]; then - echo yes + echo yes exit 0 else echo "no (/var/log/yum.log not readable)" diff --git a/plugins/zfs/zfs-filesystem-graph b/plugins/zfs/zfs-filesystem-graph index a3bd62d6..1324f95d 100755 --- a/plugins/zfs/zfs-filesystem-graph +++ b/plugins/zfs/zfs-filesystem-graph @@ -2,12 +2,12 @@ # # Plugin to monitor a ZFS Filesystem # -# Wildcard-plugin to monitor a zfs filesystems. +# Wildcard-plugin to monitor a zfs filesystems. # # To monitor a filesystem, link zfs_fs__ to this file. E.g. # # ln -s /usr/share/munin/node/plugins-auto/zfs_fs_ /etc/munin/node.d/zfs_fs_tank_foo -# +# # ...will monitor tank/foo fs. # # You can monitor zpool as well by a link on zfs_fs_ @@ -16,7 +16,7 @@ # # config (required) # autoconf (optional - used by munin-config) -# +# # ** WARNING ** # For now this plugin does not allow "_" in the name of a zpool or filesystems # diff --git a/plugins/zfs/zfs-stats-for-freebsd-arc-efficiency b/plugins/zfs/zfs-stats-for-freebsd-arc-efficiency index 178c7000..0d9905c4 100755 --- a/plugins/zfs/zfs-stats-for-freebsd-arc-efficiency +++ b/plugins/zfs/zfs-stats-for-freebsd-arc-efficiency @@ -42,8 +42,8 @@ if [ "$1" = "config" ]; then echo 'graph_info This graph shows the ARC Efficiency' /usr/local/bin/zfs-stats -A | awk 'BEGIN { RS = "" ; FS = "\n" } /Efficiency/ {print}' | \ -awk '/^\t.*%/ {sub("\t","");sub(/:.*/,""); displayname = $0; gsub(/[ .]/,"_",$0); print $0".label "displayname"\n"$0".min 0"}' - +awk '/^\t.*%/ {sub("\t","");sub(/:.*/,""); displayname = $0; gsub(/[ .]/,"_",$0); print $0".label "displayname"\n"$0".min 0"}' + exit 0 fi diff --git a/plugins/zfs/zfs-stats-for-freebsd-arc-utilization b/plugins/zfs/zfs-stats-for-freebsd-arc-utilization index 266ddaf0..97baef57 100755 --- a/plugins/zfs/zfs-stats-for-freebsd-arc-utilization +++ b/plugins/zfs/zfs-stats-for-freebsd-arc-utilization @@ -42,8 +42,8 @@ if [ "$1" = "config" ]; then echo 'graph_info This graph shows the ARC Size utilization' /usr/local/bin/zfs-stats -A | awk 'BEGIN { RS = "" ; FS = "\n" } /^ARC Size/ {print}' | \ -awk '/^\t/ {sub("\t","");sub(/ \(.*\):.*/,""); displayname = $0; gsub(/[ .]/,"_",$0); print $0".label "displayname"\n"$0".min 0"}' - +awk '/^\t/ {sub("\t","");sub(/ \(.*\):.*/,""); displayname = $0; gsub(/[ .]/,"_",$0); print $0".label "displayname"\n"$0".min 0"}' + exit 0 fi diff --git a/plugins/zfs/zfs-stats-for-freebsd-cache-hits-by-cache-list b/plugins/zfs/zfs-stats-for-freebsd-cache-hits-by-cache-list index 3e9bbb51..5c5a406c 100755 --- a/plugins/zfs/zfs-stats-for-freebsd-cache-hits-by-cache-list +++ b/plugins/zfs/zfs-stats-for-freebsd-cache-hits-by-cache-list @@ -42,7 +42,7 @@ if [ "$1" = "config" ]; then echo 'graph_info This graph shows the ARC cache hits by cache list' /usr/local/bin/zfs-stats -A | awk 'BEGIN { RS = "" ; FS = "\n" } /CACHE HITS BY CACHE LIST/ {print}' | \ -awk '/^\t.*%/ {sub(/[\t ]*/,"");sub(/ \(.*\):/,":");sub(/:.*/,""); displayname = $0; gsub(/[ .]/,"_",$0); print $0".label "displayname"\n"$0".min 0"}' +awk '/^\t.*%/ {sub(/[\t ]*/,"");sub(/ \(.*\):/,":");sub(/:.*/,""); displayname = $0; gsub(/[ .]/,"_",$0); print $0".label "displayname"\n"$0".min 0"}' exit 0 fi diff --git a/plugins/zfs/zfs-stats-for-freebsd-cache-hits-by-data-type b/plugins/zfs/zfs-stats-for-freebsd-cache-hits-by-data-type index 030f0f42..7070b69f 100755 --- a/plugins/zfs/zfs-stats-for-freebsd-cache-hits-by-data-type +++ b/plugins/zfs/zfs-stats-for-freebsd-cache-hits-by-data-type @@ -42,10 +42,10 @@ if [ "$1" = "config" ]; then echo 'graph_info This graph shows the ARC cache hits and misses by data type' /usr/local/bin/zfs-stats -A | awk 'BEGIN { RS = "" ; FS = "\n" } /HITS BY DATA TYPE/ {print}' | \ -awk '/^\t.*%/ {sub(/[\t ]*/,"");sub(/:.*/,""); displayname = $0" (hits)"; gsub(/[ .]/,"_",$0); print "hits_"$0".label "displayname"\nhits_"$0".min 0"}' +awk '/^\t.*%/ {sub(/[\t ]*/,"");sub(/:.*/,""); displayname = $0" (hits)"; gsub(/[ .]/,"_",$0); print "hits_"$0".label "displayname"\nhits_"$0".min 0"}' /usr/local/bin/zfs-stats -A | awk 'BEGIN { RS = "" ; FS = "\n" } /MISSES BY DATA TYPE/ {print}' | \ -awk '/^\t.*%/ {sub(/[\t ]*/,"");sub(/:.*/,""); displayname = $0" (misses)"; gsub(/[ .]/,"_",$0); print "misses_"$0".label "displayname"\nmisses_"$0".min -100"}' - +awk '/^\t.*%/ {sub(/[\t ]*/,"");sub(/:.*/,""); displayname = $0" (misses)"; gsub(/[ .]/,"_",$0); print "misses_"$0".label "displayname"\nmisses_"$0".min -100"}' + exit 0 fi diff --git a/plugins/zfs/zfs-stats-for-freebsd-dmu-prefetch b/plugins/zfs/zfs-stats-for-freebsd-dmu-prefetch index bbe8b652..db10af62 100755 --- a/plugins/zfs/zfs-stats-for-freebsd-dmu-prefetch +++ b/plugins/zfs/zfs-stats-for-freebsd-dmu-prefetch @@ -41,9 +41,9 @@ if [ "$1" = "config" ]; then echo 'graph_category fs' echo 'graph_info This graph shows the DMU prefech stats' -/usr/local/bin/zfs-stats -Z | awk '/Hit Ratio/ {sub(/[\t ]*/,"");sub(/:.*/,""); displayname = $0; gsub(/[ .]/,"_",$0); print $0".label "displayname"\n"$0".min 0"}' -/usr/local/bin/zfs-stats -Z | awk '/Miss Ratio/ {sub(/[\t ]*/,"");sub(/:.*/,""); displayname = $0; gsub(/[ .]/,"_",$0); print $0".label "displayname"\n"$0".min -100"}' - +/usr/local/bin/zfs-stats -Z | awk '/Hit Ratio/ {sub(/[\t ]*/,"");sub(/:.*/,""); displayname = $0; gsub(/[ .]/,"_",$0); print $0".label "displayname"\n"$0".min 0"}' +/usr/local/bin/zfs-stats -Z | awk '/Miss Ratio/ {sub(/[\t ]*/,"");sub(/:.*/,""); displayname = $0; gsub(/[ .]/,"_",$0); print $0".label "displayname"\n"$0".min -100"}' + exit 0 fi diff --git a/plugins/zfs/zfs_arcstats b/plugins/zfs/zfs_arcstats index 7b0d74eb..b2b79b3a 100755 --- a/plugins/zfs/zfs_arcstats +++ b/plugins/zfs/zfs_arcstats @@ -25,7 +25,7 @@ For FreeBSD, it should be necessary to change shebang /bin/bash -> /usr/local/bin/bash =head1 ENVIRONMENT VARIABLES - + None =head1 AUTHOR @@ -66,7 +66,7 @@ get_osname() { SunOS) case $osver in illumos*) - osname=illumos + osname=illumos ;; esac ;; @@ -84,7 +84,7 @@ preconfig() { case $func in size) global_attr=" - graph_title ZFS ARC - Size + graph_title ZFS ARC - Size graph_category fs graph_args --base 1024 --lower-limit 0 graph_vlabel Bytes @@ -150,7 +150,7 @@ preconfig() { " data_attr=" mfu_ghost_hits DERIVE LINE dummy - mfu_hits DERIVE LINE MFU + mfu_hits DERIVE LINE MFU mru_ghost_hits DERIVE LINE dummy mru_hits DERIVE LINE MRU " @@ -219,12 +219,12 @@ preconfig() { echo "Unknown function: $func" exit 1 ;; - esac + esac } do_config() { local func=$1 - local label_max_length=45 + local label_max_length=45 local field type draw label preconfig "$func" @@ -254,7 +254,7 @@ do_config() { get_stats() { local arcstats stat value - + case $osname in SunOS|illumos) arcstats=$( kstat -p 'zfs:0:arcstats' | sed -e 's/:/ /g' | awk '{ print $4,$5 }' ) @@ -286,8 +286,8 @@ get_stats() { esac while read -r stat value - do - printf -v "arcstats_${stat}" "%s" "$value" + do + printf -v "arcstats_${stat}" "%s" "$value" # printf -v means indirect variable assignment (similar to eval) done <<< "$arcstats" } @@ -303,8 +303,8 @@ do_fetch() { do [ -z "$field" ] && continue - ref="arcstats_${field}" - value=${!ref:-0} + ref="arcstats_${field}" + value=${!ref:-0} # ${!varname} means indirect evaluation (similar to eval) echo "${field}.value ${value}" diff --git a/plugins/zfs/zfs_cache_efficiency b/plugins/zfs/zfs_cache_efficiency index e793ca6e..0ed85949 100755 --- a/plugins/zfs/zfs_cache_efficiency +++ b/plugins/zfs/zfs_cache_efficiency @@ -16,7 +16,7 @@ graph_title ZFS ARC efficiency graph_vlabel % graph_scale no graph_category fs -graph_args -l 0 +graph_args -l 0 graph_info FreeBSD ZFS ARC Utilisation - Counters graph_period minute graph_order hits misses l2_hits l2_misses mfu_hits mru_hits arc_access_total mfu_hits_perc mru_hits_perc arc_misses_perc l2_efficency_tot diff --git a/plugins/zfs/zlist b/plugins/zfs/zlist index 161a23bc..7c27f986 100755 --- a/plugins/zfs/zlist +++ b/plugins/zfs/zlist @@ -29,7 +29,7 @@ fi case $i in *) name=`echo $i | awk '{ gsub("[^a-zA-Z0-9_]", "_", $1); print $1 }'` ;; esac - echo -n "$name.value " + echo -n "$name.value " echo $i|awk '{ print $4}' | awk ' /T/ {print $1*1000000}; /G/ {print $1*1000}; /M/ {print "777"}; /K/ {print "1"}' | sed 's/^\$name.value //' done diff --git a/plugins/zfs/zpool_capacity b/plugins/zfs/zpool_capacity index e8c7a3ce..921b7c20 100755 --- a/plugins/zfs/zpool_capacity +++ b/plugins/zfs/zpool_capacity @@ -26,7 +26,7 @@ user root =head1 ENVIRONMENT VARIABLES - + critical : default 90 warning : default 80 @@ -132,7 +132,7 @@ preconfig() { do_config() { local func="$1" - local label_max_length=45 + local label_max_length=45 local field type draw label preconfig "$func" diff --git a/plugins/znc/README.md b/plugins/znc/README.md index 0f7204fc..497ef8eb 100644 --- a/plugins/znc/README.md +++ b/plugins/znc/README.md @@ -6,7 +6,7 @@ ZNC-Logs 2. Enable the log-plugin in znc (if you enable it for the complete instance, there will be some issues because this plugin only uses the network-name + channel-name, if there are some networks with the same name, it will count all lines together) -3. Add this to your `/etc/munin/plugin-conf.d/munin-node` +3. Add this to your `/etc/munin/plugin-conf.d/munin-node` ``` [znc_logs] user $your_znc_user diff --git a/plugins/zope/README-zodb b/plugins/zope/README-zodb index d1889cbf..ecd70dd0 100644 --- a/plugins/zope/README-zodb +++ b/plugins/zope/README-zodb @@ -17,7 +17,7 @@ wget --delete-after -q -O - localhost:8080//munin_db_activity.py wget --delete-after -q -O - localhost:8080//munin_cache_parameters.py Edit zope_db_activity and zope_cache_parameters scripts to reflect - and your instance(s) ports. + and your instance(s) ports. Then move them into your munin plugins lib, and create a symlink under etc according to the usual munin custom: @@ -33,4 +33,4 @@ Test them with: Restart your munin-node and the graphs should appear shortly. If you make any improvements (which should be easy), please update -the munin exhange entry, or mail me at gaute(at)pht(dot)no \ No newline at end of file +the munin exhange entry, or mail me at gaute(at)pht(dot)no diff --git a/plugins/zope/zeo_monitor_ b/plugins/zope/zeo_monitor_ index 60b59f48..8ad8cac1 100755 --- a/plugins/zope/zeo_monitor_ +++ b/plugins/zope/zeo_monitor_ @@ -11,7 +11,7 @@ # Reads has logarithmic scale # Adjust some scaling factors # Support for INET connections, the new default -# +# # Invoke using symlinks to zeo_monitor_ in the form zeo_monitor_{clients,reads,writes,errors}_ # # This plugin can be configured manually or by autoconf (provided that the ZEO @@ -26,7 +26,7 @@ # ln -s /usr/share/munin/plugins/zeo_monitor_ /etc/munin/plugins/zeo_monitor_reads_temp # ln -s /usr/share/munin/plugins/zeo_monitor_ /etc/munin/plugins/zeo_monitor_writes_1 # ln -s /usr/share/munin/plugins/zeo_monitor_ /etc/munin/plugins/zeo_monitor_writes_temp -# +# # # Configuration variables: # @@ -131,7 +131,7 @@ die qq(Symlink to this script by appending a mode and storage name such as "zeo_ ########## if ( $ARGV[0] and $ARGV[0] eq "config") { - + print <<"EOF"; graph_title ZEO $mode for storage $storage_name graph_args --base 1000 --lower-limit 0 @@ -258,7 +258,7 @@ sub parse_zeo_monitor { ) \n /sx; - + my %name_var=( 'Clients' => 'clients', 'Commits' => 'commits', @@ -268,7 +268,7 @@ sub parse_zeo_monitor { 'Conflicts' => 'conflicts', 'Conflicts resolved' => 'conflictsres', ); - + my %stats=(); foreach (split /\n/, $stats) { (my $name,my $value)=split ': ',$_,2; @@ -276,7 +276,7 @@ sub parse_zeo_monitor { next unless $var; $stats{$var}=$value; } - + return %stats; } diff --git a/plugins/zope/zope_cache_parameters b/plugins/zope/zope_cache_parameters index a7b30700..5581177b 100755 --- a/plugins/zope/zope_cache_parameters +++ b/plugins/zope/zope_cache_parameters @@ -37,7 +37,7 @@ else: print 'obs_in_db%(i)s.value' % id, obs_in_db print 'obs_cached%(i)s.value'% id, obs_cached print 'obs_target%(i)s.value'% id, obs_target - + diff --git a/plugins/zope/zope_conflict_errors b/plugins/zope/zope_conflict_errors index 59ad66a6..c2e03d35 100755 --- a/plugins/zope/zope_conflict_errors +++ b/plugins/zope/zope_conflict_errors @@ -32,8 +32,8 @@ import time if len(argv) > 1: if argv[1] == 'config': - print """graph_title Zope Conflict Errors - graph_vlabel Count + print """graph_title Zope Conflict Errors + graph_vlabel Count graph_category appserver graph_info The number of conflict errors in event logs over the past 24h""".replace("\n ","\n") for i in range(0,len(logs)): @@ -52,7 +52,7 @@ else: delta = datetime.now() - logdate if delta.days >= 1: continue - error_count += 1 + error_count += 1 id = dict(i=i) print 'error_count%(i)s.value' % id, error_count - + diff --git a/plugins/zope/zope_db_activity b/plugins/zope/zope_db_activity index ddcbbef6..7991ee5a 100755 --- a/plugins/zope/zope_db_activity +++ b/plugins/zope/zope_db_activity @@ -35,7 +35,7 @@ else: print 'load_count%(i)s.value' % id, total_load_count print 'store_count%(i)s.value'% id, total_store_count print 'connections%(i)s.value'% id, total_connections - +