nixCraft Linux Forum

nixCraft

Linux Tech Support Forum

Script for checking uptime on multiple hosts

This is a discussion on Script for checking uptime on multiple hosts within the Shell scripting forums, part of the Development/Scripting category; Hi I want to check uptime on multiple hosts without putting passwords and generating ssh keys.. I have written below ...


Go Back   nixCraft Linux Forum > Development/Scripting > Shell scripting

Register FAQ Members List Calendar Forgotten your password? Mark Forums Read
  #1 (permalink)  
Old 08-12-2008, 09:24 PM
Junior Member
User
 
Join Date: Aug 2008
My distro: Redhat/ Fedora
Posts: 1
Rep Power: 0
madhusudany2k is on a distinguished road
Default Script for checking uptime on multiple hosts

Hi

I want to check uptime on multiple hosts without putting passwords and generating ssh keys..
I have written below script, But it asks for passwd..

can some on check

#!/bin/bash
#!/usr/bin/expect -f
set password “123″
SERVERS=”abc688 rgmgw1 abc173 abc30 abc101″
for host in $SERVERS
do
echo $host ; ssh -o StrictHostKeyChecking=no $host uptime
done
{
expect “Password:*”
send — “$password\r”
send — “\r”
expect eof
}


Thanks!
Regards
Madhusudan
Reply With Quote
Sponsored Links
Reply

Bookmarks


Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)

 
Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On

Similar Threads

Thread Thread Starter Forum Replies Last Post
multiple server status script marinm Linux software 21 10-24-2008 02:16 AM
Bash script for checking mysql processlist pinoyskull Shell scripting 1 08-12-2008 11:33 AM
script to rm files on multiple servers steve_f60 Shell scripting 1 06-21-2008 11:29 PM
login into multiple servers thru script... avcert1998 Shell scripting 2 03-17-2007 04:29 AM
Script to add users to multiple servers. deepakhg Shell scripting 0 03-17-2007 04:02 AM


All times are GMT +5.5. The time now is 04:41 PM.


Powered by vBulletin® Version 3.7.4 - Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
Search Engine Optimization by vBSEO 3.2.0

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36