Permalink
Browse files

fixing bugs introduced by previous merge of pull request #9

  • Loading branch information...
1 parent 89b0110 commit 47e6b2fbe823a84e5152f12eec393f8508ad7275 @sebest committed Jan 8, 2014
Showing with 7 additions and 6 deletions.
  1. +2 −2 README.md
  2. +4 −4 mongodb.py
  3. +1 −0 types.db
View
@@ -18,7 +18,7 @@ The plugin has some configuration options even though none are mandatory. This i
* Password - the password for authentication
* Host - hostname or IP address of the mongodb server defaults to 127.0.0.1
* Port - the port of the mongodb server defaults to 27017
-* Database - the databases you want to monitor defaults to "admin". You can provide more than one database.
+* Databases - the databases you want to monitor defaults to "admin". You can provide more than one database.
The following is an example Collectd configuration for this plugin:
@@ -34,7 +34,7 @@ The following is an example Collectd configuration for this plugin:
<Module mongodb>
Host "127.0.0.1"
Password "password"
- Database "admin" "db-prod" "db-dev"
+ Databases "admin" "db-prod" "db-dev"
</Module>
</Plugin>
View
@@ -162,18 +162,18 @@ def config(self, obj):
self.mongo_user = node.values[0]
elif node.key == "Password":
self.mongo_password = node.values[0]
- elif node.key == "Databases":
+ elif node.key in ("Databases", "Database"):
self.mongo_dbs = node.values
- collectd.info("mongodb plugin: Databases " + self.mongo_dbs)
+ collectd.info("mongodb plugin: Databases " + ', '.join(self.mongo_dbs))
elif node.key == "ConnectionPoolStatus":
self.includeConnPoolMetrics = node.values
collectd.info("mongodb plugin: ConnectionPoolStatus " + self.ConnectionPoolStatus)
elif node.key == "ServerStats":
self.includeServerStatsMetrics = node.values
- collectd.info("mongodb plugin: ServerStats " + self.ServerStats)
+ collectd.info("mongodb plugin: ServerStats " + ', '.join(self.ServerStats))
elif node.key == "DBStats":
self.includeDbstatsMetrics = node.values
- collectd.info("mongodb plugin: DBStats " + self.DBStats)
+ collectd.info("mongodb plugin: DBStats " + ', '.join(self.DBStats))
else:
collectd.warning("mongodb plugin: Unkown configuration key %s" % node.key)
View
@@ -5,3 +5,4 @@ file_size bytes:GAUGE:0:U
memory value:GAUGE:0:281474976710656
percent percent:GAUGE:0:100.1
total_operations value:DERIVE:0:U
+total_connections value:DERIVE:0:U

0 comments on commit 47e6b2f

Please sign in to comment.