[collectd] [PATCH] mysql plugin: add support for multiple databases

Doug MacEachern Doug.MacEachern at hyperic.com
Mon Mar 16 23:29:23 CET 2009


Hi All,

Similar to the recent apache plugin thread, this patch adds config
support to monitor multiple databases from the same collectd instance.
Most of the logic was borrowed from the dbi plugin.  A couple of notes:

To support legacy mode, the plugin_instance is only set if there are > 1
database configured.. should probably have an option to always set the
plugin_instance?

mysql_config () supports a legacy mode for the original style config -
not sure this is the best way to do it?

Still uses hostname_g - might want an option to change this?

Config example:
<Plugin mysql>
  <Database "auth_db_01">
        Host "localhost"
        User "username"
        Password "pass"
        Port 22000
        Socket "/tmp/mysql_auth_db_01:22000.sock"
  </Database>
  <Database "resource_db_01">
        Host "localhost"
        User "username"
        Password "pass"
        Port 22100
        Socket "/tmp/mysql_resource_db_01:22100.sock"
  </Database>
</Plugin>

Let me know what you think and I can follow up with .conf/.pod/etc
updates.

-------------- next part --------------
A non-text attachment was scrubbed...
Name: 0001-mysql-plugin-add-support-for-multiple-databases.patch
Type: application/octet-stream
Size: 12767 bytes
Desc: 0001-mysql-plugin-add-support-for-multiple-databases.patch
Url : http://mailman.verplant.org/pipermail/collectd/attachments/20090316/a4ee35b7/attachment.obj 


More information about the collectd mailing list