Sponsored Content
Top Forums UNIX for Dummies Questions & Answers How to search using ssh on multiple hosts? Post 302898689 by SriniShoo on Wednesday 23rd of April 2014 10:39:01 AM
Old 04-23-2014
Sorry for the typo. Remove spaces before '!'
Code:
STRING='myipaddress.somehost.com'
DEST_PATH='/somedir/somedir/somedir'
old_IFS="${IFS}"
IFS="|"
echo 'myhost1.mycompany.com|myhost2.mycompany.com|myhost3.mycompany.com' | while read hname
do
  ssh -t -t ${hname} <<! > /log/dir/output.log
  grep ${STRING} ${DEST_PATH}/*
  exit
!
done

IFS="${old_IFS}

Also, please paste the entire myscript.sh file
 

10 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

How to setup SSH between 4 hosts ?

Hi, I logged into h0011awe server. I am executing a script on this server which connects to other 3 hosts (h0022sam, h0033jar, h0044orc). In the script the command are like this orapmon=`ssh $USR@$host ps -ef|grep -v grep|grep pmon` I am using secured shell. How to setup that between these... (2 Replies)
Discussion started by: dreams5617
2 Replies

2. AIX

/etc/hosts via ssh

Hi, I want to change the /etc/hosts file on the hmc. I am connecting via ssh but any vi command is not allowed. Can someone please let me know how to do this? Many Thanks. Kees (23 Replies)
Discussion started by: KeesH
23 Replies

3. Shell Programming and Scripting

Please advise on ssh to many hosts; su - and then commands

Hi, I would like to do ssh to many hosts and then would like to do 'su -' with respective host's passwords and execute certain commands. This being a secure and big network , we have to login every server individually and then su with different passwords. So is there a way to achive it? ... (2 Replies)
Discussion started by: newbewie
2 Replies

4. Red Hat

How to block ssh via /etc/hosts.deny

Hi.., I am using redhat5 server, i want to know the details about to block ssh via /etc/hosts.deny. Need help immediately (1 Reply)
Discussion started by: thakshina
1 Replies

5. OS X (Apple)

Multiple hosts SSH NO PASSWORD - each time it overrides the last key gen

Hello, here is my problem: I have 20 machines that need to SSH into 1 machine throughout the day. The issue is every time I go through the process of putting my keys from one of the computers that needs to SSH to the server that needs to accept all the incoming SSH's it overrides the last one. ... (6 Replies)
Discussion started by: yoyoyo777
6 Replies

6. Shell Programming and Scripting

ssh to multiple hosts and saving the output in the local host

hi I have a script to login from a host "A" to a list of hosts in a file and perform some commands inside it...its somethin like this for i in `cat file` do ssh -t $i " command1 ; command2; ..." done I wanna save the outputs in a file in the current host "A" i.e from where I am... (3 Replies)
Discussion started by: ningy
3 Replies

7. UNIX for Advanced & Expert Users

how to check if I'm allowed to ssh several hosts.

Hi guys! I'm working on a little script. I have a txtfile with several hosts, Unix team has copied my keys into several of those servers, but not all of them, I need to figure out which ones I don't have access to, (I want a list of servers I don't have access to, so I can request for it). This... (1 Reply)
Discussion started by: erick_tuk
1 Replies

8. Shell Programming and Scripting

Logon to multiple hosts using ssh hardcode password

Hi im trying to write a script to logon to list of servers with same userID. I have no option/plan to implement ssh-keygen sharing between the systems, so i have written script creating 2 files, file1 holds list of hosts host1 host2 host3 file2 has following script for i in `cat file1`... (1 Reply)
Discussion started by: dreamaix
1 Replies

9. Shell Programming and Scripting

Ssh to multiple hosts and then run multiple for loops under remote session

Hello, I am trying to login to multiple servers and i have to run multiple loops to gather some details..Could you please help me out. I am specifically facing issues while running for loops. I have to run multiple for loops in else condition. but the below code is giving errors in for... (2 Replies)
Discussion started by: mohit_vardhani
2 Replies

10. Shell Programming and Scripting

Ssh to validate multiple remote hosts connection validation.

Dear Folks, I am trying to read a config file contains ip and port numbers. i want to read each line of the config file and check ssh connection is happening or not. Kindly guide. Config file: abc@1.2.342 22 abc@1.2.343 22 abc@1.2.344 22 abc@1.2.345 22... (9 Replies)
Discussion started by: sadique.manzar
9 Replies
HOBBIT-HOSTGRAPHS.CGI(1)				      General Commands Manual					  HOBBIT-HOSTGRAPHS.CGI(1)

NAME
hobbit-hostgraphs.cgi - CGI program to show multiple graphs SYNOPSIS
hobbit-hostgraph.cgi DESCRIPTION
hobbit-hostgraph.cgi is invoked as a CGI script via the hobbit-hostgraph.sh CGI wrapper. If no parameters are provided when invoked, it will present a form where the user can select a time period, one or more hosts, and a set of graphs. The parameters selected by the user are passed to a second invocation of hobbit-hostgraph.cgi, and result in a webpage showing a list of graph images based on the trend data stored about the hosts. If multiple graph-types are selected, hobbit-hostgraph.cgi will display a list of graphs, with one graph per type. If multiple hosts are selected, hobbit-hostgraph.cgi will attempt to display a multi-host graph for each type where the graphs for all hosts are overlayed in a single image, allowing for easy comparison of the hosts. The hostlist uses the PAGEPATH cookie provided by Xymon webpages to select the list of hosts to present. Only the hosts visible on the page where hobbit-hostgraph.cgi is invoked from will be visible. The resulting graph page can be bookmarked, but the bookmark also fixates the time period shown. OPTIONS
--env=FILENAME Loads the environment defined in FILENAME before executing the CGI script. BUGS
This utility is experimental. It may change in a future release of Xymon. It is possible for the user to select graphs which do not exist. This results in broken image links. The set of graph-types is fixed in the server/web/hostgraphs_form template and does not adjust to which graphs are available. If the tool is invoked directly, all hosts defined in Xymon will be listed. SEE ALSO
bb-hosts(5), hobbitserver.cfg(5) Xymon Version 4.2.3: 4 Feb 2009 HOBBIT-HOSTGRAPHS.CGI(1)
All times are GMT -4. The time now is 10:48 AM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy