Skip to content

Commit

Permalink
snmp__if_combined: use instance name in graph titles
Browse files Browse the repository at this point in the history
Signed-off-by: Olivier Mehani <shtrom@ssji.net>
  • Loading branch information
shtrom committed Mar 8, 2022
1 parent b14e234 commit ada3160
Showing 1 changed file with 5 additions and 3 deletions.
8 changes: 5 additions & 3 deletions plugins/snmp/snmp__if_combined
Expand Up @@ -242,8 +242,10 @@ use Munin::Plugin::SNMP;

my $scriptname='snmp_if_combined';
my @scriptname_components= split(/_/,$0);
my $instance = 'All interfaces';
if ($scriptname_components[-1] ne 'combined') {
$scriptname .= "_${scriptname_components[-1]}";
$instance = $scriptname_components[-1];
$scriptname .= "_${instance}";
}

my $response;
Expand Down Expand Up @@ -651,7 +653,7 @@ sub do_config_root {
print <<END;
multigraph $scriptname
graph_title All interfaces traffic
graph_title $instance traffic
graph_args --base 1000
graph_vlabel bits in (-) / out (+) per \${graph_period}
graph_category network
Expand Down Expand Up @@ -725,7 +727,7 @@ END

print <<END;
multigraph ${scriptname}_err
graph_title All interfaces errors
graph_title $instance errors
graph_args --base 1000
graph_vlabel errors in (-) / out (+) per \${graph_period}
graph_category network
Expand Down

0 comments on commit ada3160

Please sign in to comment.