PyMunin - Python Multigraph Munin Plugins
Python Module for developing Munin Multigraph Monitoring Plugins.
Regular Munin Plugins employ one-plugin one-graph logic and require the execution of a script for data retrieval for each graph. Multigraph plugins permit retrieval of data for multiple graphs in one execution run (one-plugin many-graphs), reducing the processing time and delay for the fetch cycle significantly. More information on Multigraph Plugins can be found in the Munin Wiki:
The plugins consist of the following components:
- The pymunin module (./plugins/pymunin) implements the base classes for developing Munin plugins.
- The plugin logic is implemented in the plugin scripts in ./plugins.
- The actual data retrieval logic is separated from the plugins to facilitate code reuse. Individual modules in the directory ./pysysinfo implement classes for getting the monitoring data and returning them in dictionary objects. The separation of the data retrieval logic should facilitate the use of the same code in other monitoring solutions.
Although the solution is focused on implementing Multigraph Plugins the module also supports simple single graph plugins.
Multigraph Monitoring Plugins for the following applications are already included:
- Apache Tomcat
- Apache Web Server
- Asterisk Telephony Server
- Disk Usage
- Disk I/O
- FreeSWITCH Soft Switch
- MySQL Database
- Network Interface Traffic and Errors
- Network Connection Stats (netstat)
- Nginx Web Server
- NTP - Time Server
- PHP APC - PHP Cache
- PHP FPM (FastCGI Process Manager)
- PostgreSQL Database
- Processes and Threads
- System Resources (Load, CPU, Memory, Processes, Interrupts, Paging, Swapping, etc.)
- Sangoma Wanpipe Telephony Interfaces
Classes for retrieving stats are available, but no plugins have been developed yet for the following:
- Squid Web Proxy
The documentation for the project and sample graphs for plugins will be published in the PyMunin Project Web Page
I would be happy to receive suggestions on improving the code for developing Munin Plugins. Alternatively you can use the Issues functionality of GitHub to document problems and to propose improvements. You can use the internal messaging system of GitHub or my e-mail address in case you prefer to contact me directly.
I hope that by sharing the code, the existing plugins will get more testing and receive improvements, and many more Multigraph plugins will be developed collaboratively.
I would be glad to receive some sample graphs from anyone using the plugins.
PyMunin is copyrighted free software made available under the terms of the GPL License Version 3 or later.
See the COPYING file that acompanies the code for full licensing information.
Installation of the Libraries
- The pysysinfo directory should be placed in PYTHON search path or in the Munin Plugins directory (ex. /usr/share/munin/plugins).
- The plugins/pymunin directory should be placed in PYTHON search path or in the Munin Plugins directory (ex. /usr/share/munin/plugins).
Installation of the Plugins
- Copy the plugin scripts in the directory plugins to the Munin Plugins directory (ex. /usr/share/munin/plugins) and remove the file extension 'py'.
- Enable the plugins just like the standard plugins by creating a symbolic links in the Munin Plugins Configuration Directory (/etc/munin/plugins).
- Configuration files for plugins can be created in the Munin Plugins Configuration Directory (/etc/munin/plugin-conf.d). The environment variables used by the plugin scripts are documented in the header part of the script code.
On error plugins return short error messages by default. Plugin debugging must be enabled to return full trace for exceptions.
To enable plugin debugging in munin-run use the --pidebug option.