Jean-Philippe Pialasse 4e61b36891 * Tue Mar 18 2025 Jean-Philippe Pialasse <jpp@koozali.org> 11.0.0-9.sme
- update config for Nut 2.8.2 [SME: 12657]
  TODO review master/slave mode
  TODO convert master/slave to primary/secondary
  TODO convert to new config data + migrate
  TODO event and action
2025-05-17 00:44:43 -04:00

15 lines
477 B
Plaintext

{
if ( ($nut{Mode} || 'standalone') eq 'netclient' ) {
$OUT = "MONITOR $nut{ClientUPS} 1 $nut{ClientUser} $nut{ClientPass} secondary";
} else {
my @upses = grep(/^nut-driver\@[a-zA-Z0-9_-]+$/, $DB->keys);
my $size = scalar(@upses);
foreach my $ups ( sort {$a cmp $b} @upses )
{
my ($upsname) = $ups =~ /^nut-driver\@([a-zA-Z0-9_-]+)$/ ;
$OUT .= "MONITOR $upsname\@localhost 1 upsprimary $nut{PrimaryPass} primary";
$OUT .= "\n" if --$size >=1;
}
}
}