[Solved] Need help with APCUPSD and 2 Unraid servers.


Recommended Posts

I am running 2 unraid servers Goliath and Spartacus and a Windows 2008r2 Server (Leviathan) on the same APC UPS.

 

Goliath has the master USB port to the APC UPS.

Goliath is on 24x7 so it is the master. The other two boxes are not always on.

 

Goliath works as it should. It broadcasts "ON BATTERY" and it shuts down after 6 minutes.

Leviathan receives its signal from goliath on power fail and shuts down after 3 min.

 

Now the fun part...

Spartacus.

The default pkg manager for APCUPSD does not take slave unraid into account. It sets up up as COM or UPS.

I did putty into Spartacus and edit the apcupsd.conf. Stop and restart rc.apcupsd and it works as intended....

 

until reboot.. :| I could use a hand either editing the apcupsd-unmenu-package.conf file so it dynamically builds it each time...

That, or a work around. perhaps putting the lines in the GO script to "/etc/rc.d/rc.apcupsd stop", then CP the config file, then "/etc/rc.d/rc.apcupsd start".

 

The lines we need to change in the apcupsd.conf

UPSCABLE ether (from usb)

 

and

 

UPSTYPE net (from usb)

DEVICE %remote_servers_hostname%:3551 (from /dev/usb/hiddev0)

 

And add line for POLLTIME

the default is REM'd out (#POLLTIME 60).

I would like it at 30.

60 seconds can be forever when on batteries if i have all 3 servers on.

 

I am so close with the apcupsd-unmenu-package.conf file, yet i am feeling brain dead at the moment and am about to give up for the night.

 

I have a feeling i am not alone with this.

 

Screen shot of Spartacus running off Goliaths UPS (and my thinkpad monitoring Goliath)

APC.PNG.cb69fd61544a68111382c78c7473575f.PNG

Link to comment

It works fine as a slave for me:

 

Use Serial Port?(YES/NO/network_master:port):		If set to NO, a connection via USB cable is used. If YES, a connection via SERIAL cable will be used. If set to anything else, that port will be used. 
(Set to remote_master:port to network slave off another server running apcupsd. 
Example: if the master is "tower" then set this field to tower:3551 )

Cable Type:(smart/usb/dumb/ether):		Use "smart" for APC UPS, "usb" for some other brands, "dumb" for others with appropriate cable to serial port, "ether" to slave off of apcupsd running on another server.

Battery Level:		Shutdown will occur when percentage charge remaining is less than this level.

Minutes Remaining:		Shutdown will occur when remaining runtime reaches this value.

Total Seconds Outage:		If outage (in seconds) exceeds this value, a shutdown will occur.

Power Down UPS after shutdown?(YES/NO):		If YES the UPS will power itself off after the server is powered down. This allows it to save its batteries. If NO, the UPS will not power down.

Link to comment

Same here, John. I've installed on several versions from pkg_manager.

 

Installed as slave just now on b10 using these parameters:

 

upsdconfig.png

 

Uploaded with ImageShack.us[/img]

 

Syslog after reload:

Jul 27 20:52:05 Tower1 apcupsd[20849]: apcupsd exiting, signal 15 
Jul 27 20:52:05 Tower1 apcupsd[20849]: apcupsd shutdown succeeded
Jul 27 20:52:07 Tower1 apcupsd[22338]: apcupsd 3.14.3 (20 January 2008) slackware startup succeeded
Jul 27 20:52:07 Tower1 apcupsd[22338]: NIS server startup succeeded

 

Pulled power cord of master's UPS and slave's UPS Info shows:

upsdconfig1.png

 

Link to comment

Interesting. It didnt work for me. It was ignorning the host. I'll try sometime over the weekend. I have 16 hour work days all week this week.

You must have the DNS server field in unRAID defined for it to resolve the server name. 

 

What happens when you type

net lookup servername

putting in the server name of your unRAID server running apcupsd.

 

I guess as an alternative, you could put

ipaddress:3551

Link to comment
  • 2 weeks later...

Actually, I did have it as IP. but thanks for the suggestion

 

I looked at Cyrnel's screenshot and noticed his config file does not match mine.

 

Even though I only added unmenu about 2 weeks ago, I ran the check for updates option today and i then got the new config layout.

 

I put in my data and everything is good.

 

Thanks for the help.

I guess the answer was already put into place, i just didn't have the update.

~shrug~

Link to comment

Actually, I did have it as IP. but thanks for the suggestion

 

I looked at Cyrnel's screenshot and noticed his config file does not match mine.

 

Even though I only added unmenu about 2 weeks ago, I ran the check for updates option today and i then got the new config layout.

 

I put in my data and everything is good.

 

Thanks for the help.

I guess the answer was already put into place, i just didn't have the update.

~shrug~

There are two versions of apcupsd in the package manager.  The older  3.14.3  version has been more reliable for me and is the one I use.  It has the fields so you can enter "ether" as the cable type. 

 

The slightly newer version of apcupsd does not have "ether" as a cable type in its instructions.  I did not realize it was not in sync with the older version, but it was submitted by another user like yourself.  I can only guess he based it on an earlier version of the .conf file.

 

The ability to use a network connection ("ether") as the cable type was added in the unMENU .conf file for the 3.14.3 version of apcupsd just over a year ago on Jul 27, 2010.

 

Glad you are up and running.

 

Joe L.

Link to comment

you are correct,

I did downgrade to the older version at the same time i upgraded.

Prior to that, I was running the new version. the host machine is still the new version.

but it did say i got a an update to apcupsd, perhaps it was because i messed with the config files and it downloaded the original versions again..

 

thanks again

Link to comment

but it did say i got a an update to apcupsd, perhaps it was because i messed with the config files and it downloaded the original versions again..

Yes, my unmenu release list keeps a "modified" MD5 checksum of the .conf files that define the packages and files that are used in unMENU. 

It was designed to ignore the lines with your locally configured variables but still allow the detection of your older versions to be able to update them when needed.

 

If you have modified the .conf file, it would have put it back to its original state (and saved a copy of your modified version)

 

If you wish to have your own modified version, just name the modified file a different name, keeping the same basic pattern used to recognize package files. 

your-package-name-unmenu-package.conf

(To be recognized by the package namer, unmenu package must have a name that ends in "-unmenu-package.conf"

 

then, install your modified version through the package manager.

Link to comment

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.