1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84
|
#!@@BASH@@
#%# family=test
#%# capabilities=autoconf
. "$MUNIN_LIBDIR/plugins/plugin.sh" || exit 1
# Handle the case where the munin node does not understand multigraph.
is_multigraph "$@"
# Plugin itself starts here
do_ () {
# Do fetch stuff here (.value things!)
cat <<"EOF"
one.value 1
two.value 2
three.value 3
#
multigraph multigraph_tester.en
one.value 1
#
multigraph multigraph_tester.to
two.value 2
#
multigraph multigraph_tester.tre
three.value 3
#
multigraph multigraph_outofscope
i.value 42
EOF
exit 0
}
do_config () {
# Do config stuff here
# Note that "#" in output is optional and is only used to make output more human readable
cat <<"EOF"
graph_title Root graph of multigraph test
graph_info The root graph is used to click into sub-graph page. Eventually the root graph should be able to borrow data from the sub graphs in a fairly easy manner. But not right now.
one.label number 1
two.label number 2
two.warning 0:100
two.critical 0:1000
three.label number 3
#
multigraph multigraph_tester.en
graph_title The number 1 sub-graph
graph_info This and the other . (dot) separated nested graphs are presented in a page linked to from the root graph
one.label number 1
#
multigraph multigraph_tester.to
graph_title The number 2 sub-graph
two.label number 2
#
multigraph multigraph_tester.tre
graph_title The number 3 sub-graph
three.label number 3
three.warning 0:1
three.critical 0:5
#
multigraph multigraph_outofscope
graph_title The out of namespace graph
graph_info The "multigraph protocol keyword allows the plugin to place data anywhere in the host namespace. The intended use is to be able to produce multiple root graphs and sub-graph spaces, but as you see it needs not have a sub-graph space at all.
i.label number i
EOF
exit 0
}
do_autoconf () {
echo yes
exit 0
}
# Main is here
"do_$1" 2>/dev/null || {
echo "Do what now?" >&2
exit 1
}
|