pub trait MuninPlugin {
    fn config<W: Write>(&self, handle: &mut BufWriter<W>) -> Result<()>;
    fn run(&self);
    fn daemonize(&self);
    fn acquire(&self);
    fn fetch(&self);

    fn check_autoconf(&self) -> bool { ... }
    fn autoconf(&self) { ... }
    fn start(&self, config: Config) -> Result<bool> { ... }
}
Expand description

Defines a Munin Plugin and the needed functions

Required Methods

Write out a munin config, read the Developing plugins guide from munin for everything you can print out here.

Note that munin expects this to appear on stdout, so the plugin gives you a handle to write to, which is setup as a BufWriter to stdout. The BufWriter size defaults to 8192 bytes, but if you need more, its size can be set using Config::cfgsize. An example where this may be useful is a munin multigraph plugin that outputs config for 20 or more different graphs.

Example
fn config<W: Write>(&self, handle: &mut BufWriter<W>) -> Result<()> {
    writeln!(handle, "graph_title Load average")?;
    writeln!(handle, "graph_args --base 1000 -l 0")?;
    writeln!(handle, "graph_vlabel load")?;
    writeln!(handle, "graph_scale no")?;
    writeln!(handle, "graph_category system")?;
    writeln!(handle, "load.label load")?;
    writeln!(handle, "load.warning 10")?;
    writeln!(handle, "load.critical 120")?;
    writeln!(handle, "graph_info The load average of the machine describes how many processes are in the run-queue (scheduled to run immediately.")?;
    writeln!(handle, "load.info Average load for the five minutes.")?;
    Ok(())
}

Run

Daemonize

Acquire

Fetch

Provided Methods

Check autoconf

Autoconf

Start

Implementors