Koozali.org formerly Contribs.org

Apcupsd setup on 7.4

Apcupsd setup on 7.4
« on: May 03, 2010, 09:59:34 AM »
Hi - usual disclaimers apply

We like to use APC UPS's and the cgi files bundled with the Apcupsd daemon are nice to use.
Post install and service startup...

http://host.domain/cgi-bin/multimon.cgi

....will access the cgi


Currently we use BK500EI - Backups CS 500

The conf file has good detail on setup options.

We always set the TIMEOUT to 600 seconds; You shouldn't let UPS batteries run down to 5% (default) as this massively shortens their life.
Set TIMEOUT to 10 for testing.

#!/bin/sh

# Setup DAG repository
/sbin/e-smith/db yum_repositories set dag \
repository Name 'Dag - EL4' \
BaseURL 'http://apt.sw.be/redhat/el4/en/$basearch/dag' \
EnableGroups no \
GPGCheck yes \
GPGKey http://dag.wieers.com/packages/RPM-GPG-KEY.dag.txt \
Visible no \
Exclude freetype,htop,iptraf,rsync,syslinux \
status disabled \
signal-event yum-modify

# INSTALL APCUPSD
yum install --enablerepo=dag --enablerepo=base apcupsd

# COPY ORIGINAL CONF
cp apcupsd.conf apcupsd.conf.orig

# COPY CGI FILES
cp /var/www/apcupsd/* /home/e-smith/files/ibays/Primary/cgi-bin/

# LINK STARTUP SCRIPT
ln -s /etc/rc.d/init.d/e-smith-service /etc/rc7.d/S99apcupsd

# SET SERVICE IN SME
config set apcupsd service status enabled

echo "edit /etc/apcupsd/apcupsd.conf then start the service"


Re: Apcupsd setup on 7.4
« Reply #1 on: May 03, 2010, 03:02:53 PM »
We like to use APC UPS's and the cgi files bundled with the Apcupsd daemon are nice to use.

Fine - however that is not relevant for this forum, which concerns only software included with the SME server CD.

Offline byte

  • *
  • 2,183
Re: Apcupsd setup on 7.4
« Reply #2 on: May 03, 2010, 03:45:12 PM »
Moving this topic to the SME 7.x contribs forum, it is more appropriate there. Thanks!
--[byte]--

Have you filled in a Bug Report over @ http://bugs.contribs.org ? Please don't wait to be told this way you help us to help you/others - Thanks!

Offline Stefano

  • *
  • 10,779
  • Skype account: maghissimo
    • Smeserver italian community
Re: Apcupsd setup on 7.4
« Reply #3 on: May 03, 2010, 04:18:46 PM »

# Setup DAG repository
/sbin/e-smith/db yum_repositories set dag \
repository Name 'Dag - EL4' \
BaseURL 'http://apt.sw.be/redhat/el4/en/$basearch/dag' \
EnableGroups no \
GPGCheck yes \
GPGKey http://dag.wieers.com/packages/RPM-GPG-KEY.dag.txt \
Visible no \
Exclude freetype,htop,iptraf,rsync,syslinux \
status disabled \
signal-event yum-modify

there's already a Wiki  page about it

robwellesley, could you please create an howto in the wiki?
thank you in advance
Consulente di Smeserver.it -  Soluzioni e supporto su Sme server in Italia

Re: Apcupsd setup on 7.4
« Reply #4 on: May 03, 2010, 11:10:43 PM »
robwellesley, could you please create an howto in the wiki?

Stefano - Not sure what you mean here.  Can you elaborate please?
Rob

Offline Stefano

  • *
  • 10,779
  • Skype account: maghissimo
    • Smeserver italian community
Re: Apcupsd setup on 7.4
« Reply #5 on: May 03, 2010, 11:23:41 PM »
Stefano - Not sure what you mean here.  Can you elaborate please?
Rob

create an account (if you haven't one) to access wiki to create a page in the howto section :-)
Consulente di Smeserver.it -  Soluzioni e supporto su Sme server in Italia

Re: Apcupsd setup on 7.4
« Reply #6 on: May 05, 2010, 11:36:52 PM »
Hi Stefano (Sorry for the post here but there's no 'Wiki help forum" that I can see)

created this http://wiki.contribs.org/Apcupsd

but edit on http://wiki.contribs.org/Category:Howto doesn't let me add a link to it

Can you point me in the right direction?

Rob

Offline Jáder

  • *
  • 1,059
    • LinuxFacil
Re: Apcupsd setup on 7.4
« Reply #7 on: May 06, 2010, 12:03:24 AM »
Hi

Edit your Howto and add this at end:
Code: [Select]
----
[[Category:Howto]]

This will inform Wiki that page belongs to Category HowTo and Wiki will show it there automagically.
...

Re: Apcupsd setup on 7.4
« Reply #8 on: May 06, 2010, 12:10:51 AM »
And there it is!  Cool!

Cheers, I'd have been hours more trying to figure that out..

Offline janet

  • ****
  • 4,746
Re: Apcupsd setup on 7.4
« Reply #9 on: May 06, 2010, 01:56:08 AM »
robwellesley

Quote
...I'd have been hours more trying to figure that out..

You can always look at existing howtos to see how they are done ie choose to edit but do not save.
Please search before asking, an answer may already exist.
The Search & other links to useful information are at top of Forum.

Re: Apcupsd setup on 7.4
« Reply #10 on: May 06, 2010, 03:02:45 AM »
We like to use APC UPS's and the cgi files bundled with the Apcupsd daemon are nice to use.
Post install and service startup...

http://host.domain/cgi-bin/multimon.cgi

....will access the cgi
I just gave this a shot and had issues with:
Code: [Select]
Local Host Not available: upsfetch: tcp_open failed for 127.0.0.1 port 3551apctest couldn't find the ups either.
I think this is because my ups is attaching through the usb with driver "usbfs" instead of "hid" and I think this tool requires "hid". On this front my SME is stock so usbfs is likely the default.

I'll look into it later but wondering if anyone else has seen this?
SME since 2003

Re: Apcupsd setup on 7.4
« Reply #11 on: May 06, 2010, 03:14:45 AM »
What model is your UPS

Re: Apcupsd setup on 7.4
« Reply #12 on: May 06, 2010, 03:43:21 AM »
What model is your UPS
Back-UPS XS-1000 on the box but upsc reports "Back-UPS RS 1000"

I also note upsd is still seeing it so perhaps I have to unload the current driver?
SME since 2003

Re: Apcupsd setup on 7.4
« Reply #13 on: May 06, 2010, 03:54:12 AM »
Default SME - standalone with UPS attached
Default apcupsd install

These settings should be....

UPSCABLE usb
UPSTYPE usb
DEVICE                # i.e left blank

... for a USB cable

All other settings can be left at default in the first instance.

Re: Apcupsd setup on 7.4
« Reply #14 on: May 06, 2010, 03:57:26 AM »
yes. This is exactly what I have.

Are you also able to use upsd and upsc? For example:
Code: [Select]
upsc UPSIf you can then I can assume that it is not interfering.

Did you need to reboot?
SME since 2003

Re: Apcupsd setup on 7.4
« Reply #15 on: May 06, 2010, 04:02:25 AM »
We do nothing more than the 'howto' and it works.

Is the service running?  /etc/init.d/apcupsd status

A reboot will start the service, but /etc/init.d/apcupsd start is simpler

Re: Apcupsd setup on 7.4
« Reply #16 on: May 06, 2010, 04:04:05 AM »
.....
[root@hpserver ~]# [root@hpserver ~]# upsc UPS
-bash: [root@hpserver: command not found
[root@hpserver ~]# Error: Connection failure: Connection refused

Re: Apcupsd setup on 7.4
« Reply #17 on: May 06, 2010, 04:21:40 AM »
Is the service running?  /etc/init.d/apcupsd status

A reboot will start the service, but /etc/init.d/apcupsd start is simpler
Agreed. But it starts and then fails hence the status shows it as dead. when I do apctest it can't find the UPS.
/var/log/messages has:
Code: [Select]
apcupsd[9459]: apcupsd FATAL ERROR in linux-usb.c at line 609 Cannot find UPS device -- For a link to detailed USB trouble shooting information, please see <http://www.apcupsd.com/support.html>.which I believe also means it failed because it could not find the UPS. So that seems to be the root cause.

Your upsc command failed so I am now guessing this is where the conflict lies (ie. mine works). A reboot may load the drivers differently. I can give this a shot when my system is a little more idle.

Do you get anything if you use (not that is a capital V):
Code: [Select]
/usr/sbin/upsd -Vupsc should be at:
Code: [Select]
/usr/bin/upsc
Thanks for looking into it. Further suggestions are also welcome.
SME since 2003

Re: Apcupsd setup on 7.4
« Reply #18 on: May 06, 2010, 04:28:17 AM »
[root@hpserver ~]# /usr/sbin/upsd -V
Network UPS Tools upsd 2.2.0-