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

Ruby plugins: apply style changes as suggested by "rubocop --fix-layout"

This commit is contained in:
Lars Kruse 2020-08-25 16:52:39 +02:00
parent 26c29daa2b
commit b0b39b018e
30 changed files with 1447 additions and 1384 deletions

View file

@ -1,25 +1,30 @@
#!/usr/bin/env ruby
#
# Plugin to monitor the number of connections blocked by moblock.
#
# Requirements:
#
# Moblock up and running with generated log files going to /var/log/moblock
#
# Parameters supported:
#
# config
# autoconf
#
# Configurable variables
#
# logfile - Override default moblock logfile
#
# Magic markers
#
=begin
Plugin to monitor the number of connections blocked by moblock.
Requirements:
Moblock up and running with generated log files going to /var/log/moblock
Parameters supported:
config
autoconf
Configurable variables
logfile - Override default moblock logfile
Magic markers
#%# family=auto
#%# capabilities=autoconf
=end
#
# Initialize vars
#
@ -54,7 +59,7 @@ end
#
# Grep moblock logs for stats
#
def fetch(debug=false)
def fetch(debug = false)
num_in = %x{cat #{$logfile} | grep --extended-regexp 'IN: ' | wc -l}
num_out = %x{cat #{$logfile} | grep --extended-regexp 'OUT: ' | wc -l}
num_total = num_in.to_i + num_out.to_i
@ -80,12 +85,12 @@ end
# Handle command line args
#
case ARGV.first
when 'config'
config
when 'debug'
fetch true
when 'autoconf'
autoconf
else
fetch
when 'config'
config
when 'debug'
fetch true
when 'autoconf'
autoconf
else
fetch
end