1
0
Fork 0
mirror of https://github.com/munin-monitoring/contrib.git synced 2025-07-26 02:48:28 +00:00

Merge pull request #68 from lkarsten/master

Minor changes to munin-node-from-hell
This commit is contained in:
Kenyon Ralph 2012-03-17 13:58:13 -07:00
commit 7287e9d6f9
5 changed files with 27 additions and 11 deletions

View file

@ -5,10 +5,10 @@
[instance:basic] [instance:basic]
pluginprofile = basic pluginprofile = basic
port = 4000 port = 4001
[pluginprofile:basic] [pluginprofile:basic]
plugins = always_warning, always_critical, graph_area plugins = graph_area
[base] [base]
# when building an example config with --muninconf, what hostname to output. # when building an example config with --muninconf, what hostname to output.

View file

@ -0,0 +1,14 @@
#
# Quick estimate says 30 plugins is a good estimate for a common client.
#
[instance:huge]
pluginprofile = huge
portrange = 4000-4100
[pluginprofile:huge]
plugins = load, locks, load, locks, load, locks, load, locks, load, locks, load, locks, load, locks, load, locks ,load, locks, load, locks, load, locks, load, locks ,load, locks, load, locks, load, locks, load, locks
[base]
# when building an example config with --muninconf, what hostname to output.
hostname = localhost

View file

@ -264,7 +264,7 @@ def start_servers(instances):
def usage(): def usage():
print "Usage: %s [--run] [--verbose] [--muninconf] <configfile>" % sys.argv[0] print "Usage: %s [--run] [--verbose] [--muninconf] <configfile> <configfileN>" % sys.argv[0]
def main(): def main():
if len(sys.argv) <= 2: if len(sys.argv) <= 2:
@ -276,7 +276,12 @@ def main():
verbose = True verbose = True
config = ConfigParser.RawConfigParser() config = ConfigParser.RawConfigParser()
config.read(sys.argv[-1]) for configfile in sys.argv[1:]:
if not configfile.endswith(".conf"):
continue
if verbose:
print "Reading config file %s" % configfile
config.read(configfile)
instancekeys = [ key for key in config.sections() if key.startswith("instance:") ] instancekeys = [ key for key in config.sections() if key.startswith("instance:") ]
servers = {} servers = {}
@ -330,14 +335,14 @@ def main():
instanceconfig[k] = v instanceconfig[k] = v
instanceconfig["plugins"] = plugins instanceconfig["plugins"] = plugins
if "--verbose" in sys.argv: instanceconfig["verbose"] = verbose
instanceconfig["verbose"] = True
instanceconfig["name"] = "%s-%s" % (instancename, portinstance) instanceconfig["name"] = "%s-%s" % (instancename, portinstance)
instanceconfig["expanded_port"] = portinstance instanceconfig["expanded_port"] = portinstance
instances.append(instanceconfig) instances.append(instanceconfig)
# XXX: need to store what handlers we should have. # XXX: need to store what handlers we should have.
print instances
# output sample munin config for the poller # output sample munin config for the poller
if "--muninconf" in sys.argv: if "--muninconf" in sys.argv:

View file

@ -5,7 +5,7 @@
[instance:notifications] [instance:notifications]
pluginprofile = notif pluginprofile = notif
port = 3000 port = 4010
# #
#[instance:baz] #[instance:baz]

View file

@ -3,14 +3,11 @@
[instance:tarpit] [instance:tarpit]
pluginprofile = tarpit pluginprofile = tarpit
port = 3000 port = 4005
[pluginprofile:tarpit] [pluginprofile:tarpit]
plugins = load, locks, tarpit, load, locks plugins = load, locks, tarpit, load, locks
[pluginprofile:base]
plugins = load, locks, locks, load, load, locks, locks, load, load, load
[base] [base]
# when building an example config with --muninconf, what hostname to output. # when building an example config with --muninconf, what hostname to output.
hostname = localhost hostname = localhost