Line 283: |
Line 283: |
| 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. | | 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. |
| | | |
− | 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. |
| | | |
− | SME Server sets the NOTIFYCMD to '''/sbin/e-smith/nutUPS.notify''', and this executable file simply sends an email to the SME admin user with a notification of the event. | + | SME Server sets the '''NOTIFYCMD''' to '''/sbin/e-smith/nutUPS.notify''', and this executable file simply sends an email to the SME admin user with a notification of the event. |
| | | |
− | Apart from the various events that the UPS and '''upsmon''' may notify via the NOTIFYFLAGS, a '''Low Battery''' event will automatically and immediately cause '''upsmon''' to issue the '''SHUTDOWNCMD''' as defined in '''upsmon.conf''' (signal-event halt) and set a flag '''POWERDOWNFLAG''' so it knows on future restart that it is a UPS recovery. | + | Apart from the various events that the UPS and '''upsmon''' may notify via the '''NOTIFYFLAGS''' a ''Low Battery'' event will automatically and immediately cause '''upsmon''' to issue the '''SHUTDOWNCMD''' as defined in '''upsmon.conf''' (signal-event halt) and set a flag '''POWERDOWNFLAG''' so it knows on future restart that it is a UPS recovery. |
| | | |
| For information on configuration parameters: | | For information on configuration parameters: |
Line 304: |
Line 304: |
| From the above references you can glean which configuration setting does what function, etc. | | From the above references you can glean which configuration setting does what function, etc. |
| | | |
− | If you want to modify the operation of nut from the standard configuration, then you should generally modify the NUT config files by creating custom templates, expanding the templates and restarting service. This will ensure modifications survive a future reboot or reconfiguration. | + | If you want to modify the operation of NUT from the standard configuration, then you should generally modify the NUT config files by creating custom templates, expanding the templates and restarting service. This will ensure modifications survive a future reboot or reconfiguration. |
| | | |
| An example of doing this can be found in the forum [http://forums.contribs.org/index.php?topic=40668.0] and in the section above for UPS Administrative Privileges | | An example of doing this can be found in the forum [http://forums.contribs.org/index.php?topic=40668.0] and in the section above for UPS Administrative Privileges |