Re: Script to Shutdown AIX
I'd have someone write this for me!
Seriously you would need to create a cronjob that executes the script
like once a (how long can the UPS power both servers?)
minute? you would use the crontab command to edit the crontab --- read
the man page on crontab.
The kornshell script could do a ls -l /directory/filename then
evaluate the return code -- if it returns a 0 that might mean that no
file was found
(I do not know how to evaluate return code) after it discovers the
file it executes /usr/sbin/shutdown
This would be a 4-7 line script.
though reading through documentation its appears that the rc.powerfail
notices a lose of AC power and shuts down the system
here is the documentation that I was reading
[url]http://publib.boulder.ibm.com/infocenter/systems/index.jsp?topic=/com.ibm.aix.cmds/doc/aixcmds4/rc.powerfail.htm[/url]
If this is an AIX 5.3 system then you should be able to call AIX
Supportline to confirm
Re: Script to Shutdown AIX
This command will check for a file
if [[ -a /directory/filename ]]
so you would include it in a script
if [[ -a /directory/filename ]]
then
shutdown -F
done
else
whatever you may want to do if there is no file
fi
You may want to get a scripting book if you are going to be resonsible
for this server.
Kornshell Programming Tutorial by Barry Rosenberg is a good one for
beginners.
It teaches pretty much by example.
Re: Script to Shutdown AIX
Thanks alot guys...I do know someone who can help with the coding, I
am just trying to get all the research done for them so they know what
to write!
Re: Script to Shutdown AIX
On Sep 19, 6:19 am, rminni...@hotmail.com wrote:[color=blue]
> Thanks alot guys...I do know someone who can help with the coding, I
> am just trying to get all the research done for them so they know what
> to write![/color]
FTP is evil. Involves leaving passwords for the root user lying around
and ports sniffers see clear text passwords; root user in this case.
You need to use SSH keys, and a locked down user that uses sudo and
the shutdown command. sudo is your friend for allowing specific root
permissions for users and commands. It's free to download the AIX
version from IBM.
[url]http://www-03.ibm.com/systems/p/os/aix/linux/download.html[/url]
so, first thing, make sure you have SSH installed on both your Windows
and AIX environments, and sudo installed on AIX.
you then need to create a SSH Type-2 (DSA) key
there is plenty of information on the Net about sudo, SSH keys and how
to create a secure way for remote executions using a SSH key that only
allows the shutdown from a specific IP address and a Shell wrapper for
the sudo permissions
Scripting should be unnecessary but good documentation means those who
follow after you won't come hunting for your with sharp objects.
This won't be quick and dirty to do right.
Re: Script to Shutdown AIX
On Tue, 18 Sep 2007 07:59:52 -0700, rminnis82 wrote:
[color=blue]
> I have inherited an IBM AIX RS/6000 with AIX v5.3. It is connected to a
> network with a Windows Server and both are powered by an APC UPS. I
> connected the UPS to the Windows Server via the serial cable have
> installed the free PowerChute Business Edition on the Windows Server
> (easier to remotely administer PowerChute via the server than the AIX
> machine).
>
> If there is a power cut, I intend to have PowerChute run a batch file on
> the Windows Server that FTP's a file to the AIX machine. When this file is
> detected on the AIX machine, I want it to initiate a shutdown.
>
> The bit I am stuck on is how to set up the program/task on the AIX machine
> to detect the FTP'ed file from the Windows Server and what commands to
> write to tell the AIX to shutdown.
>
> Is this the best way to go about this?
>
> I have read lots of other posts and found rc.powerfail and shutdown files
> in etc/ directory but am slightly unsure how to call them...is it better
> to use these files instead of my own?[/color]
It may be a silly question, but why not buy a copy of PowerChute for AIX?
Or, does the version on Windows not broadcast a shutdown message on the
network?
[url]http://www.apcc.com/support/compliance_table.cfm[/url]
They seem to make it for a whole lot of different operating systems... :-)
-Chris
Re: Script to Shutdown AIX
[email]rminnis82@hotmail.com[/email] wrote:[color=blue]
> [snip]
> The bit I am stuck on is how to set up the program/task on the AIX
> machine to detect the FTP'ed file from the Windows Server and what
> commands to write to tell the AIX to shutdown.
>
> Is this the best way to go about this?
>
> I have read lots of other posts and found rc.powerfail and shutdown
> files in etc/ directory but am slightly unsure how to call them...is
> it better to use these files instead of my own?[/color]
Can the WIndows machine kick something off on the AIX machine via RSHELL?
--
David J Dachtera
dba DJE Systems
[url]http://www.djesys.com/[/url]
Unofficial OpenVMS Marketing Home Page
[url]http://www.djesys.com/vms/market/[/url]
Unofficial Affordable OpenVMS Home Page:
[url]http://www.djesys.com/vms/soho/[/url]
Unofficial OpenVMS-IA32 Home Page:
[url]http://www.djesys.com/vms/ia32/[/url]
Unofficial OpenVMS Hobbyist Support Page:
[url]http://www.djesys.com/vms/support/[/url]
Re: Script to Shutdown AIX
[color=blue]
> Can the WIndows machine kick something off on the AIX machine via RSHELL?[/color]
Yes, you can but many will tell you (including me) that r commands
aren't secure and can be circumvented easily.
Especially in that type of setup.
You'll have to be careful of the ip address the windows box has and
what is being resolved in DNS / local host table on the AIX side to
make this work consistently with a .rhosts file.
We setup cygwin with ssh key authentication access on the windows box
so we can run commands the other way around (aix to windows).
Of course that could be setup to do windows to aix as well.
Re: Script to Shutdown AIX
Scottz wrote:[color=blue]
>[color=green]
> > Can the WIndows machine kick something off on the AIX machine via RSHELL?[/color]
>
> Yes, you can but many will tell you (including me) that r commands
> aren't secure and can be circumvented easily.
> Especially in that type of setup.
>
> You'll have to be careful of the ip address the windows box has and
> what is being resolved in DNS / local host table on the AIX side to
> make this work consistently with a .rhosts file.[/color]
I've been doing that (VMS <-> Solaris, actually) in my production backups for
four-plus years. (BAckup target is StorageTek's L700e library controlled by
ACSLS.) Everything is static addressed; so, once DNS is set, it stays set (until
the usual dinking around messes things up, but that's rare in our shop - these
guys are fairly decent).
I also tried Windows RSHELL and RCP to/from both VMS and Solaris. Got that to
work o.k., but the application functionality (NetWorker Server and CLARiiON Disk
Library (FalconStor)) came up short in the end - couldn't do what we needed.
The auditors, security folks, etc. haven't demanded encryption inside the
firewall yet (but it's probably on someone's roadmap). So, haven't played much
with S-services, SSL, etc.
[color=blue]
> We setup cygwin with ssh key authentication access on the windows box
> so we can run commands the other way around (aix to windows).
> Of course that could be setup to do windows to aix as well.[/color]
Yeah - WhineBloze has enough security issues without exposing the rest of the
world to them by shipping UN*X servers/services with WhineBloze.
--
David J Dachtera
dba DJE Systems
[url]http://www.djesys.com/[/url]
Unofficial OpenVMS Marketing Home Page
[url]http://www.djesys.com/vms/market/[/url]
Unofficial Affordable OpenVMS Home Page:
[url]http://www.djesys.com/vms/soho/[/url]
Unofficial OpenVMS-IA32 Home Page:
[url]http://www.djesys.com/vms/ia32/[/url]
Unofficial OpenVMS Hobbyist Support Page:
[url]http://www.djesys.com/vms/support/[/url]