Changing UPS from asustor to ups

Moderator: Lillian.W@AST

Post Reply
drrevenge
Posts: 4
youtube meble na wymiar Warszawa
Joined: Wed Feb 24, 2021 10:30 am

Changing UPS from asustor to ups

Post by drrevenge »

Hi All,

I just purchased a AS6510T and I have a Synology NAS as well.

I have my Cyberpower UPS connected to the AS6510T directly, and Synology has the ability to detect the UPS if NUT is configured to call the ups 'ups' not 'asustor' which it is by default.

I try modifying the ups.conf file to change the name, but when reloading the service, the AS6510T no longer detects the UPS and the Synology NAS can't see it as well. (When I run upsc asustor@IPADDRESS on the synology it returns what I would expect, but running upsc ups@IPADDRESS I get driver not loaded)

Does anyone have any suggestions on if it's possible to change the name? The only other thing I was thinking if it's not possible is to setup a raspberry pi and make that the master and make the asustor and synology slaves from that.
drrevenge
Posts: 4
Joined: Wed Feb 24, 2021 10:30 am

Re: Changing UPS from asustor to ups

Post by drrevenge »

In the end, I could never get this to work.

I ended up getting a raspberry pi to work as the NUT server, and make both the Synology NAS and the ASUStor NAS run off the server and now that it can safely shutdown both NAS units. Just need to make sure the switch and the pi are on the UPS too. :)
dm9991966
Posts: 6
Joined: Fri Aug 05, 2016 8:48 pm

Re: Changing UPS from asustor to ups

Post by dm9991966 »

Could you explain how you setup your Asustor to use the NUT server? I have a AS6202T, but when I set the UPS Preferences as 'Network UPS Slave' and enter the NUT server IP address, the test always fails. There is nowhere in preferences to set the username/password to connect to the NUT server as (that I have found).

Thanks in advance...
dm9991966
Posts: 6
Joined: Fri Aug 05, 2016 8:48 pm

Re: Changing UPS from asustor to ups

Post by dm9991966 »

Got it working. From another post I found out that the userid/password used by the Asustor is apparently hardcoded, so had to add that id/pw to the RPi's upd.users.

Now, the UPS page on ADM shows that it is receiving data from the NUT server.

There are actually 5 devices connected to the UPS (Windows PC, RPi, NAS & 2 Dell Linux thin clients). The NUT client is installed on all the devices. When sending an FSD on the NUT server, all the devices except the NAS shutdown successfully. The NAS just continues running until the UPS powers down.

I'm not seeing anything in any NAS logs saying that it actually noticed the FSD from the NUT server. However, I'm not positive I'm looking in the right places for the log messages. Anyone have any hints on where I should see the NUT client messages on the NAS? Also, any thoughts on where I may have screwed up on the config that would stop the NAS from shutting down appropriately? I've set the NUT server's FINALDELAY to 300s, and it does actually wait the 5mins after sending the FSD before it shuts down.

Thanks in advance.
neil1999
Posts: 2
Joined: Wed Jan 17, 2024 3:34 pm

Re: Changing UPS from asustor to ups

Post by neil1999 »

dm9991966 wrote:Got it working. From another post I found out that the userid/password used by the Asustor is apparently hardcoded, so had to add that id/pw to the RPi's upd.users.

Now, the UPS page on ADM shows that it is receiving data from the NUT server.
...
Thanks in advance.
I have the same issue here using AS6202T while using another QNAP NAS as UPS Master. The UPS Slave test on ADM always shows Fail.
I know Asustor has fixed UPS name=asustor, username (=admin), passwd (=1111), but I don't know how to edit the conf file to make it work as a UPS Slave (Or vice versa, make it a UPS Master and let other device receive its signal)

With QNAP as UPS Master, I can have WinNUT client to show UPS status so I am sure QNAP as UPS Master is working well.

Can you share some more details (step by step will be even better)
Say
1. edit upsd.usr
2. Restart upd by 'sudo xxx yyy zzz"
3. etc

Thanks a lot in advance!
dm9991966
Posts: 6
Joined: Fri Aug 05, 2016 8:48 pm

Re: Changing UPS from asustor to ups

Post by dm9991966 »

Okay, while I had it limping along before, there were still some issues which led me to change the setup...

As noted before, the ups name and upsmon credentials are hardcoded. My NUT server is running on a RPI which monitors all 4 of the UPS's in my office. I had a nice naming convention working for them, and 'asustor' didn't fit that. So, I tried duplicating the primary UPS's config under the name [asustor]. This initially worked, but I noticed after a while (a couple hours maybe) the NUT server would start reporting stale data for the [asustor] UPS. Restarting upsd on the RPI would bring it back, but only for a little while. So, for now, I've given up that fight and just renamed the UPS to [asustor], naming convention be-dammed. :evil: :evil: :evil:

The next issue I had was that the default Asustor config of upsmon completely ignores the FSD (force shutdown) command. So, while every other device connected to the UPS gracefully shut down when using FSD, the NAS would keep chugging away until the UPS load was cycled...not ideal.

So, I ended to doing the following:

* Pick a location to hold the NUT configs you want to use; we'll call it $NUT_DEFS. Place copies of the files you want to use here.
* Create a startup script, S99zzzzUps, which does the following:
Copy $NUT_DEFS to /etc/ups
Copy $NUT_DEFS to /usr/etc.base/ups
Executes 'upsmon -c reload'.
Write logs to system log, if desired.

Save the script into /usr/local/etc/init.d. This appears to be where the installed app's startup scripts are kept, and is NOT reset during a system restart.

Tested several times by running 'upsmon -c fsd' on the RPI, and all systems, including the NAS, shutdown gracefully.

It's truely a shame that Asustor chose to a) ignore the FSD, and b) not allow configuring upsmon with UPS name and custom credentials. FWIW, you could update the credentials in upsmon.conf as well, if you would like. I haven't taken it that far, yet.

I think I'll open an issue with NUT about allowing a single UPS to be monitored using multiple names. If they choose to implement, then I can go back to using my preferred name.

Hope this helps any other poor souls that come after...
neil1999
Posts: 2
Joined: Wed Jan 17, 2024 3:34 pm

Re: Changing UPS from asustor to ups

Post by neil1999 »

Thanks for the info! Before I can try again, I eventually gave up fighting and use my own method to do this tricky setup:
My goal is just to use one UPS to control 2 NAS. (ASUSTOT and QNAP)
My set up is like this: (both use sudo to schedule cron and run the check)
1. ASUSTOR USB directly connected UPS (CyberPower) - Master. This works fine and ASUSTOR will shutdown and wake up by UPS signal
Use a cron job (per 15-min) to do 'upsc asustor@localhost battery.charge and 'upsc asustor@localhost ups.status" to check battery status. If battery and Power both OK, send WOL signal to wake up Qnap (ether-wkake command)
This is to make sure when power is resumed, QNAP can be waked up because it was shut down when power is down.
2. QNAP as a slave. (upsc can work and get the UPS data from ASUSTOR by upsc command). Turn on WOL.
Use a cron job (per 5-min) to check remote (ASUSTOR) UPS status: upsc asustor@192.168.10.12 battery.charge and upsc asustor@192.168.10.12 ups.status. If UPS is not OL and Battery level < 50%, that implies a power loss and need to do a graceful shutdown for protection. Then it will shutdown until Wol comes in from ASUSTOR.

My UPS normally can last 30 min (2 NAS and some routers), so what I expected is
1. when power loss, the QNAP/Slave will detect and shutdown first when batter is lower than 50%. Master side (ASUSTOR) can take care of itself already so no worry.
2. When power is Up, Slave (QNAP) will keep sleeping until ASUSTOR wakeups and decide to send WOL to wake up QNAP if batter and power both OK.

This will consume some CPU (the cron job) but I think that's very lightweight.
I tried it some times and it works for me. This does not rely on upsmon so may be useful for any other devices too.
bbbaton
Posts: 14
Joined: Sun Nov 08, 2020 5:27 pm

Re: Changing UPS from asustor to ups

Post by bbbaton »

Just popping in to say I got my UPS solution working.

My UPS is supplying power to my Asustor 4-bay NAS, the 4-bay extension for the NAS, my computer, monitor, and the network switch connecting the two.

The UPS is connected to the NAS via USB. The NAS is configured to be the UPS master.

I installed WinNUT, and edited the main config file as follows:

MONITOR asustor@192.168.1.45 1 admin 1111 slave

(Of course replace the IP with the v4 IP of your own Asustor NAS.)
Apparently the name (asustor), user (admin) and password (1111) is all preconfigured and need to be typed just like this.
This got the connection going and winNUT listening as slave to the signals from the NAS.

I set my computer to shut down before the NAS, because bad things happen if my different programs lose connection to the storage.

Hope this can help someone struggling like I did :)
Post Reply

Return to “ADM general”