From fde1a77a12501f25a47a2d247a2391d0859fd86d Mon Sep 17 00:00:00 2001 From: Tomas Barton Date: Thu, 19 Sep 2013 10:07:18 +0200 Subject: config header for ubuntu --- files/config/host/munin.conf.header.Ubuntu | 75 ++++++++++++++++++++++++++++++ 1 file changed, 75 insertions(+) create mode 100644 files/config/host/munin.conf.header.Ubuntu diff --git a/files/config/host/munin.conf.header.Ubuntu b/files/config/host/munin.conf.header.Ubuntu new file mode 100644 index 0000000..771d50d --- /dev/null +++ b/files/config/host/munin.conf.header.Ubuntu @@ -0,0 +1,75 @@ +# Example configuration file for Munin, generated by 'make build' + +# The next three variables specifies where the location of the RRD +# databases, the HTML output, and the logs, severally. They all +# must be writable by the user running munin-cron. +dbdir /var/lib/munin +htmldir /var/cache/munin/www +logdir /var/log/munin +rundir /var/run/munin + +# Where to look for the HTML templates +tmpldir /etc/munin/templates + +# Make graphs show values per minute instead of per second +#graph_period minute + +# Drop somejuser@fnord.comm and anotheruser@blibb.comm an email everytime +# something changes (OK -> WARNING, CRITICAL -> OK, etc) +#contact.someuser.command mail -s "Munin notification" somejuser@fnord.comm +#contact.anotheruser.command mail -s "Munin notification" anotheruser@blibb.comm +# +# For those with Nagios, the following might come in handy. In addition, +# the services must be defined in the Nagios server as well. +#contact.nagios.command /usr/sbin/send_nsca -H nagios.host.com -c /etc/send_nsca.cfg + +#contacts me +#contact.me.command mail -s "Munin notification ${var:group} :: ${var:host} :: ${var:graph_title}" root +#contact.me.always_send warning critical + +# a simple host tree +#[localhost] +# address 127.0.0.1 +# use_node_name yes + +# +# A more complex example of a host tree +# +## First our "normal" host. +# [fii.foo.com] +# address foo +# +## Then our other host... +# [fay.foo.com] +# address fay +# +## Then we want totals... +# [foo.com;Totals] #Force it into the "foo.com"-domain... +# update no # Turn off data-fetching for this "host". +# +# # The graph "load1". We want to see the loads of both machines... +# # "fii=fii.foo.com:load.load" means "label=machine:graph.field" +# load1.graph_title Loads side by side +# load1.graph_order fii=fii.foo.com:load.load fay=fay.foo.com:load.load +# +# # The graph "load2". Now we want them stacked on top of each other. +# load2.graph_title Loads on top of each other +# load2.dummy_field.stack fii=fii.foo.com:load.load fay=fay.foo.com:load.load +# load2.dummy_field.draw AREA # We want area instead the default LINE2. +# load2.dummy_field.label dummy # This is needed. Silly, really. +# +# # The graph "load3". Now we want them summarised into one field +# load3.graph_title Loads summarised +# load3.combined_loads.sum fii.foo.com:load.load fay.foo.com:load.load +# load3.combined_loads.label Combined loads # Must be set, as this is +# # not a dummy field! +# +## ...and on a side note, I want them listen in another order (default is +## alphabetically) +# +# # Since [foo.com] would be interpreted as a host in the domain "com", we +# # specify that this is a domain by adding a semicolon. +# [foo.com;] +# node_order Totals fii.foo.com fay.foo.com +# + -- cgit v1.2.3 From 2f2627cd49c93f7455b2e6294e11e16be99a27ac Mon Sep 17 00:00:00 2001 From: Tomas Barton Date: Sat, 7 Sep 2013 10:20:18 +0200 Subject: readme reformatted into sections Conflicts: README.md --- README.md | 123 +++++++++++++++++++++++++++++++++++--------------------------- 1 file changed, 70 insertions(+), 53 deletions(-) diff --git a/README.md b/README.md index 9e4602e..b7f75fc 100644 --- a/README.md +++ b/README.md @@ -6,7 +6,7 @@ a very easy plugin interface. The munin homepage is http://munin.projects.linpro ## Requirements * puppet 2.7 or newer - * install the `concat` and `stdlib` modules -- the munin module depends on functions that are defined and installed via these modules + * install the `concat` and `stdlib` modules - the munin module depends on functions that are defined and installed via these modules * you will need storedconfigs enabled in your puppet setup, to do that you need to add a line to your `puppet.conf` in your `[puppetmasterd]` section which says: storeconfigs=true @@ -22,67 +22,84 @@ a very easy plugin interface. The munin homepage is http://munin.projects.linpro ## Usage - 1. Your modules directory will need all the files included in this repository placed - under a directory called "munin" +Your modules directory will need all the files included in this repository placed under a directory called `munin`. - 2. For every host you wish to gather munin statistics, add the class munin::client to that - node. You will want to set the class parameter `allow` to be the IP(s) of the munin - collector, this defines what IP is permitted to connect to the node, for example: +### Master configuration - node foo { - class { 'munin::client': allow => '192.168.0.1'} - } +In the node definition in your site.pp for your main munin host, add the following: - for multiple munin nodes, you can pass an array: + class { 'munin::host': } - class { 'munin::client': allow => [ '192.168.0.1', '10.0.0.1' ] } +If you want cgi graphing you can pass `cgi_graphing => true`. (For CentOS this is enabled in the default header config) for more information, see: http://munin.projects.linpro.no/wiki/CgiHowto + +### Client configuration + +For every host you wish to gather munin statistics, add the class `munin::client` to that +node. You will want to set the class parameter `allow` to be the IP(s) of the munin +collector, this defines what IP is permitted to connect to the node, for example: + + node foo { + class { 'munin::client': allow => '192.168.0.1'} + } + +for multiple munin nodes, you can pass an array: + + class { 'munin::client': allow => [ '192.168.0.1', '10.0.0.1' ] } 3. In the node definition in your site.pp for your main munin host, add the following: - class { 'munin::host': } - - If you want cgi graphing you can pass `cgi_graphing => true`. (For CentOS this is enabled in the default header config) for more information, see: http://munin.projects.linpro.no/wiki/CgiHowto +### Local plugins - 4. If there are particular munin plugins you want to enable or configure, you define them - in the node definition, like follows: +If there are particular munin plugins you want to enable or configure, you define them +in the node definition, like follows: - # Enable monitoring of disk stats in bytes - munin::plugin { 'df_abs': } + # Enable monitoring of disk stats in bytes + munin::plugin { 'df_abs': } - # Use a non-standard plugin path to use custom plugins - munin::plugin { 'spamassassin': - ensure => present, - script_path => '/usr/local/share/munin-plugins', - } + # Use a non-standard plugin path to use custom plugins + munin::plugin { 'spamassassin': + ensure => present, + script_path => '/usr/local/share/munin-plugins', + } - # For wildcard plugins (eg. ip_, snmp_, etc.), use the name variable to - # configure the plugin name, and the ensure parameter to indicate the base - # plugin name to which you want a symlink, for example: - munin::plugin { [ 'ip_192.168.0.1', 'ip_10.0.0.1' ]: - ensure => 'ip_' - } + # For wildcard plugins (eg. ip_, snmp_, etc.), use the name variable to + # configure the plugin name, and the ensure parameter to indicate the base + # plugin name to which you want a symlink, for example: + munin::plugin { [ 'ip_192.168.0.1', 'ip_10.0.0.1' ]: + ensure => 'ip_' + } - # Use a special config to pass parameters to the plugin - munin::plugin { - [ 'apache_accesses', 'apache_processes', 'apache_volume' ]: - ensure => present, - config => 'env.url http://127.0.0.1:80/server-status?auto' - } - - 5. If you have Linux-Vservers configured, you will likely have multiple munin-node processes - competing for the default port 4949, for those nodes, set an alternate port for munin-node - to run on by putting something similar to the following class parameter: - - class { 'munin::client': allow => '192.168.0.1', port => '4948' } - - 6. For deploying plugins which are not available at client, you can fetch them from puppet - master using `munin::plugin::deploy`. - - munin::plugin::deploy { 'redis': - source => 'munin/plugins/redis/redis_', - config => '' # pass parameters to plugin - } - - In this example the file on master would be located in `{modulepath}/munin/files/plugins/redis/redis_`. - Module path is specified in `puppet.conf`, you can find out your `{modulepath}` easily by tying - in console `puppet config print modulepath`. \ No newline at end of file + # Use a special config to pass parameters to the plugin + munin::plugin { + [ 'apache_accesses', 'apache_processes', 'apache_volume' ]: + ensure => present, + config => 'env.url http://127.0.0.1:80/server-status?auto' + } + +Note: The plugin must be installed at the client. For listing available plugins run as root `munin-node-configure --suggest` + +### External plugins + +For deploying plugins which are not available at client, you can fetch them from puppet +master using `munin::plugin::deploy`. + + munin::plugin::deploy { 'redis': + source => 'munin/plugins/redis/redis_', + config => '' # pass parameters to plugin + } + +In this example the file on master would be located in: + + {modulepath}/munin/files/plugins/redis/redis_ + +Module path is specified in `puppet.conf`, you can find out your `{modulepath}` easily by tying +in console `puppet config print modulepath`. + + +### Multiple munin instances + +If you have Linux-Vservers configured, you will likely have multiple munin-node processes +competing for the default port 4949, for those nodes, set an alternate port for munin-node +to run on by putting something similar to the following class parameter: + + class { 'munin::client': allow => '192.168.0.1', port => '4948' } -- cgit v1.2.3