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:
parent
26c29daa2b
commit
b0b39b018e
30 changed files with 1447 additions and 1384 deletions
|
@ -1,37 +1,42 @@
|
|||
#!/usr/bin/env ruby
|
||||
# mongrel_memory - A munin plugin for OpenSolaris to monitor memory size of
|
||||
# each individual mongrel process
|
||||
# Copyright (C) 2009 Matthias Marschall - mm@agileweboperations.com
|
||||
#
|
||||
# Based on:
|
||||
# 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
|
||||
# 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 (<adam@hjksolutions.com>)
|
||||
# Ryan Woodrum
|
||||
# Matthias Marschall (mm@agileweboperations.com)
|
||||
#
|
||||
|
||||
=begin
|
||||
|
||||
mongrel_memory - A munin plugin for OpenSolaris to monitor memory size of
|
||||
each individual mongrel process
|
||||
Copyright (C) 2009 Matthias Marschall - mm@agileweboperations.com
|
||||
|
||||
Based on:
|
||||
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
|
||||
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 (<adam@hjksolutions.com>)
|
||||
Ryan Woodrum
|
||||
Matthias Marschall (mm@agileweboperations.com)
|
||||
|
||||
#%# family=auto
|
||||
#%# capabilities=autoconf
|
||||
|
||||
=end
|
||||
|
||||
|
||||
module Munin
|
||||
class MongrelProcessMemory
|
||||
|
||||
def run
|
||||
pid_port_map = get_pids()
|
||||
port_list = Hash.new
|
||||
|
@ -48,8 +53,8 @@ module Munin
|
|||
pids += `pgrep ruby`.split("\n")
|
||||
pids.each { |pid|
|
||||
l = `pargs -l #{pid}`
|
||||
l =~ /-p (\d+)/
|
||||
h[pid] = $1 if $1
|
||||
l =~ /-p (\d+)/
|
||||
h[pid] = $1 if $1
|
||||
}
|
||||
h
|
||||
end
|
||||
|
@ -57,7 +62,6 @@ module Munin
|
|||
def autoconf
|
||||
get_pids().length > 0
|
||||
end
|
||||
|
||||
end
|
||||
end
|
||||
|
||||
|
|
|
@ -1,36 +1,40 @@
|
|||
#!/usr/bin/env ruby
|
||||
#
|
||||
# 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
|
||||
# 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 (<adam@hjksolutions.com>)
|
||||
# Ryan Woodrum
|
||||
#
|
||||
|
||||
=begin
|
||||
|
||||
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
|
||||
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 (<adam@hjksolutions.com>)
|
||||
Ryan Woodrum
|
||||
|
||||
#%# family=auto
|
||||
#%# capabilities=autoconf
|
||||
|
||||
=end
|
||||
|
||||
|
||||
module Munin
|
||||
class MongrelProcessMemory
|
||||
|
||||
def run
|
||||
h = get_pids()
|
||||
ps_output = ""
|
||||
#I have no doubt that this is a terrible way of doing this.
|
||||
# I have no doubt that this is a terrible way of doing this.
|
||||
h.each do |k, v|
|
||||
ps_output = ps_output + `ps --no-heading l #{k}`
|
||||
end
|
||||
|
@ -59,8 +63,8 @@ module Munin
|
|||
pids = `pgrep mongrel_rails`
|
||||
pids.each { |p|
|
||||
l = `ps #{p}`
|
||||
l =~ /-p (\d+)/
|
||||
h[p] = $1
|
||||
l =~ /-p (\d+)/
|
||||
h[p] = $1
|
||||
}
|
||||
h
|
||||
end
|
||||
|
@ -68,7 +72,6 @@ module Munin
|
|||
def autoconf
|
||||
pids.length > 0
|
||||
end
|
||||
|
||||
end
|
||||
end
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue