NAGIOS MULTIGRAPH

A Plugin to monitor Nagios Servers and their Performance (Multigraph)

MUNIN CONFIGURATION

[nagios_multi_*] user root env.binary /usr/local/nagios/bin/nagiostats *default* env.passive off *default*

MUNIN ENVIRONMENT CONFIGURATION EXPLANATION

 binary = location of your nagiostats binary including binary
 passive = tell the plugin to graph passive results

NODE CONFIGURATION

 Make sure the nagiostats binary exists and is executable by root
 or by the user specified that the plugin will run as.

 Available root graphs and subgraphs contained in this Plugin.

 services => I<MULTIGRAPH> This graphs the current service problems.
    svcchkdetail => This graph shows current services warning,critical,unknown,checked,scheduled,flapping,down
    svcchkext => This graph shows the service check execution times
    svcchklat => This graph shows the service check latency times
    svcchksc => This graph shows the service check state change %

 hosts => I<MULTIGRAPH> This graphs the current host problems.
    hostchkdetail => This graph shows current hosts down,unreachable,checked,scheduled,flapping,down
    hostchkext => This graph shows the host check execution times
    hostchklat => This graph shows the host check latency times
    hostchksc => This graph shows the host check state change %

 checks => I<MULTIGRAPH> This graphs the current host problems.
    extcmdcount => This graph shows external command buffer availability / usage
    hostchkactcount => This graph shows the active host checks for the last 1,5,15,60M
    hostchkpsvcount => This graph shows the passive host checks for the last 1,5,15,60M
        * depends on passive flag, which defaults to off, and forces these graphs to not be drawn
    svcchkactcount => This graph shows the active service checks for the last 1,5,15,60M
    svcchkpsvcount => This graph shows the passive service checks for the last 1,5,15,60M
        * depends on passive flag, which defaults to off, and forces these graphs to not be drawn

MUNIN PLUGIN DOCUMENTATION

    This is just some helpful links for plugin troubleshooting.

        http://munin-monitoring.org/wiki/Documentation#Plugins
        http://munin-monitoring.org/wiki/protocol-config

AUTHOR

Matt West < https://github.com/mhwest13/Nagios-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 => {
            You'll find the main graph config stored here
            { key => value },
            { ... },
        },
        keys => [ 'Name', 'Name', 'Name', ... ],
        datasrc => [
            Name: name given to data value
            Attr: Attribute and value, attribute must be valid plugin argument
            { name => 'Name', info => 'info about graph' },
            { ... },
        ],
        results => {
            You'll find the results info from a stats call stored here
            { key => value },
            { ... },
        },
    }

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. Note we only specify the root graphs for the
    multigraphs, since the rest of the subgraphs will appear "behind" the
    root graphs.

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_root_output

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

        $plugin;    main(root) graph we are calling up to print data values for

    Example: print_root_output($plugin);

print_sub_output

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

        $plugin;    main(root) being called, used for multigraph output
        $subgraph;  graph we are actually trying to print data values for

    Example: print_sub_output($plugin,$subgraph);

do_config

    This is the main call issued assuming we call up config and plugin specified exists
    The subroutine takes one parameter $plugin, and returns when completed.

        $plugin; main(root) graph being called

    Example: do_config($plugin);

print_sub_config

    This subroutine prints out the config information for all of the subgraphs.
    It takes two parameters, $plugin and $subgraph

        $plugin;    main(root) graph used for multigraph call
        $subgraph;  subgraph being called up.

    Example:  print_sub_config($plugin,$subgraph);

print_root_config

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

        $plugin;    main(root) graph used for multigraph call

    Example:  print_root_config($plugin);

fetch_nagios_stats

    This subroutine actually runs the nagiostats binary with the keys specified 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 nagiostats binary.

    Example: fetch_nagios_stats($plugin,@keys);