Skip to content
View in the app

A better way to browse. Learn more.

Unraid

A full-screen app on your home screen with push notifications, badges and more.

To install this app on iOS and iPadOS
  1. Tap the Share icon in Safari
  2. Scroll the menu and tap Add to Home Screen.
  3. Tap Add in the top-right corner.
To install this app on Android
  1. Tap the 3-dot menu (⋮) in the top-right corner of the browser.
  2. Tap Add to Home screen or Install app.
  3. Confirm by tapping Install.

UPS support yet?

Featured Replies

Would you mind showing how you install the package?  I assume it needs to be gunziped and un-tarred from the flash drive via the go script.  Then the daeomn ran.

 

thanks,

dave

 

 

It is easier than that, as far as installing the package itself.

 

Once you put the downloaded package in a folder on your flash drive

type:

installpkg apcupsd-3.14.3-i486-1kjz.tgz

Installing package apcupsd-3.14.3-i486-1kjz...

PACKAGE DESCRIPTION:

apcupsd: apcupsd - A daemon for controlling APC UPS devices

apcupsd:

apcupsd: Apcupsd can be used for power management and controlling most of

apcupsd: APC's UPS models on Unix and Windows machines.  Apcupsd works with

apcupsd: most of APC's Smart-UPS models as well as most simple signalling

apcupsd: models such as Back-UPS and BackUPS-Office.

apcupsd:

apcupsd: Requires: gd, libjpeg, libpng, ncurses

apcupsd: Homepage: http://www.apcupsd.org/

apcupsd:

apcupsd: Packaged by Ken Zalewski ([email protected])

Executing install script for apcupsd-3.14.3-i486-1kjz...

 

Installpkg deals with unzipping/uncompressing, and un-tarring and moving everything into place.

You still need to configure it, and arrange for it to be installed and re-configured each time you reboot.

 

(I'm just now setting up my APC UPS too)

 

Joe L.

  • Replies 239
  • Views 82.7k
  • Created
  • Last Reply
  • Author

so I could see modifying the package to be configured for my APC then re-tarring it all up.  Then you should be able to install and go, correct?

 

 

I'm struggling with vi right now, it does not work for me on the new version of UnRaid and just prints all kinds of crap all over the screen so I can't edit anything on unraid.  Very frustrating.

 

 

  • Author

With none of the libraries, nor ncurses available it has moved beyond my ability to get running :)

 

Hopefully one of you linux gurus can help out?

 

thanks,

dave

What terminal emulator are you using?  Get Putty... it loves unRAID.

  • Author

What terminal emulator are you using?  Get Putty... it loves unRAID.

 

Yep, that works.  thanks!

  • Author

Could someone that has the libs pull together show me where I can find them and such?  I can setup apcupsd to use my smart UPS, but don't know how to find all the necessary libs.

 

I"m assuming the is why I can't get apcupscd to run.

 

thanks

dave

I haven't installed on mine yet, but based on the package description in Joe's post, try here:  http://packages.slackware.it/browse.php?q=12.0/slackware/l

 

Scroll down to find gd, libjpeg, libpng, and ncurses.

 

Let us know how it goes.  I'll probably try this soon.

Could someone that has the libs pull together show me where I can find them and such?  I can setup apcupsd to use my smart UPS, but don't know how to find all the necessary libs.

 

I"m assuming the is why I can't get apcupscd to run.

 

thanks

dave

The slackware package I named in my post did not need any additional libraries to be installed by me.

I'm just learning how to configure it, but by commenting out one line in the apcupsd.conf file (in the line that defined the DEVICE, I added a "#" )

#DEVICE /dev/ttyS0

For now, I invoked manually the apcupsd program by typing

/sbin/apcupsd

 

Later, I start it up every time I reboot with a script.

 

Now, I can see it running by typing

ps -ef | grep apcups

 

I can test it (after plugging in its USB cable to my unRAID server) by typing

apcaccess status

APC      : 001,038,0928

DATE     : Sun Jul 06 00:20:15 EDT 2008

HOSTNAME : Tower

RELEASE  : 3.14.3

VERSION  : 3.14.3 (20 January 2008) slackware

UPSNAME  : Tower

CABLE    : USB Cable

MODEL    : Back-UPS ES 750

UPSMODE  : Stand Alone

STARTTIME: Sun Jul 06 00:16:00 EDT 2008

STATUS   : ONLINE

LINEV    : 123.0 Volts

LOADPCT  :  40.0 Percent Load Capacity

BCHARGE  : 100.0 Percent

TIMELEFT :  10.1 Minutes

MBATTCHG : 5 Percent

MINTIMEL : 3 Minutes

MAXTIME  : 0 Seconds

SENSE    : Medium

LOTRANS  : 092.0 Volts

HITRANS  : 139.0 Volts

ALARMDEL : Always

BATTV    : 13.8 Volts

LASTXFER : Low line voltage

NUMXFERS : 0

TONBATT  : 0 seconds

CUMONBATT: 0 seconds

XOFFBATT : N/A

SELFTEST : NO

STATFLAG : 0x07000008 Status Flag

MANDATE  : 2008-01-13

SERIALNO : 3B0802X63649

BATTDATE : 2001-09-25

NOMINV   : 120 Volts

NOMBATTV :  12.0 Volts

NOMPOWER : 450 Watts

FIRMWARE : 841.I2 .D USB FW:I2

APCMODEL : Back-UPS ES 750

END APC  : Sun Jul 06 00:20:24 EDT 2008

 

As you can see, all kinds of output are printed.  I can see I have about 10 minutes of runtime on the UPS once I lose power.

 

Now, I'll need to tie in the apcupsd to the power scripts on unRAID so it will shut down cleanly.  (That will have to wait for another day... I'ts late, and I'm calling it an evening)

 

Joe L.

  • Author

Yep, it is all working now.  I thought I had commented out that DEVICE line as well, but that did not happen and after commenting it out apcupsd now runs and I get a clean status from it.

 

Looks like my time left is 65.6 minutes.  Cool as that is the UPS that has my switch powered as well.

 

thanks

dave

Yep, it is all working now.  I thought I had commented out that DEVICE line as well, but that did not happen and after commenting it out apcupsd now runs and I get a clean status from it.

 

Looks like my time left is 65.6 minutes.  Cool as that is the UPS that has my switch powered as well.

 

thanks

dave

Glad you also had some success.  It also sounds like you have a larger UPS for the unRAID server than me.  (or a more efficient server, or both)

 

I did notice that after all my drives spun down, I can easily see the power savings. 

 

The with all my disk drives idle, status now shows:

LOADPCT  :  27.0 Percent Load Capacity

TIMELEFT :  15.2 Minutes

 

Joe  L.

  • Author

OK so I did a little testing.

 

Here is what I got in the /var/log/apcupsd.events

 

Sun Jul 06 16:45:16 CDT 2008  Communications with UPS lost.

Sun Jul 06 16:47:39 CDT 2008  Communications with UPS restored.

Sun Jul 06 16:49:03 CDT 2008  Power failure.

Sun Jul 06 16:49:09 CDT 2008  Running on UPS batteries.

Sun Jul 06 16:49:51 CDT 2008  Mains returned. No longer on UPS batteries.

Sun Jul 06 16:49:51 CDT 2008  Power is back. UPS running on mains.

 

I also used the powerdown.zip script found here on the forum and set that up.

 

I made a copy of powedown called reboot and changed the shutdown options to -r instead of -h.

 

I changed /etc/apcupsd/apcccontrol

 

added POWERDOWN and REBOOT commands, similar to the SHUTDOWN command.

Changed the calls for powerdown and reboot to call my own scripts.

 

Too bad we don't have a simple mail command to email the messages out.  I did install the nc package for the smtp_check_unraid.sh and have considered modifying it to act as a mail command, but that will have to wait for later.

 

I guess I could have changed the powerdown script to accept command line arguments like -h  and -r to simulate the shutdown command and that would have been a little cleaner, but I"m not a bash guy.  Additionally it would seem that the smtp_check_unraid.sh script could be modified to be similar to the mail command to provide "simulated mail" funtionality.

 

So far things seem to be working.  I'll have to simulate a power failure sometime when the server is not in use.

 

Thanks to everyone for helping me out on this!

 

 

Too bad we don't have a simple mail command to email the messages out.  I did install the nc package for the smtp_check_unraid.sh and have considered modifying it to act as a mail command, but that will have to wait for later.

 

I have some packages using EXIM if you are interested.

It works two ways,

 

1. If you do not provide a destination mail address on the install script, it will log the output via logger.

2. If you supply a mail destination it will send the notices offhost.

 

Download the ctorrent package I provided on the board, and I;ll post a torrent of the exim and the startup script.

 

Also, I think it best to use arguments for the -r -h in powerdown/reboot.

I could modify the script so if it is named powerdown, assume -h if named reboot assume -r.

Might be better that way.

 

  • Author

Also, I think it best to use arguments for the -r -h in powerdown/reboot.

I could modify the script so if it is named powerdown, assume -h if named reboot assume -r.

Might be better that way.

 

 

I changed the scripts to have two, powerdown and reboot, and changed the command to shutdown appropriately.  It does make is readable, but seems kind of a waste of bits, but functional.

In general I don't like to base functionality on the program file name. Kinda klugy IMO. In this case seems pretty harmless, but I'd likely go for a command line switch instead.

In general I don't like to base functionality on the program file name. Kinda klugy IMO. In this case seems pretty harmless, but I'd likely go for a command line switch instead.

 

for what its worth I agree 100%. Par2verify, Par2create and Par2repair use this kind of setup and its just plain horrible.

If NASUser and I agree on anything, you KNOW it has to be right.  ;)

If NASUser and I agree on anything, you KNOW it has to be right.   ;)

 

:);):D;D>:(:(:o8)???::):P:-[:-X:-\:-* :'(

 

hehe so true :P

 

It's a standard way of making it easy for a user to get at functionality without remembering switches.

 

rcotrone@Atlas:/sbin$ ls -l | grep halt

-rwxr-xr-x 1 root root  9400 Jun 14 23:04 halt*

lrwxrwxrwx 1 root root      4 Jun 14 23:04 poweroff -> halt*

lrwxrwxrwx 1 root root      4 Jun 14 23:04 reboot -> halt*

 

In dealing with support for linux newbies, I think reboot and poweroff are self explanatory and make it easier for them.

I'll add in the option of arg 1 being -r or -h and passing that along ;-)

I see what your saying but its a slippery slope. Im sure some happy ballance could be struck.

 

(If someone can work switches should they be using the command line :P :whistle: )

It has always been that way in unix.

 

ex, edit, vi, view, vedit were all links to the same file.  The editor behavior changes based on the invoked name. 

In one old version of unix, I seem to remember "cp" and "mv" being links to the same file.

 

Joe L. 

Too bad we don't have a simple mail command to email the messages out.  I did install the nc package for the smtp_check_unraid.sh and have considered modifying it to act as a mail command, but that will have to wait for later.

 

Attached is a simple "mail" command substitute using "nc" to send the mail to the smtp server. 

(install as /usr/bin/mail) you will need to set the three variables at the top of the script.

I had to hand-code a crude getopt replacement, since getopt could not deal with multi-word subject string.

 

This version will not work if your smtp server uses a login/password.

 

Joe L.

 

  • Author

very cool, I'll use this when  I get home.

  • Author

Joe,

The mail substitute works great.  I was able to test my APC UPS and get email notification!

 

thanks a bunch.

 

dave

  • 2 weeks later...

Ok, got the APCUPSD working on all 3 systems I've got, with one being the master, the others getting status, etc, from it. How do I get this to run automatically on my unRAID box? Am I correct in thinking, somewhere in the go script I'll need to execute the install each boot, copy the conf file from the flash to the etc directory then invoke the apcupsd from /sbin?

Any help you can give would be appreciated

 

thanks!!

  • Author

Ok, got the APCUPSD working on all 3 systems I've got, with one being the master, the others getting status, etc, from it. How do I get this to run automatically on my unRAID box? Am I correct in thinking, somewhere in the go script I'll need to execute the install each boot, copy the conf file from the flash to the etc directory then invoke the apcupsd from /sbin?

Any help you can give would be appreciated

 

thanks!!

 

Your exactly right.

 

I put all the /etc/apcupsd/* scripts in a directory on flash so I could get them all with a single cp command.  Then added the following to my go script:

 

# Install netcat for emailing notices

installpkg /boot/packages/nc-1.10-i386-1.tgz

 

# copy mail substitute program (uses netcat)

cp /boot/config/mail /usr/bin/mail

 

# install APC UPS daemon for UPS support

installpkg /boot/packages/apcupsd-3.14.3-i486-1kjz.tgz

cp /boot/config/apcupsd/* /etc/apcupsd

cp /boot/config/rc.6 /etc/rc.d

/etc/rc.d/rc.apcupsd start

 

 

 

Archived

This topic is now archived and is closed to further replies.

Account

Navigation

Search

Search

Configure browser push notifications

Chrome (Android)
  1. Tap the lock icon next to the address bar.
  2. Tap Permissions → Notifications.
  3. Adjust your preference.
Chrome (Desktop)
  1. Click the padlock icon in the address bar.
  2. Select Site settings.
  3. Find Notifications and adjust your preference.