mirror of
https://github.com/munin-monitoring/contrib.git
synced 2025-07-22 02:51:03 +00:00
Whitespace cleanup
* remove trailing whitespace * remove empty lines at the end of files
This commit is contained in:
parent
ef851f0c34
commit
17f784270a
604 changed files with 2927 additions and 2945 deletions
|
@ -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)
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue