2

I'm unable to aggregate some custom graphs I wrote. I know aggregation is functional, because I'm able to aggregate default plugins, but am unsure what's wrong with mine.

munin.conf:

[myapp;web-servers;0-1]
        address 1.2.3.4
        use_node_name yes
[myapp;web-servers;0-2]
        address 5.6.7.8
        use_node_name yes

[myapp;web-servers;Aggregated]
        update no

#does not work:
    node_aggregate.graph_args --base 1000 -l 0
    node_aggregate.graph_title Aggregated connects
    node_aggregate.conns.label conns
    node_aggregate.conns.sum myapp;web-servers;0-1:nodejs_numberOfConnects.conns myapp;web-servers;0-2:nodejs_numberOfConnects.conns


#works:
    node_aggregate.graph_title Aggregated cpu
    node_aggregate.cpu.label cpu.user
    node_aggregate.cpu.sum myapp;web-servers;0-1:cpu.user myapp;web-servers;0-2:cpu.user

My plugins looks like this:

if [[ "$PARAM" == "numberOfConnects" ]]; then
        echo "graph_title Active Connects";
        echo "graph_info Active Connects";
        echo "graph_vlabel Connections";
        echo "$PARAM.label conns";
        echo "$PARAM.type GAUGE";
        echo "$PARAM.colour 0927EB"
        exit 0;
elif ...
fi
echo $PARAM.value 15

For testing purposes I can hardcode "$PARAM.value 15". I can then do
munin-run --servicedir /etc/munin/plugins nodejs_numberOfConnects which will return numberOfConnects.value 15

And the error I get is:

==> /var/log/munin/munin-graph.log <==
2016/03/15 13:57:01 [ERROR] filename is empty for $VAR1 = {
  '#%#name' => 'z1_0',
  'cdef' => 'z1_0,UN,0,z1_0,IF',
  'graph' => 'no',
  'label' => 'z1_0'
};
, myapp;web-servers;0-1:nodejs_numberOfConnects.conns

2016/03/15 13:57:01 [ERROR] filename is empty for $VAR1 = {
  '#%#name' => 'z1_1',
  'cdef' => 'z1_1,UN,0,z1_1,IF,z1_0,ADDNAN',
  'colour' => undef,
  'draw' => undef,
  'graph' => 'yes',
  'label' => 'conns'
};
, myapp;web-servers;0-2:nodejs_numberOfConnects.conns

2 Answers 2

0

You're trying to pass conns as the exported value, but that's actually numberOfConnects

node_aggregate.nodejs_numberOfConnects.label conns(or whatever)
node_aggregate.nodejs_numberOfConnects.sum \ 
    myapp;web-servers;0-1:nodejs_numberOfConnects.numberOfConnects \ 
    myapp;web-servers;0-2:nodejs_numberOfConnects.numberOfConnects
1
  • hey, I just wrote the same thing :O
    – w00t
    Mar 24, 2016 at 17:59
1

After much debugging I realized I was incorrectly using the name of the label instead of the name of the value.

node_aggregate.conns.sum myapp;web-servers;0-1:nodejs_numberOfConnects.conns myapp;web-servers;0-2:nodejs_numberOfConnects.conns

needs to be

node_aggregate.conns.sum myapp;web-servers;0-1:nodejs_numberOfConnects.numberOfConnects myapp;web-servers;0-2:nodejs_numberOfConnects.numberOfConnects

because of

if [[ "$PARAM" == "numberOfConnects" ]]; then
[...]
echo $PARAM.value 15

In other words, in my case the server line equals to:
$arbitraryname1.arbitraryname2.sum $clientname;$hostgroup;$hostname:$pluginname.$valuename

I was also very much thrown away by the cpu example which uses the following syntax:
myapp;web-servers;0-1:cpu.user but that's because its value name actually coincides to the label name!!

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .