Don't like ads? PRO users don't see any ads ;-)
Guest

Untitled

By: a guest on May 1st, 2012  |  syntax: None  |  size: 0.49 KB  |  hits: 25  |  expires: Never
download  |  raw  |  embed  |  report abuse  |  print
Text below is selected. Please press Ctrl+C to copy to your clipboard. (⌘+C on Mac)
  1. #!/usr/bin/perl -w
  2.  
  3. use strict;
  4. use warnings;
  5.  
  6.  
  7. #Used as a shortcut to connect to consoles.
  8.  
  9. print "What DC?\n";
  10. chomp($data_center = <STDIN>);
  11. $command = 'ssh console-'.$data_center.'.myhostname.com';
  12. system ($command);
  13.  
  14. #now to run consoletool on the connected host
  15.  
  16. #print "What is the hosts console IP?\n";
  17. #$ip_address = <STDIN>;
  18. #system (/usr/local/bin/consoletool $ip_address);
  19.  
  20. #if that fails then try this path
  21. #system (/usr/local/aes/cons-utils/consoletool $ip_address);