From 5039842a4f2e1c97e58155bee22d77e2bfe96182 Mon Sep 17 00:00:00 2001 From: "Kim B. Heino" Date: Fri, 14 May 2021 19:02:50 +0300 Subject: [PATCH] nutups2_: "@" is invalid character in plugin name so use "." instead This is needed when you monitor local and remote UPSes from single host. You must be able to specify "ups@host" in plugin name so do it as "ups.host". --- plugins/power/nutups2_ | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/plugins/power/nutups2_ b/plugins/power/nutups2_ index 10753939..54f7bc54 100755 --- a/plugins/power/nutups2_ +++ b/plugins/power/nutups2_ @@ -45,7 +45,7 @@ Although the 'suggest' command will only offer UPSes for which the local host is the master, you can also monitor remote UPSes if you include the host name in the symlink, like: - nutups2_@_frequency + nutups2_._frequency etc. @@ -315,6 +315,7 @@ croak("Unknown command line arguments") if $ARGV[0] and $ARGV[0] ne 'config'; # The UPS name may contain underscores my $fn_re = join('|', keys %config); my ($ups, $func) = $0 =~ m/nutups2_(.*)_($fn_re)$/; +$ups =~ s/\./@/; # ups.host.name => ups@host.name if ($ARGV[0] and $ARGV[0] eq 'config') { $config{$func}->{'config'}($func, $ups);