Sponsored Content
Top Forums Shell Programming and Scripting running commands to remote host from centralized host Post 302345071 by anjum.suri on Tuesday 18th of August 2009 10:55:26 AM
Old 08-18-2009
Thanks...few things to clear; we do need password to connect to remote hosts from this centralized server.....

I have changed things a bit; I have managed to ssh <sever1> and run the script located on the remote server (i.e. server1); but output of the script is needed to send back to the centralized server; the script is below that I am planing to run on each server.....

how can I send output of below script back to centralized server in a file; and i need that file mailed to me?


--Script to connect to remote servers from centeralized host
while read H; do ssh $H /ora/rman/scripts/bk1.sh 'BEGIN{printf "%s\n%s\n","'"$H"'","========"}NR>1{printf "%s\t%s\n",$1,$5}END{printf "\n"}';done < /export/h
ome/oracle/servers.lst > out.txt

File servers.lst contains

server1
server2

But I think its only working for server1

--The script will go to the archivelog directory and check for successful and failed archivelog backups (each server hosts many databases)

chkbck ()
{
for i in `ls /ora/rman/logs/`;
do
find /ora/rman/logs/$i/backup_a*.log -mtime -1 2>/dev/null
done
}

for i in `chkbck`;
do
print $i | cut -d"_" -f3
print $i
grep Exit $i

if egrep -i 'exit status 1' $i
then
print $i
fi

done
 

10 More Discussions You Might Find Interesting

1. IP Networking

QNX host cannot ping SCO host, vice versa

The problem I am facing now is that the QNX host could not ping the SCO host and vice versa. They are in the same domain, ie, 172.20.3.xx. As I am very new to Unix, I guess I must have missed out some important steps. Pls help... Thanx alot (2 Replies)
Discussion started by: gavon
2 Replies

2. Solaris

How to delete the files from local host to remote host

Hi all, i am copying .gz files from production server to development server using "scp" command.my requirement is after copying .gz files i want to delete old .gz files(two days back) in development server from production server. like this way i need to delelte .log ,.z and .dmp files... (3 Replies)
Discussion started by: krishna176
3 Replies

3. UNIX for Dummies Questions & Answers

Sending Commands to a Remote Host

I am trying to write a script that logs into an SMTP server and authenticates as a user or verifies that a user exists. I can do all this from the command line but I don't know how to write a script to do this for me, I login and then the script stops, I'm sure this is some basic principle. ... (3 Replies)
Discussion started by: safetytrick
3 Replies

4. UNIX for Advanced & Expert Users

Running command "md5" on remote host not working.

My question is very strange. I can run ls command on remote host using ssh successfully. but when i try to run /sbin/md5 command on remote host. it doesnt run and get back to me on command prompt. md5 command is exist on remote host. This is what i tried which ran successfully. Query -... (1 Reply)
Discussion started by: ynilesh
1 Replies

5. Shell Programming and Scripting

Run a shell script from one host which connext to remote host and run the commands

I want to write a script which would run from one host say A and connect to other remote host B and then run rest of commands in that host. I tried connecting from A host to B with SSH but after connecting to host B it just getting me inside Host B command prompt. Rest of the script is not running... (6 Replies)
Discussion started by: SN2009
6 Replies

6. UNIX for Advanced & Expert Users

Help! How to find the local host after few ssh hops to remote host???

I do a ssh to remote host(A1) from local host(L1). I then ssh to another remote(A2) from A1. When I do a who -m from A2, I see the "connected from" as "A1". => who -m userid pts/2 2010-03-27 08:47 (A1) I want to identify who is the local host who initiated the connection to... (3 Replies)
Discussion started by: gomes1333
3 Replies

7. Solaris

Need to recover/move diskgroup from failed host to another host

Hi All I am having VxVm on two Solaris hosts. host1 is using disk group dgHR. right now this server went down due to hardware fault. Not I need to import this dgHR into host2 server. Please let me know the procedure for the same. (1 Reply)
Discussion started by: amity
1 Replies

8. Shell Programming and Scripting

Login to remote host and execute commands

Hi, i want to write script where it will login into 50 hosts and if login is successful it print message "login to host1 is successful" if not it should print message "Not able to login to host1". once connection to the host is succesful it should fire df command to check filesystem if df is... (3 Replies)
Discussion started by: amru8810
3 Replies

9. Shell Programming and Scripting

Pause processes in remote host and resume execution in another remote host

Hi, Given addresses of 2 remote machines, using a shell script is it possible to get the state of running processes in "src" stop all the processes in "src" exit out of "src" ssh into "dest" resume the state of executing processes captured in step 1 in "dest" Assumption: "src" is... (3 Replies)
Discussion started by: Saeya Darsan
3 Replies

10. Shell Programming and Scripting

Check/get the exit status of a remote command executed on remote host through script

Geeks, Could you please help me out in my script and identify the missing piece. I need to check/get the exit status of a remote command executed on remote host through script and send out an email when process/processes is/are not running on any/all server(s). Here's the complete... (5 Replies)
Discussion started by: lovesaikrishna
5 Replies
asadmin-delete-instance(1AS)					   User Commands				      asadmin-delete-instance(1AS)

NAME
delete-instance - deletes the instance that is not running. SYNOPSIS
delete-instance [--user admin_user] [--password admin_password] [--host localhost] [--port 4848] [--local=false] [--domain domain_name] [--passwordfile filename] [--secure|-s]instance_name Use the delete-instance command to delete the instance that you specify. The delete-instance command can be run both locally and remotely. To delete the instance locally, not requiring the administration server to be up and running, specify the --local option. To delete the instance remotely, the administration server must be running on the hostname and port number specified. The user authenticates using the password identified for the administration server. Additionally, the instance must already exist within the domain served by the adminis- tration server. Use this command with discretion since it is destructive and there is no undo. OPTIONS
--user administrative user associated for the instance. --password administrative password corresponding to the administrative user. --host host name of the machine hosting the administrative instance. --port administrative port number associated with the administrative host. --domain name of the domain. --local determines if the command should delegate the request to administrative instance or run locally. --passwordfile file containing passwords appropriate for the command (e.g., administrative instance). --secure if true, SSL/TLS to communicate with the administrative instance. OPERANDS
instance_name name of the instance to be deleted. Example 1: Using delete-instance in local mode asadmin> delete-instance --domain domain1 server1 Deleted Instance server1 successfully Where: the server1 instance for the domain1 domain is deleted on the local machine. Example 2: Using delete-instance in remote mode asadmin> delete-instance --user admin --passwordfile passwords.txt --host localhost --port 4848 server1 Deleted Instance server1 successfully Where: the server1 instance for the domain associated with the specified user, passwords in the password file, host, and port number is deleted on the remote machine. EXIT STATUS
0 command executed successfully 1 error in executing the command INTERFACE EQUIVALENT
Server Instance page asadmin-create-instance(1AS), asadmin-start-instance(1AS), asadmin-stop-instance(1AS), asadmin-restart-instance(1AS) J2EE 1.4 SDK March 2004 asadmin-delete-instance(1AS)
All times are GMT -4. The time now is 10:38 AM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy