Munin has large collection of plugins included in core plus its contrib plugins. These plugins are scripts are executed by munin-node and reports back different statistics that Munin master monitors. This article will help understand about Munin plugins, this is a continuation of Setup Munin on CentOS 7 with nginx.
Core plugins
The core plugins gallery can be found here and its git repository. When you installed Munin in CentOS 7, these plugins are located in /usr/share/munin/plugins/ and the basic plugins that are useful on your system are automatically installed. All the installed plugins should be located in /etc/munin/plugins/ and we can see that they are just symlink to the actual plugin script. Basically, installing Munin plugins are just creating a symlink of the plugin script at /etc/munin/plugins/. Noticed that not all the plugins in /usr/share/munin/plugins/ are automatically installed, some plugins requirements does not match or not compatible with your system profile and some plugins need manual installation. For example the meminfo plugin, it suggest that only enable this plugin unless you need it as alone produces significantly more data than any normal munin-node in sum. Before enabling a plugin, study the documentation (plugins documentation can be found here) first or the script itself (some plugins does not provide documentation). For instance we need meminfo, here are the steps: we only need to :
-
Check if the plugin will run on your system:
/usr/share/munin/plugins/meminfo autoconf
If this plugin has no issue running on your system it should output:
yes
-
Create a symlink:
ln -s /usr/share/munin/plugins/meminfo /etc/munin/plugins/meminfo
-
Restart munin-node:
systemctl restart munin-node
... and wait for five minutes Munin cron data update.
Wildcard Plugins
These are plugins that can monitor more than one resource generating separate graphs but using the same plugin. Wildcard Plugins' name should end with an underscore (_). Example, lets install the mysql_ plugin:
-
Verify that mysql_ has no issue running on your system:
/usr/share/munin/plugins/mysql_ autoconf
It will print "no" with error message if there's an issue:
no (DBI connect('mysql;mysql_connect_timeout=5','root',...) failed: Access denied for user 'root'@'localhost' (using password: NO))
Based on its documentation, we can supply the following connection parameters:
[mysql_*] env.mysqlconnection DBI:mysql:information_schema;host=127.0.0.1;port=3306 env.mysqluser admin env.mysqlpassword secret env.cachenamespace munin_mysql_pri
... in its configuration file:
vi /etc/munin/plugin-conf.d/mysql_
Executing:
/usr/share/munin/plugins/mysql_ autoconf
... should output yes.
-
The following command will show list of possible measurable mysql properties that we can use with our wildcard plugin:
/usr/share/munin/plugins/mysql_ suggest
... it will output:
bin_relay_log commands connections files_tables innodb_bpool innodb_bpool_act innodb_insert_buf innodb_io innodb_io_pend innodb_log innodb_rows innodb_semaphores innodb_tnx myisam_indexes network_traffic qcache qcache_mem replication select_types slow sorts table_locks tmp_tables
-
Let say we want to monitor the status of slow queries in Munin. We will use slow and we should execute:
ln -s /usr/share/munin/plugins/mysql_ /etc/munin/plugins/mysql_slow
-
Restart munin-node:
systemctl restart munin-node
... and wait for five minutes Munin cron data update.
Third party plugins
The third party plugins are our next option if we didn't find what we are looking for in the collection of core plugins. The gallery of these plugins can be found here and its git repository. Study first the plugin that you want to install to make sure it will not cause performance issue with your server. Basically you can save your downloaded contrib plugins anywhere. You may follow the steps above when installing the contrib plugins or we can use the quick auto-plug-and-play solution:
munin-node-configure --libdir /opt/munin/plugins --shell --families=contrib,auto | sh -x
Note: the /opt/munin/plugins is where all your downloaded contrib plugins saved. Please change it if you saved the plugin scripts elsewhere.
Comments
You have missed the --libdir…
You have missed the --libdir /opt/munin/plugins
parameter, as:
munin-node-configure --libdir /opt/munin/plugins --shell --families=contrib,auto | sh -x
munin-node configuration
The configuration script seems to bomb out on Centos 7. Any idea what might be missing? Thx
munin-node-configure --shell --families=contrib,auto | sh -x
# The following plugins caused errors:
# hddtemp_smartctl:
# Junk printed to stderr
# mysql_isam_space_:
# Junk printed to stderr
# netstat_multi:
# Wrong amount of autoconf
# ntp_states:
# Junk printed to stderr
# pgbouncer_connections:
# Junk printed to stderr
# pgbouncer_requests:
# Junk printed to stderr
# postgres_autovacuum:
# Non-zero exit during autoconf (255)
# postgres_bgwriter:
# Non-zero exit during autoconf (255)
# postgres_cache_:
# Non-zero exit during autoconf (255)
# postgres_checkpoints:
# Non-zero exit during autoconf (255)
# postgres_connections_:
# Non-zero exit during autoconf (255)
# postgres_connections_db:
# Non-zero exit during autoconf (255)
# postgres_locks_:
# Non-zero exit during autoconf (255)
# postgres_oldest_prepared_xact_:
# Non-zero exit during autoconf (255)
# postgres_prepared_xacts_:
# Non-zero exit during autoconf (255)
# postgres_querylength_:
# Non-zero exit during autoconf (255)
# postgres_scans_:
# Non-zero exit during autoconf (255)
# postgres_size_:
# Non-zero exit during autoconf (255)
# postgres_transactions_:
# Non-zero exit during autoconf (255)
# postgres_tuples_:
# Non-zero exit during autoconf (255)
# postgres_users:
# Non-zero exit during autoconf (255)
# postgres_xlog:
# Non-zero exit during autoconf (255)
# proc:
# In family 'auto' but doesn't have 'autoconf' capability
# samba:
# Junk printed to stderr
# slony_lag_:
# Junk printed to stderr