2
0
mirror of https://github.com/munin-monitoring/contrib.git synced 2018-11-08 00:59:34 +01:00

Move gunicorn plugins to directory. Add example plugin configuration

to gunicorn plugins. Add magic markers to plugins.
This commit is contained in:
Andrew Jennings 2012-02-17 14:10:50 -05:00
parent 7cab2fe50f
commit 7e2bac0356
2 changed files with 45 additions and 21 deletions

View File

@ -1,14 +1,26 @@
#!/usr/bin/env python
#
# gunicorn_status - A munin plugin for Linux to monitor the memory
# usage of gunicorn processes
#
# Copyright (C) 2012 Azavea, Inc.
# Author: Andrew Jennings
#
# Like Munin, this plugin is licensed under the GNU GPL v2 license
# http://www.opensource.org/licenses/GPL-2.0
#
"""
gunicorn_status - A munin plugin for Linux to monitor the memory
usage of gunicorn processes
Copyright (C) 2012 Azavea, Inc.
Author: Andrew Jennings
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
default /var/run/gunicorn.pid, you can add a section like
this to your munin-node's plugin configuration:
[gunicorn_memory_status]
env.gunicorn_pid_path [path to your gunicorn pid]
This plugin supports the following munin configuration parameters:
#%# family=auto contrib
#%# capabilities=autoconf
"""
import sys, os
from subprocess import check_output
@ -20,7 +32,7 @@ except:
GUNICORN_PID_PATH = "/var/run/gunicorn.pid"
class GunicornStatus():
class GunicornMemoryStatus():
master_pid = ''
"""
The Gunicorn master process pid, as a string
@ -80,7 +92,7 @@ if __name__ == "__main__":
# Some docs say it'll be called with fetch, some say no arg at all
elif len(sys.argv) == 1 or (len(sys.argv) == 2 and sys.argv[1] == 'fetch'):
try:
status = GunicornStatus()
status = GunicornMemoryStatus()
status.print_total_memory()
except:
sys.exit("Couldn't retrieve gunicorn memory usage information")

View File

@ -1,13 +1,25 @@
#!/usr/bin/env python
#
# gunicorn_status - A munin plugin for Linux to monitor gunicorn processes
#
# Copyright (C) 2012 Azavea, Inc.
# Author: Andrew Jennings
#
# Like Munin, this plugin is licensed under the GNU GPL v2 license
# http://www.opensource.org/licenses/GPL-2.0
#
"""
gunicorn_status - A munin plugin for Linux to monitor gunicorn processes
Copyright (C) 2012 Azavea, Inc.
Author: Andrew Jennings
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
default /var/run/gunicorn.pid, you can add a section like
this to your munin-node's plugin configuration:
[gunicorn_status]
env.gunicorn_pid_path [path to your gunicorn pid]
This plugin supports the following munin configuration parameters:
#%# family=auto contrib
#%# capabilities=autoconf
"""
import sys, os
from subprocess import check_output