Shutdown all systems remotely


 
Thread Tools Search this Thread
Homework and Emergencies Emergency UNIX and Linux Support Shutdown all systems remotely
# 1  
Old 02-03-2010
Question Shutdown all systems remotely

Hi,
I am a sysadmin. During long weekends i need to turn off all machines in my lab. Is it possible to shutdown systems using ip address without using ssh.

i read somewhere that shutdown -m "IPADDR" may work. However it seems its a windows specific command.

So my question is how do i remotely shutdown all machine in my LAN using their IP address.
# 2  
Old 02-03-2010
just write a script that does the shutdown for you...
# 3  
Old 02-03-2010
How do i write that script? Writing a script that ssh to each system will be very tedious as i ll have to first create public key pair for around 100 systems. Is there a easier/simpler way to do this?
# 4  
Old 02-03-2010
Yes. Create 1 key-pair & copy it to all 100 systems. You don't necessarily need a different one for every system.
# 5  
Old 02-03-2010
or use "expect" to spawn a ssh session and send the password to the servers...
# 6  
Old 02-03-2010
Their solutions were "push" solutions. You could do a "pull" solution: Write a cronjob to run every minute (or 15 minutes, or whatever); it uses curl to check a web page on your server; if the file exists, the cron job initiates a local shutdown.
Code:
  if curl -s -i -I http://my.server.ip:port/power-off-`date +%F` | head -1 | grep " 200 OK" >/dev/null ; then 
        shutdown -h now
  fi

On the server, simply run a web server and point the document root somewhere you can write to, and when you want the systems to shut down, simply cd into the web server's document root directory and do:
Code:
   touch power-off-`date +%F`

The date makes sure the systems dont power off at startup the following day.

If you want to make it secure, generate a self-signed SSL key and distribute the cert to all the hosts.
# 7  
Old 02-03-2010
Remote commands

I manage 248 servers and use pludi's method. Makes pushing out updates much easier too Smilie
Login or Register to Ask a Question

Previous Thread | Next Thread

10 More Discussions You Might Find Interesting

1. Solaris

SSH Remotely

Hello. I am trying to ssh and run a script from a remote computer. These computers will be both Windows and MACs. I am using Solaris 8 and what I have tried is: using putty ssh user@ip_address (remote command) /folder/folder/filename.sh The issue here is that the user profile has not... (3 Replies)
Discussion started by: jkmtm
3 Replies

2. What is on Your Mind?

From Systems Admin to Systems Eng.

I have been wondering how do Systems Administrators do the jump into Systems Engineering? Is it only a matter of time and experience or could I actually help myself get there? Opinions? Books I could read? Thanks a lot for your help! (0 Replies)
Discussion started by: svalenciatech
0 Replies

3. UNIX for Dummies Questions & Answers

Script to force Oracle database shutdown when shutdown immediate does not work

I have Oracle 9i R2 on AIX 5.2. My Database is running in shared server mode (MTS). Sometimes when I shutdown the database it shutsdown cleanly in 4-5 mints and sometimes it takes good 15-20 minutes and then I get some ora-600 errors and only way to shutdown is by opening another session and... (7 Replies)
Discussion started by: aixhp
7 Replies

4. Shell Programming and Scripting

using awk remotely

Hi there I am trying to add up the disk space used on a remote linux box but am falling at the first hurdle i.e isolating the 'space used' column with df -k on the remote box if i run this, i get the df -k output as expected # rsh remote-server 'df -k|grep sd|grep -v boot' /dev/sda3 ... (8 Replies)
Discussion started by: hcclnoodles
8 Replies

5. Shell Programming and Scripting

Untar remotely

I need to upload tar or zip files to a unix server than unzip or untar them remotely. Any suggestions on the easiest way to do the remote untar or unzip? For example does someone know of a cgi script or something? Thanks -jz (3 Replies)
Discussion started by: jwzumwalt
3 Replies

6. Shell Programming and Scripting

Executing remotely the script

Hi All, I have a script to be executed in another machine. I connect to that machine from another server as a root ( this is the only configured access, as i cannot log in as a normal user). After that I have to switch to a normal user and that I can be able to executge that script. But all this... (12 Replies)
Discussion started by: elthox
12 Replies

7. Shell Programming and Scripting

get process information remotely

Hello, We have a domain where instances attached to it are in multiple machines. Is there any way that I can get the process information of the domain of a secondary server from the primary. ssh authentication is enabled on the functional ID and if I scsu to that ID and do the ssh: $ssh machine2... (0 Replies)
Discussion started by: chiru_h
0 Replies

8. Shell Programming and Scripting

if statement remotely

I need to rsh to many machines and run an " if statement' that checks the versions of the OS and if up to date it tee -a to a file called "uptodate"..then if not update, it tee -a to file called "notuptodate" on my machine the command that checks the version is cat /etc/version. now the output... (1 Reply)
Discussion started by: dxrmroue
1 Replies

9. UNIX for Advanced & Expert Users

Using CD drive remotely !

hi, could anyone tell me that how can i use a remote CD drive for installing solaris , cause my local Drive has peroblem. tell me the steps one by one. Rgrds, nikk:confused: (6 Replies)
Discussion started by: nikk
6 Replies

10. UNIX for Dummies Questions & Answers

Remotely login to one from another?

NT CONSULTANT IS NEAR TOTAL UNIX NEWBIE! Please help! I would like detailed info about how to remotely connect a PC running win'98 that is not on a local network to a unix server which is locally networked to other PCs? Would like to know how to: Move files back and forth? Mount... (2 Replies)
Discussion started by: Kagor
2 Replies
Login or Register to Ask a Question