2
0
mirror of https://github.com/munin-monitoring/contrib.git synced 2018-11-08 00:59:34 +01:00

zfs_usage_: explain the slash/underscore substitutions

see 608a2a5ad7
This commit is contained in:
Lars Kruse 2018-03-09 03:55:41 +01:00
parent 23d890cd59
commit c4c73eae4c

View File

@ -160,6 +160,9 @@ sub do_collect {
foreach my $line (split(/\n/, `$fsget` )) {
my ($name, $key, $value, undef ) = (split(/\t/,$line));
# try to preserve underscores:
# * duplicate existing ones
# * afterwards replace slashs with single ones
($name =~ s/_/__/g);
($name =~ s/\//_/g);
$filesystems->{$name}->{$key}=$value;
@ -170,6 +173,9 @@ sub do_collect {
sub do_config_fs {
my ($fs) = @_;
my $fs_slash = ($fs);
# try to restore underscores (see "do_collect" for the reverse operation):
# * substitute all underscores with slashs
# * afterwards transform *double* slashs back into a single underscore
($fs_slash =~ s/_/\//g);
($fs_slash =~ s/\/\//_/g);