#amazon(B0000C2217,left,simage)
#amazon(,clear)
> sudo vi /etc/apcupsd/apcupsd.conf … 22 UPSCABLE usb … 44 UPSTYPE usb … 67 DEVICE /dev/usb/hid/hiddev0 … 244 # 245 # UPS name, max 8 characters 246 UPSNAME BAT-01 247 # 248 # Battery date - 8 characters 249 BATTDATE 02/09/06 250 # … :wqBATTDATEは、mm/dd/yy です。
86 ONBATTERYDELAY 6 … ここで指定した秒数以下の電源途絶は ユーザや配下のマシンに通知しない。 94 BATTERYLEVEL 5 … バッテリー残量がここで指定した%以下になったら シャットダウンを始める 100 MINUTES 3 … バッテリー残量がここで指定した分以下になったら シャットダウンを始める 115 TIMEOUT 0 … 電源途絶からここで指定した秒数経ったら シャットダウンを始める。0は無効値。バッテリー残量 がCPU側から分からないUPSの場合に設定。
> sudo /usr/share/doc/packages/apcupsd/examples/make-hiddev
# apcaccess status APC : 001,033,0804 DATE : Thu Feb 09 23:36:04 JST 2006 HOSTNAME : grape RELEASE : 3.10.17a VERSION : 3.10.17a (22 April 2005) suse UPSNAME : BAT-01 CABLE : USB Cable MODEL : APC ES 500 UPSMODE : Stand Alone STARTTIME: Thu Feb 09 23:35:53 JST 2006 STATUS : ONLINE LINEV : 103.0 Volts LOADPCT : 21.0 Percent Load Capacity BCHARGE : 100.0 Percent TIMELEFT : 36.5 Minutes MBATTCHG : 5 Percent MINTIMEL : 3 Minutes MAXTIME : 0 Seconds LOTRANS : 090.0 Volts HITRANS : 110.0 Volts ALARMDEL : Always BATTV : 13.6 Volts NUMXFERS : 0 TONBATT : 0 seconds CUMONBATT: 0 seconds XOFFBATT : N/A STATFLAG : 0x02000008 Status Flag MANDATE : 2005-08-20 SERIALNO : AB0534224438 BATTDATE : 2000-00-00 NOMBATTV : 12.0 FIRMWARE : 03.p5.A USB FW:p5 APCMODEL : APC ES 500 END APC : Thu Feb 09 23:36:06 JST 2006
# apcaccess FATAL ERROR in apcaccess.c at line 243 tcp_open: cannot connect to server localhost on port 3551. ERR=Connection refused
# /etc/init.d/apcupsd start Starting apcupsd power management done
# apctest 2006-02-09 23:42:58 apctest 3.10.17a (22 April 2005) suse Checking configuration ... Attached to driver: usb sharenet.type = DISABLE cable.type = USB_CABLE You are using a USB cable type, so I'm entering USB test mode mode.type = USB_UPS Setting up the port ... Creating the device lock file ... Hello, this is the apcupsd Cable Test program. This part of apctest is for testing USB UPSes. Getting UPS capabilities...SUCCESS Please select the function you want to perform. 1) Test kill UPS power 2) Perform self-test 3) Read last self-test result 4) Change battery date 5) View battery date 6) View manufacturing date 7) Quit Select function number:
# apctest 2006-02-09 23:39:20 apctest 3.10.17a (22 April 2005) suse Checking configuration ... Attached to driver: usb sharenet.type = DISABLE cable.type = USB_CABLE You are using a USB cable type, so I'm entering USB test mode mode.type = USB_UPS Setting up the port ... apctest FATAL ERROR in apcdevice.c at line 77 Unable to create UPS lock file. apctest FATAL ERROR in apcdevice.c at line 77 Unable to create UPS lock file. apctest error termination completed
# /etc/init.d/apcupsd stop Shutting down apcupsd power management done # killall apcupsd apcupsd: no process killed
Broadcast Message from root@grape (somewhere) at 23:49 ... Warning power loss detected on UPS BAT-01 Broadcast Message from root@grape (somewhere) at 23:49 ... Power failure on UPS BAT-01. Running on batteries. Broadcast Message from root@grape (somewhere) at 23:50 ... Power has returned on UPS BAT-01...
> cat /var/log/apcupsd.events … Fri Feb 10 23:49:22 JST 2006 Power failure. Fri Feb 10 23:49:28 JST 2006 Running on UPS batteries. Fri Feb 10 23:50:56 JST 2006 Mains returned. No longer on UPS batteries. Fri Feb 10 23:50:56 JST 2006 Power is back. UPS running on mains.