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

UPS support missing...

Okay,
first of all i'm a newbie, and the wonderful product called "ASL" [;)].
But...
...why there isn't UPS support in webadmin???

now, i'm thinking to a quick solution and i would know if is possible:
can we make a script (send by ssh) by a remote win machine that will login as root and "say" > before shutting down with its managed ups?
obviusly asl is connect at ups.
Win machine will lunch the script before shutting down thx to the ups manager software (in my case).

tia

Mario

ps: sorry for all grammatical errors, i'm italian and i don't speak english well... [:$]
pps: if is possible can you teach to me how to do this script?


This thread was automatically locked due to age.
Parents
  • ups support is not built into asl at all....
  • [ QUOTE ]
    ups support is not built into asl at all.... 

    [/ QUOTE ]

    okay,
    the way to bypass this problem (IMHO) is to have a machine (win, linux doesn't matter) with support for ups. when the batteries of ups goes low the machine will shutdown, but before shutdown it lunch a script (many ups monitorage software allow to run application or batch before shutting down). 
    This script must only login as root and say "shutdown -h now".
    The asl machine is also connecte to another ups (there are ups that give powewr until their batteries are empty) but we shutdown this machine before the batterie goes empty thx to the script.

    any suggestion??

    Mario
  • Look into using the "expect" language.. one of the guys at my work uses it a lot for working with Cisco routers...

    Here is a simple perl script, unable to test it right now as I dont want to shutdown my production firewall.. try it out if you can/want to...

    #!/usr/bin/perl -w
    use Expect;

    $expect_delay=120;
    $system_pass = "thisisthepassword";

    $login=Expect->spawn("ssh -l loginuser node.domain.com") or die "Can't start SSH: $! \n";
    $login->clear_accum();
    $match = $login->expect($expect_delay,"Password:");
    print $login "$system_pass\r";

    $login->clear_accum();
    $match = $login->expect($expect_delay,'$');
    print $login "shutdown -h now\r";

    END
  • You shouldn't need to use a script like that (not that it wouldn't work).

    You can tell most SSH clients to run a single command on login.
    # ssh
    Usage: ssh [options] host [command]

    Nonetheless, you probably don't need to worry too much about killing the power on ASL... it uses EXT3 which is resistant to filesystem corruption from things like that.
  • [ QUOTE ]
    You shouldn't need to use a script like that (not that it wouldn't work).

    You can tell most SSH clients to run a single command on login.
    # ssh
    Usage: ssh [options] host [command]

    Nonetheless, you probably don't need to worry too much about killing the power on ASL... it uses EXT3 which is resistant to filesystem corruption from things like that. 

    [/ QUOTE ]

    ok, thx a lot, this seem easier.
    but under M$ os how can i lunch this script??
    currently i'm using putty, do you know others clients that support scripts??
  • The simple solution is to just connect your Astaro box to a big UPS (I use an APC Smart-UPS 1400) and forget about it.

    Astaro is a router and firewall, not a file server, so shutting down the disk system before the power disappears is not that critical.
  • SecureCRT comes with a command-line program called vsh

    syntax is similar to openssh

    I'd imagine Putty has a command-line program as well.

    On windows, you'd need a UPS daemon that can run a windows command. I don't know of any offhand, but I don't use any so I wouldn't be one to ask.

    Barry
  • [ QUOTE ]
    SecureCRT comes with a command-line program called vsh

    syntax is similar to openssh

    I'd imagine Putty has a command-line program as well.

    On windows, you'd need a UPS daemon that can run a windows command. I don't know of any offhand, but I don't use any so I wouldn't be one to ask.

    Barry 

    [/ QUOTE ]

    you immage well!
    putty had "plink"  as command-line program but i can't create a script to automatically say:
    "su -" and the password.....
    any suggest??

    TIA

    mario
  • you shouldn't send passwords with expect scripts, there is secure method to do this by using keychain and ssh-agent, and sudoers at ASL that allows your user to execute shutdown is possible in one simple and secure script, offcourse if sudoers exists at ASL [:)]

    BTW: good articles about keyring and automated ssh logins can be found at IBM's developerworks
Reply
  • you shouldn't send passwords with expect scripts, there is secure method to do this by using keychain and ssh-agent, and sudoers at ASL that allows your user to execute shutdown is possible in one simple and secure script, offcourse if sudoers exists at ASL [:)]

    BTW: good articles about keyring and automated ssh logins can be found at IBM's developerworks
Children
  • [ QUOTE ]
    you shouldn't send passwords with expect scripts, there is secure method to do this by using keychain and ssh-agent, and sudoers at ASL that allows your user to execute shutdown is possible in one simple and secure script, offcourse if sudoers exists at ASL [:)]

    BTW: good articles about keyring and automated ssh logins can be found at IBM's developerworks 

    [/ QUOTE ]

    ok, keychain is only for linux
    ssh-agent only for macos
    any suggest for M$ [:(] os???
  • Velvetfog is right.
    ASL uses ext3 (journaling) as it's file system. It's not like pulling the plug in Windows95. Let it stay up as long as the UPS will run it then let it die. You want it to stay up as long as possible right? That's the way to do it.
    You want a graceful shutdown for things like file and database servers.
  • [ QUOTE ]

    ok, keychain is only for linux
    ssh-agent only for macos
    any suggest for M$ [:(] os??? 

    [/ QUOTE ]

    kaychain is bash script, I use ssh-agent in linux, there must be a way to automate ssh login from windows, look for diferent ssh clents for M$, maybe cygwin is solution...

    But leaving firewall to work until the end of UPS looks OK to me, as sad, make backups sometimes, but when you set it I dont expect many changes while it's working...