Utilities reference

A helper class for Munin plugins

class pycounters.utils.munin.Plugin(json_output_file=None, config=None, max_file_age_in_seconds=900)

a small utility to write munin plugins based on the output of the JSONFile reporter

example usage (munin_plugin.py) :

#!/usr/bin/python

from pycounters.utils.munin import Plugin

config = [
    {
        "id" : "graph_id",
        "global" : {
            # graph global options: http://munin-monitoring.org/wiki/protocol-config
            "title" : "Title",
            "info"  : "Some info",
            "category" : "PyCounters"
        },
        "data" : [
            {
                "counter" : "Somepycountername",
                "label"   : "A human redable form",
                "draw"    : "LINE2"
            }
            #...

        ]
    }
]

p = Plugin("pycounters_output_file.json", config) # initialize the plugin

p.process_cmd() # process munin command and output requested data or config
output_config(config)

executes the config command

output_data(config)

executes the data command

process_cmd()

process munin command and output requested data or config

Table Of Contents

Previous topic

Object and function reference

This Page