in reply to Shuting down servers

Well, even with such minimal information there are directions we can pursue.

You need a transit mechanism to the remote hosts. Net::SSH::Perl is my favourite but YMMV. The 'shutdown_command' is merely a static variable so we can ignore that.

We need some form of single sign-on to the machines, I would recommend ssh-agent with keys loaded for a user that has sudo on the remote machines.

Then you'll need to code to grab sudo and run your commands.

Wrapped around all of this you'll need a flexible multi-machine connection engine that will handle inputs and returns and report back anomalies in a sane manner.

Is that enough to get you started ? :)

Replies are listed 'Best First'.
Re^2: Shuting down servers
by subhash_fire (Novice) on Mar 15, 2011 at 12:00 UTC
    Thanks Mr. Deorth. Let me try it and update you.