DSM-G600, DNS-3xx and NSA-220 Hack Forum

Unfortunately no one can be told what fun_plug is - you have to see it for yourself.

You are not logged in.

Announcement

#1 2009-12-20 07:25:09

helsan
Member
Registered: 2009-12-20
Posts: 7

3XDNS_323 with 1XUPS

Is there a way to send a shutdown command from my main DNS_323 to my two other DNS_323.
They are connected to the same UPS but only one had the USB between the NAS and the UPS.

I would like to have a shutdown request sent so they all shutdown when an outage occurs.
My UPS doesnt have the option to perform that.

Thanks

Offline

 

#2 2009-12-22 02:23:55

bjby
Member
Registered: 2009-02-22
Posts: 265

Re: 3XDNS_323 with 1XUPS

If you have ssh setup with keypairs you could probably do smthng like this:

ssh root@dns323_1 'shutdown'
ssh root@dns323_2 'shutdown'


You could also poll for when the main dns323 goes down. Shedule a job in cron in other two dns323. In case main dns323 does not respond to ping then shutdown.

I hope that helped.

Last edited by bjby (2009-12-22 02:24:36)

Offline

 

#3 2009-12-22 05:59:00

helsan
Member
Registered: 2009-12-20
Posts: 7

Re: 3XDNS_323 with 1XUPS

I never scripted in unix... any example on how I can check the status of the main DNS323 using cron?

Thanks

Offline

 

#4 2009-12-22 10:06:25

bjby
Member
Registered: 2009-02-22
Posts: 265

Re: 3XDNS_323 with 1XUPS

You can try to add this command below to cron for start. For your purpose you need to write
some if blocks around it around it. But you an do it. Good luck.

/ffp/bin/ping -c 1 127.0.0.1 | /ffp/bin/grep packet >> /mnt/HD_a2/testcron.log

http://www.cyberciti.biz/faq/how-do-i-a … unix-oses/

http://www.freeos.com/guides/lsst/

Offline

 

#5 2009-12-22 16:30:11

fordem
Member
Registered: 2007-01-26
Posts: 1938

Re: 3XDNS_323 with 1XUPS

bjby wrote:

You can try to add this command below to cron for start. For your purpose you need to write
some if blocks around it around it. But you an do it. Good luck.

/ffp/bin/ping -c 1 127.0.0.1 | /ffp/bin/grep packet >> /mnt/HD_a2/testcron.log

http://www.cyberciti.biz/faq/how-do-i-a … unix-oses/

http://www.freeos.com/guides/lsst/

Out of curiosity - in this particular scenario what purpose would pinging the "local host" serve??

Offline

 

#6 2009-12-22 17:09:56

bjby
Member
Registered: 2009-02-22
Posts: 265

Re: 3XDNS_323 with 1XUPS

Pinging localhost is of curse of no use. The ip needs to be changed. I'm just trying to help, pointing in right direction, but maybe this is insufficient to get helsan going.

Offline

 

#7 2009-12-28 01:09:11

asluiter
Member
From: Melbourne, Australia
Registered: 2008-11-08
Posts: 9

Re: 3XDNS_323 with 1XUPS

Hi helsan,
Using "nut" you can achieve what you want. Designate one DNS-323 as a master, and the other two as slaves units. You will need to install nut on all three units. Correctly configured, the master DNS-323 will communicate with the UPS and send the shutdown commands to the slaves when the battery on the UPS gets low, then shut itself down.

You mentioned that your UPS has a USB port, so you can connect the UPS to one of the DNS-323, set this DNS-323 as a master in nut, and the other two using nut as slaves.

FYI, if your UPS has only a serial port you will have a significantly greater degree of difficulty. For a start you will have to add serial port h/w to your primary DNS-323, but even then I recall having lots of problems getting this working, as UPS serial port communications is not simple Tx/Rx. They use all sorts of tricks used with DTS/DTR lines which are not supported with the DNS-323 serial port. I recall getting simple comms working, but not battery state. So shutdown timers are required as well.

It must be said that nut has a pretty steep learning curve, and while reasonably well documented there is a lot to wade through to get it to work.

Regards,
Andrew.

Offline

 

#8 2009-12-28 02:49:01

fordem
Member
Registered: 2007-01-26
Posts: 1938

Re: 3XDNS_323 with 1XUPS

Just so that you are aware, with firmware versions 1.06 and later, nut - network UPS tools - is already installed, so it's essentially a matter or configuring it to do what you want.

Offline

 

#9 2009-12-28 07:39:07

helsan
Member
Registered: 2009-12-20
Posts: 7

Re: 3XDNS_323 with 1XUPS

Thanks for the 'nut' tools.

Was easy to Install.... but Im now receiving : Can't open POWERWARE USB device
It is with a APC UPS ES 650

Any idea where I could find more guides on the NUT??

Thanks

Offline

 

#10 2009-12-28 08:10:21

helsan
Member
Registered: 2009-12-20
Posts: 7

Re: 3XDNS_323 with 1XUPS

Also giving this error:
No matching USB/HID UPS found
Driver failed to start (exit status=1)

Offline

 

#11 2009-12-28 08:11:45

helsan
Member
Registered: 2009-12-20
Posts: 7

Re: 3XDNS_323 with 1XUPS

When issuing command LSUSB i get the following:

root@xxxxxxxxx:~# lsusb
Bus 002 Device 001: ID 0000:0000
Bus 001 Device 004: ID 051d:0002 American Power Conversion Uninterruptible Power Supply

And on my DNS-323 status page:
Manufacturer:       APC
Product:      Back-UPS ES 650 FW:818.w1.D USB FW:w1
Battery Charge:      N/A
Status :      N/A

Offline

 

#12 2009-12-28 13:13:07

rcblackwell
Member
From: Pickering, ON
Registered: 2008-05-19
Posts: 204
Website

Re: 3XDNS_323 with 1XUPS

helsan wrote:

When issuing command LSUSB i get the following:

root@xxxxxxxxx:~# lsusb
Bus 002 Device 001: ID 0000:0000
Bus 001 Device 004: ID 051d:0002 American Power Conversion Uninterruptible Power Supply

And on my DNS-323 status page:
Manufacturer:       APC
Product:      Back-UPS ES 650 FW:818.w1.D USB FW:w1
Battery Charge:      N/A
Status :      N/A

Which version of firmware are you running on the DNS323? If 1.06 or later then you'll need to disable built-in UPS support. I do that through a script that loads at startup;


############################################
# Stop built in NUT UPS deamons in preparation for starting ffp NUT UPS #
############################################
    if ps | grep /usr/local/ups/bin/usbhid-ups | grep -v grep
    then
        echo "* Stopping Default UPS Services"
        # Stop NUT Network Server
        /sys/crfs/sbin/upsd -c stop
   
        # Stop NUT driver for UPS hardware.
        /sys/crfs/sbin/upsdrvctl stop
    fi

sleep 2


Bob Blackwell
Pickering, ON

Offline

 

Board footer

Powered by PunBB
© Copyright 2002–2010 PunBB