Skip to content
This repository
Browse code

Merge pull request #68 from lkarsten/master

Minor changes to munin-node-from-hell
  • Loading branch information...
commit 7287e9d6f97c4a1ac1d98e7ca6e7f12ee8c18013 2 parents c398f85 + 164f6c8
Kenyon Ralph authored March 17, 2012
4  tools/munin-node-from-hell/basic.conf
@@ -5,10 +5,10 @@
5 5
 
6 6
 [instance:basic]
7 7
 pluginprofile = basic
8  
-port = 4000
  8
+port = 4001
9 9
 
10 10
 [pluginprofile:basic]
11  
-plugins = always_warning, always_critical, graph_area
  11
+plugins = graph_area
12 12
 
13 13
 [base]
14 14
 # when building an example config with --muninconf, what hostname to output.
14  tools/munin-node-from-hell/huge.conf
... ...
@@ -0,0 +1,14 @@
  1
+# 
  2
+# Quick estimate says 30 plugins is a good estimate for a common client.
  3
+#
  4
+
  5
+[instance:huge]
  6
+pluginprofile = huge
  7
+portrange = 4000-4100
  8
+
  9
+[pluginprofile:huge]
  10
+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 
  11
+
  12
+[base]
  13
+# when building an example config with --muninconf, what hostname to output.
  14
+hostname = localhost
13  tools/munin-node-from-hell/muninnode-from-hell
@@ -264,7 +264,7 @@ def start_servers(instances):
264 264
 
265 265
 
266 266
 def usage():
267  
-    print "Usage: %s [--run] [--verbose] [--muninconf] <configfile>" % sys.argv[0]
  267
+    print "Usage: %s [--run] [--verbose] [--muninconf] <configfile> <configfileN>" % sys.argv[0]
268 268
 
269 269
 def main():
270 270
     if len(sys.argv) <= 2:
@@ -276,7 +276,12 @@ def main():
276 276
         verbose = True
277 277
 
278 278
     config = ConfigParser.RawConfigParser()
279  
-    config.read(sys.argv[-1])
  279
+    for configfile in sys.argv[1:]:
  280
+        if not configfile.endswith(".conf"):
  281
+            continue
  282
+        if verbose:
  283
+            print "Reading config file %s" % configfile
  284
+        config.read(configfile)
280 285
 
281 286
     instancekeys = [ key for key in config.sections() if key.startswith("instance:") ]
282 287
     servers = {}
@@ -330,14 +335,14 @@ def main():
330 335
                 instanceconfig[k] = v
331 336
 
332 337
             instanceconfig["plugins"] = plugins
333  
-            if "--verbose" in sys.argv:
334  
-                instanceconfig["verbose"] = True
  338
+            instanceconfig["verbose"] = verbose
335 339
 
336 340
             instanceconfig["name"] = "%s-%s" % (instancename, portinstance)
337 341
             instanceconfig["expanded_port"] = portinstance
338 342
 
339 343
             instances.append(instanceconfig)
340 344
             # XXX: need to store what handlers we should have.
  345
+    print instances
341 346
 
342 347
     # output sample munin config for the poller
343 348
     if "--muninconf" in sys.argv:
2  tools/munin-node-from-hell/notifications.conf
@@ -5,7 +5,7 @@
5 5
 
6 6
 [instance:notifications]
7 7
 pluginprofile = notif
8  
-port = 3000
  8
+port = 4010
9 9
 
10 10
 #
11 11
 #[instance:baz]
5  tools/munin-node-from-hell/tarpit.conf
@@ -3,14 +3,11 @@
3 3
 
4 4
 [instance:tarpit]
5 5
 pluginprofile = tarpit
6  
-port = 3000
  6
+port = 4005
7 7
 
8 8
 [pluginprofile:tarpit]
9 9
 plugins = load, locks, tarpit, load, locks
10 10
 
11  
-[pluginprofile:base]
12  
-plugins = load, locks, locks, load, load, locks, locks, load, load, load
13  
-
14 11
 [base]
15 12
 # when building an example config with --muninconf, what hostname to output.
16 13
 hostname = localhost

0 notes on commit 7287e9d

Please sign in to comment.
Something went wrong with that request. Please try again.