mirror of
https://github.com/munin-monitoring/contrib.git
synced 2018-11-08 00:59:34 +01:00
nn: use M::P::clean_fieldname()
This commit is contained in:
parent
2e5609e325
commit
19673b2711
@ -72,6 +72,8 @@ use Data::Dumper;
|
||||
use feature 'say';
|
||||
use File::Basename;
|
||||
|
||||
use Munin::Plugin;
|
||||
|
||||
#-- CONFIG --#
|
||||
|
||||
my %config = (
|
||||
@ -345,14 +347,6 @@ sub update_users {
|
||||
$sth->finish();
|
||||
}
|
||||
|
||||
sub clean_fieldname {
|
||||
my $name = shift;
|
||||
$name =~ s/^[^A-Za-z0-9_]+/_/;
|
||||
$name =~ s/^[0-9]+$/a$name/;
|
||||
$name = substr($name,-19);
|
||||
return $name;
|
||||
}
|
||||
|
||||
exit main() unless caller;
|
||||
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user