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

Whitespace cleanup

* remove trailing whitespace
* remove empty lines at the end of files
This commit is contained in:
Lars Kruse 2018-08-02 02:03:42 +02:00
parent ef851f0c34
commit 17f784270a
604 changed files with 2927 additions and 2945 deletions

View file

@ -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']

View file

@ -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]
*/

View file

@ -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'])

View file

@ -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)

View file

@ -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]
*