* 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
This commit is contained in:
@@ -3,12 +3,13 @@
|
||||
foreach my $ups ( sort {$a cmp $b} @upses )
|
||||
{
|
||||
my $nnut = ${$ups};
|
||||
my ($name )= $ups =~ /^nut-driver\@(.*)$/ ;
|
||||
my $model = $nnut{Model} || "usbhid-ups";
|
||||
my $device = $nnut{Device} || "auto"; #"/var/lib/ups/hiddev0";
|
||||
my $type = $nnut{Type};
|
||||
my $mfr = $nnut{mfr};
|
||||
my $mdl = $nnut{mdl};
|
||||
$OUT .= "[UPS]\n";
|
||||
$OUT .= "[$name]\n";
|
||||
$OUT .= "\tdriver = $model\n";
|
||||
if ($model eq 'genericups')
|
||||
{
|
||||
|
@@ -1,14 +1,14 @@
|
||||
{
|
||||
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;
|
||||
}
|
||||
}
|
||||
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;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
Reference in New Issue
Block a user