OPENTRACKER PLUGIN

A Plugin to monitor OpenTracker Servers and their Performance

MUNIN CONFIGURATION

[opentracker*] env.host 127.0.0.1 *default* env.port 6969 *default* env.uri /stats *default*

MUNIN ENVIRONMENT CONFIGURATION EXPLANATION

 host = opentracker host to connect to
 port = opentracker http port to connect to
 uri = stats uri for appending requests for data

 I need this information so I can later build the full url which normally
 looks like the following example when put together:
    http://127.0.0.1:6969/stats?mode=conn

AUTHOR

Matt West < https://github.com/mhwest13/OpenTracker-Munin-Plugin >

LICENSE

GPLv2

MAGIC MARKERS

#%# family=auto #%# capabilities=autoconf suggest

Graph Declarations

    This block of code builds up all of the graph info for all root / sub graphs.

    %graphs   is a container for all of the graph definition information. In here is where you'll
           find the configuration information for munin's graphing procedure.
    Format:

    $graph{graph_name} => {
        config => {
            { key => value }, You'll find the main graph config stored here.
            { ... },
        },
        keys => [ 'Name', 'Name', 'Name', ... ], Used for building results set.
        datasrc => [
            # Name: name given to data value
            # Attr: Attribute for given value, attribute must be valid plugin argument
            { name => 'Name', info => 'info about graph' },
            { ... },
        ],
        results => {
            { key => value }, You'll find the results info from fetch_stats call stored here.
            { ... },
        },
    }

Munin Checks

    These checks look for config / autoconf / suggest params

Config Check

    This block of code looks at the argument that is possibly supplied,
    should it be config, it then checks to make sure the plugin
    specified exists, assuming it does, it will run the do_config
    subroutine for the plugin specified, otherwise it dies complaining
    about an unknown plugin.

Autoconf Check

    This block of code looks at the argument that is possibly supplied,
    should it be autoconf, we are going to print yes at this point since
    we've already tested for our binary to exist and be executable, the
    process will then exit.

Suggest Check

    This block of code looks at the argument that is possibly supplied,
    should it be suggest, we are going to print the possible plugins
    which can be specified.

Subroutines

    Begin Subroutine calls to output data / config information

fetch_output

    This subroutine is the main call for printing data for the plugin.
    No parameters are taken as this is the default call if no arguments
    are supplied from the command line.

print_output

    This block of code prints out the return values for our graphs. It takes
    one parameter $plugin. Returns when completed

        $plugin;    graph we are calling up to print data values for

    Example: print_output($plugin);

print_config

    This subroutine prints out the main config information for all of the graphs.
    It takes one parameters, $plugin

        $plugin;    graph being called up to print config for

    Example:  print_config($plugin);

fetch_stats

    This subroutine actually fetches data from opentracker with the plugin specified
    It will then parse the data using the keys assigned in an array.
    Two parameters are passed, $plugin and @keys, and it will return when complete.

        $plugin;    graph we are calling up, we use this to store the results in the hash
                    for easy recall later.
        @keys;      keys we want the values for from opentracker stats url.

    Example: fetch_stats($plugin,@keys);