This discussion has been locked.
You can no longer post new replies to this discussion. If you have a question you can start a new discussion

Remote Shutdown Help Please

Hello All.

   I have been a happy user and beta tester of the ASG for a long time now and love it to bits [[:)]] 

  I have a question for you and need a bit of help.

I have three servers running in my rack. 2 windows 2003 servers and my ASG all running of a 3kva UPS. Both the 2003 boxes run a controled shutdown when a power outage lasts to long.

I want to know if there is a way using a script or command line switch that I can perform a remote full shutdown of the astaro box as aposed to it just shutting down suddenly when the power from the UPS fails. I cannot connect the ASG to the UPS as it has no usb interface.

Any help on this one would be very much appreciated [[:)]]

NB im not to hot on linux (waits for people reading to cry) [:D]


This thread was automatically locked due to age.
Parents
  • Hi,
    my understanding is if you have one of the supported UPS then power shutdown will work. The UPS I use is not on the supported list and the ASG doesn't even recognise that it exists.

    You will need to examine the HCL for the supported UPS types.

    Ian M
  • No I dont have a USB type UPS, its a symetra power aray UPS.

    I dont want to connect the UPS interface to the ASG, as it connects to my win2003 boxes, What I want to find out is if there is anyway using a script and the console/telnet to issue a shutdown command from the win2003 box to the ASG over the network.
  • From a root prompt you can issue a command like "shutdown -h now" to do a controlled shutdown, but you will need to login via ssh- so that means login as loginuser, then su to root, then issue the command.  I'm not sure what the best approach to scripting that would be.
  • From what I remember, the APC software can run a script when shutting down.

    I would write a simple script using Expect , to run ssh, except login, enter loginuser, expect password, enter password, expect the prompt, enter su -, expect password, enter password, expect prompt, enter shutdown -h now.
  • I think you will find this http://www.grape-info.com/doc/win2000srv/power/upsshutdown.html very helpful.

    Look at the remote linux shutdown part.

    Of course, modify the username to be loginuser, etc, but this is an excellent start for you.
  • Thanks red-man for that, its just what im looking for. Only problem is that teraterm does not support ssh only telnet.

    I have looked at loads and loads of terminal programs like putty ect but cant find one that will run a script/macro.

    Help [:(] 

    I get freqent power cuts here and my astaro box doesnt like being powered off when the ups's run out of juice.

    Really need some help on this one guys [[:)]]

    Any idea's ????

    Thanks [[:)]]
  • I found this

    I am wondering if I can create this user, or use the existing user account then SU to root and shutdown.

    As I said I can do this from an ssh console with now problems. The problem I have is automating/scripting it all.
  • Hi all.

      Have managed to automated a lot of this using plink and command lines. The problem is that I can SU from the script, It just wont let me [:(]

    Is there anyway to change the permisions so loginuser can have shutdown rights or if not why wont the ASG let me SU to root ?

    I am not 100% sure that my script file is correct anyway though I have tried many different commands in it.

    Would really like some help on this.

    Ta [:)]
  • Hi,

    plink is the tool to go for. I've made this with sudo. So you log on as a simple user with plink and are able to shutdown the machine.

    SuDo configuration isn't that difficult. If you need more infos, I'm back at the office on wednesday.

    Regards,
    Henrik
Reply
  • Hi,

    plink is the tool to go for. I've made this with sudo. So you log on as a simple user with plink and are able to shutdown the machine.

    SuDo configuration isn't that difficult. If you need more infos, I'm back at the office on wednesday.

    Regards,
    Henrik
Children
  • Ok guys. Thanks to this post I have solved the problem.

    After running the above command I have this command line in my shutdown batch file.

    plink.exe -ssh -batch loginuser@192.168.0.1 -pw password /sbin/shutdown -h now

    This shuts down the box perfectly.. And for reference. I have had my box refuse to boot after a suden powerdown, The interfaces just dont come up agian so to have this is a major relief. I believe its better to shut the box down properly contrary to the many threads of advice on here stating that a sudden powerdown does no harm... [:O]

    One question....... I understant that what I have done has changed shutdown permisions for loginuser. What happens after a firmware update on my ASG ? Is the change I have made perminent or will I have to run the command again.

    Many many many many thanks to all of you for your exelent help and to astaro for a briliant bit of kit [[:)]] [[:)]]
  • Any news on my question ?

    I am about to move the UPS I have so the ASG wont have a UPS. I am getting a little woried.
  • I think the sudo settings would survive most firmware up2dates... I wouldn't think they would tinker with any of that except when they release major versions.

    It might be a "cool" suggestion for Astaro to include a configurable network agent for APC UPS units (common here in the US, not sure what's used elsewhere--include the tools most commonly needed for Europe, etc. too)... that way no more tinkering needed.  I don't think APC would restrict the redistribution or inclusion of such an agent... it'd motivate users to buy their brand of UPS... not to mention most data centers I've been in here use APC units -- with the odd Liebert unit.
  • I agree 100%. Even a nice .exe that could be run from a server and authenticated via a key file or something like that.

    Curiosly I have £3000 worth of UPS units (APC) and all of them has rs232 interfaces. The only UPS's I have seen with USB are the cheap nasty 600VA models.

    Even if they do sort this powerdown problem I just dont like the idea of sudenly powering down and machine or server ! Its just not the right way to do it.

    It seems the be one of the few features that the ASG is not supporting properly. Could the APC linux client not be installed ? Or just give us a way to shutdown using a .exe file as above.

    Thanks for the info. Will have to remeber to check after the next firmware update that my batch file still works [:)]