注册 登录  
 加关注
   显示下一条  |  关闭
温馨提示!由于新浪微博认证机制调整,您的新浪微博帐号绑定已过期,请重新绑定!立即重新绑定新浪微博》  |  关闭

晋显中国风

记录,不一定需要文字但一定要有心情

 
 
 

日志

 
 

Linux APC UPS with apcupsd  

2012-02-04 10:15:36|  分类: JOB IT |  标签: |举报 |字号 订阅

  下载LOFTER 我的照片书  |
原文地址:http://www.kernelhardware.org/linux-apc-ups-with-apcupsd/

Linux APC UPS with apcupsd

Scenario / Question:

How do I install apcupsd APC UPS software on my linux machine

Solution / Answer:

Obtain the apcupsd software from www.apcupsd.org and configure based on your type of APC UPS

Download apcupsd software:

The software can be found on sourceforge.com located here .

We will be using the RPM version.

Click on rpms – Stable and select the rpm package that matches your distro type. Download the rpm file to a directory of your choosing. For this tutorial I will be using directory /opt/apcupsd

Install needed packages / dependencies

The apcupsd needs a few other packages in order to install and run.

  • lm_sensors
  • net-snmp
  • net-snmp-libs

Install the above packages using yum:

# yum install lm_sensors net-snmp net-snmp-libs

Install apcupsd software:

Install the apcupsd software using rpm:

# rpm -ivh apcupsd-xxxx.rpm

Configure apcupsd.conf

The configuration file for apcupsd is located /etc/apcupsd/apcupsd.conf. The configuration file is complex and discussing each option is beyond the scope this tutorial. For a complete reference to the configuration file visit the online documentation located at www.apcupsd.org .

Give your UPS a name by uncommenting (removing # character) for the value UPSNAME:

UPSNAME APC1000_Cabinet1

Define the type of cable that connects our UPS to our server. There are 4 options but the two most common are smart and usb but if you have a simple signaling or dumb UPS such as a BackUPS, you will need to know exactly what cable you have and specify the cable model number:

  • smart — Serial Cable
  • ether — Connected via network and not directly attached to UPS
  • usb — USB Cable
  • 940-0119A — Cable Model number for dumb UPS with cable 940-0119A

The APC UPS we are using is a APC 1000 SmartUPS so we will use “smart”

UPSCABLE smart

In addition to defining the UPS cable type we must also define the type of UPS that we have.

  • apcsmart /dev/tty** — SmartUPS attached by Serial Cable ** is the port eg S0
  • usb <BLANK> — USB UPS and enable autodetection for usb
  • net hostname:port — Network link to a master apcupsd if UPS not directly connected

The APC UPS we are using is a APC 1000 SmartUPS using a Serial Cable on serial port 1. Defining Serial port numbers start at 0. The first serial port on your server will be defined as S0.

UPSTYPE apcsmart
DEVICE /dev/ttyS0

Start apcupsd:

Red Hat systems start apcupsd:

# /etc/rc.d/init.d/apcupsd start
or
# service apcupsd start

Red Hat systems apcupsd start automatically when your system boots:

# chkconfig apcupsd on

Test apcupsd:

Process status. If you see something similar to the following output then ok. If not then check /var/log/messages.

# ps fax |grep apcupsd.conf
30299 ? Ssl 0:00 /sbin/apcupsd -f /etc/apcupsd/apcupsd.conf

Logging enabled. Using tail /var/log/messages you should see output that looks similar to the following:

# tail /var/log/messages
Dec 10 03:02:07 server apcupsd[30299]: apcupsd 3.14.4 (18 May 2008) redhat startup succeeded

Apcaccess test. Check if apcupsd is properly updating its internal variables and communicating with UPS. You should get output similar to the following:

# apcaccess status
APC : 001,049,1193
DATE : Wed Dec 10 03:12:23 PST 2008
HOSTNAME : localhost
RELEASE : 3.14.4
VERSION : 3.14.4 (18 May 2008) redhat
UPSNAME : APC1000_Cabinet1
CABLE : Custom Cable Smart
MODEL : Smart-UPS SC 450 RM
UPSMODE : Stand Alone
STARTTIME: Wed Dec 10 03:01:54 PST 2008
STATUS : ONLINE
LINEV : 117.3 Volts
LOADPCT : 44.8 Percent Load Capacity
BCHARGE : 100.0 Percent
TIMELEFT : 27.0 Minutes
MBATTCHG : 5 Percent
MINTIMEL : 3 Minutes
MAXTIME : 0 Seconds
MAXLINEV : 118.0 Volts
MINLINEV : 115.9 Volts
OUTPUTV : 117.3 Volts
SENSE : High
DWAKE : 000 Seconds
DSHUTD : 060 Seconds
DLOWBATT : 02 Minutes
LOTRANS : 106.0 Volts
HITRANS : 127.0 Volts
RETPCT : 000.0 Percent
ALARMDEL : 5 seconds
BATTV : 13.7 Volts
LINEFREQ : 60.0 Hz
LASTXFER : Automatic or explicit self test
NUMXFERS : 0
TONBATT : 0 seconds
CUMONBATT: 0 seconds
XOFFBATT : N/A
SELFTEST : NO
STESTI : 336
STATFLAG : 0x07000008 Status Flag
REG1 : 0x00 Register 1
REG2 : 0x00 Register 2
REG3 : 0x00 Register 3
MANDATE : 09/16/05
SERIALNO : QS0538223684
BATTDATE : 09/16/05
NOMOUTV : 115 Volts
NOMBATTV : 12.0 Volts
FIRMWARE : 736.a.D
APCMODEL : DWD
END APC : Wed Dec 10 03:13:01 PST 2008

Reboot on Power-Up:

In order to make sure that you server starts when power is restored after a power failure and shutdown, you must configure your servers BIOS setting “Restore on AC/Power” and set it to “Power On”



个人安装时:依赖关系那步并没有做,直接用APC自带光盘将LINUX软件RPM包安装成功即可,过程中有相关的缺少文件,根据所提示进行YUM即可,安装成功后串口使用正常,但USB线未调试成功,转此篇主要以备查看,

  评论这张
 
阅读(1031)| 评论(0)
推荐 转载

历史上的今天

评论

<#--最新日志,群博日志--> <#--推荐日志--> <#--引用记录--> <#--博主推荐--> <#--随机阅读--> <#--首页推荐--> <#--历史上的今天--> <#--被推荐日志--> <#--上一篇,下一篇--> <#-- 热度 --> <#-- 网易新闻广告 --> <#--右边模块结构--> <#--评论模块结构--> <#--引用模块结构--> <#--博主发起的投票-->
 
 
 
 
 
 
 
 
 
 
 
 
 
 

页脚

网易公司版权所有 ©1997-2017