Munin::Plugin
The intention of this page is to have a place to develop a method for creating plugins with the same basic module API for plugins written in perl, python and ruby. It is important that writing simple plugins should be as simple as it is today. The framework should be felt more as supportive than restrictive.
Random thougths
When and how should we do data collection and processing? Pass a reference to a function as one of the %things in the Munin::Plugin::Config object?
Simple examples
Simple examples of use, for now without the messy business of gathering and processing data. The gathering of data from source and state file, and storing to the state file, could this be handled with private methods from within "config" and "values" method calls?
Perl
use 'Munin::Plugin' $pc = new Munin::Plugin::Config(%things); $p = Munin::Plugin::Config(pc); print p->autoconf(); print p->config(); print p->values();
Python
import munin.Plugin def main(): pc = Munin.Plugin.Config(things) p = Munin.Plugin(pc) print p.autoconf() print p.config() print p.values()
Ruby
require 'Munin/Plugin' pc = Munin::Plugin::Config.new(things) p = Munin::Plugin.new(pc) puts p.autoconf puts p.config puts p.values
Methods
Log tailer
A simple method to return unread lines from a log file. Inode and offset should be stored along with plugin state.
Store and read state
State should be read at start and stored at end of plugin execution.