Changes

From SME Server
Jump to navigationJump to search
Added uninstall and Usage of apcupsd sections. Also modified shutdown command
Line 4: Line 4:  
The latest version of ''apcupsd'' is 3.14.8-1 (January 2010) and is available from sourceforge in two rpms - one for the UPS daemon and one for the web based monitoring scripts. Neither of these install exactly in line with the ''SME way'', and neither does the older version available on DAG.
 
The latest version of ''apcupsd'' is 3.14.8-1 (January 2010) and is available from sourceforge in two rpms - one for the UPS daemon and one for the web based monitoring scripts. Neither of these install exactly in line with the ''SME way'', and neither does the older version available on DAG.
   −
These installation instructions make some additional modifications for SME
+
These installation instructions make some additional modifications for SME. They have been tested on SME 7.5 with an APC SmartUPS 1500i and 940-0024C smart serial cable.
 
{{Note box|SME uses Nut as standard for UPS monitoring and control and works with a more than just APC UPS models. See [[Uninterruptable_Power_Supply]] for details }}
 
{{Note box|SME uses Nut as standard for UPS monitoring and control and works with a more than just APC UPS models. See [[Uninterruptable_Power_Supply]] for details }}
 
===Download and install===
 
===Download and install===
Line 23: Line 23:  
  cp /etc/apcupsd/apcupsd.conf /etc/apcupsd/apcupsd.conf.orig
 
  cp /etc/apcupsd/apcupsd.conf /etc/apcupsd/apcupsd.conf.orig
   −
Edit ''/etc/apcupsd/apcupsd.conf'' file and make relevant changes for your UPS and requirements. The file is reasonably well documented and as a minimum you will probably want to set  
+
Edit the ''/etc/apcupsd/apcupsd.conf'' file and make relevant changes for your UPS and requirements. The file is reasonably well documented and as a minimum you will probably want to set  
 
  UPSNAME  
 
  UPSNAME  
 
  UPSCABLE
 
  UPSCABLE
Line 31: Line 31:  
  MINUTES
 
  MINUTES
 
  TIMEOUT
 
  TIMEOUT
 +
 +
Edit the ''/etc/apcupsd/apccontrol'' file and change the value for SHUTDOWN to
 +
SHUTDOWN=/sbin/e-smith/signal-event halt
    
Now make sure ''Nut'' isn't running and start the service
 
Now make sure ''Nut'' isn't running and start the service
Line 36: Line 39:  
  /etc/init.d/nut stop
 
  /etc/init.d/nut stop
 
  /etc/rc.d/rc7.d/S38apcupsd start
 
  /etc/rc.d/rc7.d/S38apcupsd start
 +
 +
===Usage of apcupsd===
 +
The file ''/etc/apcupsd/apcupsd.conf'' controls the configuration of the apcupsd daemon and is well documented. In addition to this ''/etc/apcupsd/apccontrol'' is called by the daemon whenever a UPS event occurs, and determines the standard action taken. User configurable actions can be taken by creating/editing files in /etc/apcupsd with names corresponding to relevant events, and these are called first by ''apccontrol''. For example, a file called ''onbattery'' will be called by ''apccontrol'' whenever an ON BATTERY event occurs, and if ''onbattery'' returns an exit code of 99, then ''apccontrol'' will not take its own default action.
 +
 +
To view the UPS status of settings and monitored values you can use
 +
/sbin/apcaccess
 +
 +
To configure the UPS EEPROM values you can use
 +
/etc/init.d/apcupsd stop
 +
/sbin/apctest
 +
 +
Follow the command line menu to make selections and set UPS configuration vales. The menu allows for querying all the UPS status, running a battery calibration, programming the EEPROM and communicating directly with the UPS in TTY mode.
 +
 +
Don't forget to restart the daemon when you are finished with apctest
 +
/etc/init.d/apcupsd start
 +
 +
See the [http://www.apcupsd.com/manual/manual.html documentation] for further details
    
===Configure Multimon etc Scripts===
 
===Configure Multimon etc Scripts===
Line 56: Line 76:  
     my $pass = '0';
 
     my $pass = '0';
 
     my $satisfy = 'all';
 
     my $satisfy = 'all';
     my $name = $apcupsd{'Name'} || 'apcupsd UPS Monitor';
+
     my $name = $apcupsd{'Name'} || 'APC UPS Daemon Monitoring';
 
   
 
   
 
     for ('exit-if-none')
 
     for ('exit-if-none')
Line 99: Line 119:  
   
 
   
 
       $OUT .= "#------------------------------------------------------------\n";
 
       $OUT .= "#------------------------------------------------------------\n";
       $OUT .= "# apcupsd - $name\n";
+
       $OUT .= "# apcupsd multimon - $name\n";
 
       $OUT .= "#------------------------------------------------------------\n";
 
       $OUT .= "#------------------------------------------------------------\n";
 
   
 
   
Line 141: Line 161:     
By editing /etc/apcupsd/hosts.conf and adding additional network UPS details, multimon.cgi can be used to monitor more than one UPS. By default only the localhost is monitored.
 
By editing /etc/apcupsd/hosts.conf and adding additional network UPS details, multimon.cgi can be used to monitor more than one UPS. By default only the localhost is monitored.
 +
 +
===Uninstall===
 +
Use the following commands to stop apcupsd and remove/uninstall it
 +
 +
/etc/init.d/apcupsd stop
 +
config delete apcupsd
 +
rm /etc/e-smith/templates-custom/etc/httpd/conf/httpd.conf/92apcupsdmon
 +
expand-template /etc/httpd/conf/httpd.conf
 +
sv t httpd-e-smith
 +
rm -fr /opt/apcupsd
 +
rm /etc/rc.d/rc7.d/S38apcupsd
 +
rm /etc/apcupsd/apcupsd.conf.orig
 +
yum remove apcupsd
    
===References===
 
===References===

Navigation menu