mirror of
https://github.com/munin-monitoring/contrib.git
synced 2025-07-22 14:16:00 +00:00
Allow for _ in original dataset name
The current code escapes / (which is legal as part of a dataset name for ZFS, but illegal as part of a munin graph name) into _ (which is legal for both). The result is that any _ characters in the original filename get changed into / in the legend, which is confusing. Fix by escaping any existing _ characters into __ first, and then later replacing // into _ again. // is a sequence that will not occur in a ZFS dataset name, so any double-/ sequence must therefore have been a _ originally.
This commit is contained in:
parent
a8d117a3f0
commit
608a2a5ad7
1 changed files with 2 additions and 0 deletions
|
@ -160,6 +160,7 @@ sub do_collect {
|
||||||
|
|
||||||
foreach my $line (split(/\n/, `$fsget` )) {
|
foreach my $line (split(/\n/, `$fsget` )) {
|
||||||
my ($name, $key, $value, undef ) = (split(/\t/,$line));
|
my ($name, $key, $value, undef ) = (split(/\t/,$line));
|
||||||
|
($name =~ s/_/__/g);
|
||||||
($name =~ s/\//_/g);
|
($name =~ s/\//_/g);
|
||||||
$filesystems->{$name}->{$key}=$value;
|
$filesystems->{$name}->{$key}=$value;
|
||||||
}
|
}
|
||||||
|
@ -170,6 +171,7 @@ sub do_config_fs {
|
||||||
my ($fs) = @_;
|
my ($fs) = @_;
|
||||||
my $fs_slash = ($fs);
|
my $fs_slash = ($fs);
|
||||||
($fs_slash =~ s/_/\//g);
|
($fs_slash =~ s/_/\//g);
|
||||||
|
($fs_slash =~ s/\/\//_/g);
|
||||||
|
|
||||||
if ( $fs ne $zpool ) {
|
if ( $fs ne $zpool ) {
|
||||||
printf( "multigraph zfs_usage_%s.%s\n",
|
printf( "multigraph zfs_usage_%s.%s\n",
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue