Changes

From SME Server
Jump to navigationJump to search
no edit summary
Line 3: Line 3:     
==Uninterruptable Power Supply==
 
==Uninterruptable Power Supply==
 +
 
{{Level|Advanced}}
 
{{Level|Advanced}}
   Line 37: Line 38:  
====Serial Connection====
 
====Serial Connection====
   −
<ol></li><li>Find the configuration details for your model of UPS. Refer to:  http://www.networkupstools.org/stable-hcl.html and make note of the driver name and upstype number (if any) in the third column.  
+
<ol><li>Find the configuration details for your model of UPS. Refer to:  http://www.networkupstools.org/stable-hcl.html and make note of the driver name and upstype number (if any) in the third column.  
    
{{Warning box|Always use the serial cable supplied with the UPS.  Standard serial cables won't work with a serial UPS and have been known to cause damage to the UPS. Pay particular attention to any references to cable in in the UPS Model column.}}
 
{{Warning box|Always use the serial cable supplied with the UPS.  Standard serial cables won't work with a serial UPS and have been known to cause damage to the UPS. Pay particular attention to any references to cable in in the UPS Model column.}}
    
</li><li>From the console issue the following commands:
 
</li><li>From the console issue the following commands:
   
  config setprop nut Model <model>  
 
  config setprop nut Model <model>  
 
  config setprop nut Device <device>
 
  config setprop nut Device <device>
Line 311: Line 311:  
Issuing commands could shutdown your server unexpectedly!}}
 
Issuing commands could shutdown your server unexpectedly!}}
   −
<headertabs/>
+
<headertabs />
    
=Scheduling Events=
 
=Scheduling Events=
Line 560: Line 560:  
By editing <tt>/etc/ups/hosts.conf</tt> and adding additional network UPS details, nut-cgi can be used to monitor more than one UPS. By the modification above, only the localhost is monitored.
 
By editing <tt>/etc/ups/hosts.conf</tt> and adding additional network UPS details, nut-cgi can be used to monitor more than one UPS. By the modification above, only the localhost is monitored.
   −
=Aditional Information=
+
=Additional Information=
   −
There are template fragments in /etc/e-smith/templates/etc/ups that control the config files located in /etc/ups. The default settings should be OK for most situations. The <tt>/etc/nut.conf</tt> file must be manually edited like <tt>mode=standalone</tt> as the templates do not touch this file.
+
There are template fragments in /etc/e-smith/templates/etc/ups that control the config files located in /etc/ups. The default settings should be OK for most situations. The <tt>/etc/nut.conf</tt> file must be manually edited like <tt>mode=standalone</tt> as the templates do not touch this file. In this case it would be:
 +
sed -e 's/^MODE.*/MODE=standalone/' -i /etc/ups/nut.conf
    
By default, NUT is configured for a USB connected UPS in Master mode, but is disabled. When enabled, NUT will monitor the UPS and take various actions when certain notifications are received. This is controlled by the '''/etc/ups/upsmon.conf''' file which among other things lists the notifications and the actions to be taken for each. For example an ''On Battery'' event is captured by the '''NOTIFYFLAG ONBATT''' entry and the following '''SYSLOG+WALL+EXEC''' command string. This string tells '''upsmon''' to write the event to the System Log, broadcast a message to all users via Wall, and execute the command denoted by the '''NOTIFYCMD''' entry.
 
By default, NUT is configured for a USB connected UPS in Master mode, but is disabled. When enabled, NUT will monitor the UPS and take various actions when certain notifications are received. This is controlled by the '''/etc/ups/upsmon.conf''' file which among other things lists the notifications and the actions to be taken for each. For example an ''On Battery'' event is captured by the '''NOTIFYFLAG ONBATT''' entry and the following '''SYSLOG+WALL+EXEC''' command string. This string tells '''upsmon''' to write the event to the System Log, broadcast a message to all users via Wall, and execute the command denoted by the '''NOTIFYCMD''' entry.
Line 580: Line 581:  
  man upsd
 
  man upsd
 
  man nutupsdrv
 
  man nutupsdrv
 +
 +
==Timeout Issues==
 +
 +
If you have comms problems like this you can add a custom timeout:
 +
 +
"USBDEVFS_CONTROL failed cmd blazer_usb rqt 33 rq 9 len 8 ret -110"
 +
 +
Add a new config item. The default is 2
 +
 +
config setprop nut pollInterval 4
 +
 +
Modify the template
 +
 +
mkdir -p /etc/e-smith/templates-custom/etc/ups/ups.conf
 +
cp /etc/e-smith/templates/etc/ups/ups.conf/UPS /etc/e-smith/templates-custom/etc/ups/ups.conf/UPS
 +
nano /etc/e-smith/templates-custom/etc/ups/ups.conf/UPS
 +
 +
Add the bits between the # comments
 +
 +
{
 +
    my $model = $nut{Model} || "usbhid-ups";
 +
    my $device = $nut{Device} || "/var/lib/ups/hiddev0";
 +
    my $type = $nut{Type};
 +
    my $mfr = $nut{mfr};
 +
    my $mdl = $nut{mdl};
 +
 +
    # Add this
 +
    my $poll = $nut{pollInterval} || '2';
 +
    if ($poll ne '2') {
 +
      $OUT .= "pollinterval = $poll\n";
 +
    }
 +
    # ends here
 +
 +
    $OUT .= "[UPS]\n";
 +
    $OUT .= "\tdriver = $model\n";
 +
 +
expand-template /etc/ups/ups.conf
 +
cat /etc/ups/ups.conf
 +
 +
You should see something like this:
 +
 +
# Copyright (C) 1999-2006 Mitel Networks Corporation
 +
#------------------------------------------------------------
 +
pollinterval = 4
 +
[UPS]
 +
 +
Restart nut
 +
 +
service nut restart
 +
 +
Now check to see the correct timeout:
 +
 +
upsc UPS | grep driver.parameter.pollinterval
 +
 +
driver.parameter.pollinterval: 4
 +
 +
To reset either delete the key, or set it to the default of 2
 +
 +
==Further reading==
    
The NUT website is here: [http://www.networkupstools.org/ NUT]
 
The NUT website is here: [http://www.networkupstools.org/ NUT]
Line 595: Line 655:     
Nut is a Software well documented, you can find the [http://www.networkupstools.org/docs/user-manual.chunked/index.html TOC here] and with [http://www.networkupstools.org/docs/user-manual.chunked/ar01s02.html an overview]
 
Nut is a Software well documented, you can find the [http://www.networkupstools.org/docs/user-manual.chunked/index.html TOC here] and with [http://www.networkupstools.org/docs/user-manual.chunked/ar01s02.html an overview]
<noinclude>[[Category:Howto]]</noinclude>
+
<noinclude>
<noinclude>[[Category:Administration]]</noinclude>
+
[[Category:Howto]]
 +
</noinclude>
 +
<noinclude>
 +
[[Category:Administration]]
 +
</noinclude>
 +
__FORCETOC__

Navigation menu