1
0
Fork 0
mirror of https://github.com/munin-monitoring/contrib.git synced 2025-07-21 18:41:03 +00:00

Clean fieldnames, to allow filesystems and pools containing "-" to be graphed.

This commit is contained in:
Stig Sandbeck Mathisen 2013-05-15 15:02:27 +02:00
parent fe35abf5c0
commit cde121726f

View file

@ -172,11 +172,12 @@ sub do_config_fs {
($fs_slash =~ s/_/\//g);
if ( $fs ne $zpool ) {
print "multigraph zfs_usage_$zpool.$fs\n";
printf( "multigraph zfs_usage_%s.%s\n",
clean_fieldname($zpool), clean_fieldname($fs) );
print "graph_title ZFS usage for $filesystems->{$fs}->{type} $fs_slash\n";
print "graph_info This graph shows used bytes of $filesystems->{$fs}->{type} $fs_slash\n";
} else {
print "multigraph zfs_usage_$zpool\n";
printf( "multigraph zfs_usage_%s\n", clean_fieldname($zpool) );
print "graph_title ZFS usage for zpool $zpool\n";
print "graph_info This graph shows used bytes of zpool $zpool\n";
}
@ -212,9 +213,10 @@ sub do_fetch_fs {
my ($fs) = @_;
if ( $fs ne $zpool ) {
print "multigraph zfs_usage_$zpool.$fs\n";
printf( "multigraph zfs_usage_%s.%s\n",
clean_fieldname($zpool), clean_fieldname($fs) );
} else {
print "multigraph zfs_usage_$zpool\n";
printf( "multigraph zfs_usage_%s\n", clean_fieldname($zpool) );
}
foreach my $key ( keys %{$filesystems->{$fs}}) {