Koozali.org: home of the SME Server

Make an APC usb UPS work with dmc-mitel contrib

boss_hog

Make an APC usb UPS work with dmc-mitel contrib
« on: February 02, 2006, 03:36:28 AM »
Hey yall,
I am putting out information that I've gathered, to get  my APC  UPS on my SME6.5 server and have the functionality of Darrell May's APC UPS, Server Manager Panel.

Tester/Customizer: Joe Php (a.k.a. boss_hog)
UPS Model: APC ES725BB ups, usb connection(cable 127b)
Server: SME6.5 heavily modded, latest updates (EXCEPT those that interfere with the Horde 3 upgrade by John Bennett)
Problem: I wanted a Server Manager Panel to set the options on my APC ups.
My Goal: To get the contrib by D. May, dmc-mitel-apcupsd-3.8.5-5.noarch.rpm, to work with my APC usb connected ups. This contrib has an excellent Server Manager Panel for fine tuning the details of the ups and a web page monitor to check the stats of the ups. However, it was originally designed for use with a serial connection.
Requirements:
1) dmc-mitel-apcupsd-3.8.5-5.noarch.rpm
2) apcupsd-usb-3.10.18-1.rh7.i386.rpm
3) SME6.x installed
4) Functioning usb port(s)
5) a compatible APC ups with usb connector
6) local or PuTTY access
7) about 1/2 hour of time
8) Guts, to test this out for yourself !!
WARNING: As is the usual case, this worked for me, it may not work for you! You assume the risk for your server. The original contrib by D. May was built during the SME5.6 days, and although it has not caused my system any obvious harm, I am sure it is not the preferred way to do this task.
How You Can Help: Test it, and report back to contribs.org so we can learn from it.
** Please respect all copyright tags for both rpm's. I make no claim to either rpm, and share my info freely with everyone based on my experiences. **

Let's Get Started:
1) I disabled nut to avoid any conflicts with the following command
1a) /sbin/e-smith/config setprop nut status disabled
2) download the 2 rpm's mentioned above
3) cd /<downloads dir>
4) rpm -Uvh *rpm
5) run the following command to rebuild the Server Manager Panel
5a)  /etc/e-smith/events/actions/navigation-conf
Note: ignore the errors from FormMagick
6) mknod /dev/usb/hiddev0 c 180 96
Note: the previous command creates a usb device(hiddev0) in /dev/usb
7) pico /home/e-smith/apcupsd
   a) scroll down to the line that reads UPSCABLELIST=simple,smart,940-0020B,940-0023A,940-0024B,940-0024C,940-0024G,940-0095A,940-009
   b) add--> usb, <-- after the equal sign
   c) finished line should read UPSCABLELIST=usb,simple,smart,940-0020B,940-0023A,940-0024B,940-0024C,940-0024G,940-0095A,940-009
   d) scroll down a little more to the line that reads UPSTYPELIST=backups,backupspro,newbackupspro,backupspronp,matrixups,netups,sharebasic,sharesm
   e) add--> usb, <-- after the equal sign
   f) finished line should read UPSTYPELIST=usb,backups,backupspro,newbackupspro,backupspronp,matrixups,netups,sharebasic,sharesm
8) save and exit
9) go to https: or http://<your server>/server-manager
10) scroll down to Configuration--> APC UPS
11) change the line option, DEVICE: /dev/usb/hiddev0
12) change the line option, NISPORT: 3551
13) change the UPSCABLE to usb
14) change the UPSTYPE to usb
15) save
16) after the page reloads click on [refresh]
17) click on the link at the top of the APC UPS Configuration Panel  "Click here to launch the APCUPSD UPS Network Monitor."
18) you should see the operational status of the UPS

This is the point that I tested the shutdown function by unplugging the UPS.
The status page showed that the UPS was running on battery, with info about time remaining, voltage etc.
About 35 minutes later the server "appeared" to be properly shutdown. An email was sent to the root account telling of the power failure and current status of the UPS. Plugged the UPS in, back up and running as expected.

Please, if you see any major boo-boo's, point it (or them) out. If you find a security flaw in any of the above, drop an email to me through the contribs.org P.M. system, Thanks.
Good luck
Joe

The "Problem" line above has been edited as of Feb. 2, 2006. My SME6.5 test box would perform exactly as expected with the native NUT service.

Offline CharlieBrady

  • *
  • 6,918
  • +3/-0
Re: Make an APC usb UPS work with dmc-mitel contrib
« Reply #1 on: February 02, 2006, 05:57:16 PM »
Quote from: "boss_hog"

Problem: When we get power blips where I live, the native NUT service would pick up the signal from my APC ups and go directly to a shutdown.


Please make a detailed bug report. Thanks.

boss_hog

Make an APC usb UPS work with dmc-mitel contrib
« Reply #2 on: February 02, 2006, 07:40:53 PM »
Hi Charlie,
I will try to put together some logs in the next couple of days. Thanks for the reminder.
As a note, I have edited my previous post. When I tried to reproduce the shutdown "problem" on a SME6.5 test box, I couldn't. NUT performed just like it should.
My modified SME6.5 web server, mail server etc. may have an add-on contrib that isn't playing nice!
Joe