snmp__if_combined: use instance name in graph titles

Signed-off-by: Olivier Mehani <shtrom@ssji.net>
This commit is contained in:
Olivier Mehani 2022-03-08 21:34:55 +11:00
parent b14e2347f4
commit ada3160e9c
1 changed files with 5 additions and 3 deletions

View File

@ -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;
@ -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
@ -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