02-22-2007
Checking for availability of remote server
Hi. In my KSH script I'm running a command on a remote server. I want to know how I can test to see if the remote server is available (accessible) prior to running the command. Any ideas?
My command looks like:
`ssh $USER@$TARGET_SERVER_DNS ls -l $REMOTE_FOLDER `
This check should be generic enough to handle the following cases:
- server not available (network problem)
- server DNS name not found
- invalid user name, user doesn't exist on the remote server
- remote folder path doesn't exist
- etc
I just need for the SSH command to return a true/false indicating success or failure, that's it.
One inportant point: PING is disabled in my environment.
10 More Discussions You Might Find Interesting
1. Shell Programming and Scripting
Hi. In my KSH script I'm running a command on a remote server. I want to know how I can test to see if the remote server is available (accessible) prior to running the command. Any ideas?
My command looks like:
`ssh $USER@$TARGET_SERVER_DNS ls -l $REMOTE_FOLDER `
This check should be... (4 Replies)
Discussion started by: dylanmilks
4 Replies
2. Shell Programming and Scripting
Hi Guru's,
I need to check the availability of a web page for every one hour through a script. Following is the requirement.
1. Go to http://vsn.srivsn.com
2. If any error encountered in openeing the home page, it should trigger an email with the appropriate error message.
3. If page opens... (6 Replies)
Discussion started by: srivsn
6 Replies
3. Solaris
Hi Everyone!
This is what I need to do...
I am deploying some directories over to a windows server 2000/3 box from my solaris10 box and I need to make sure the directories exist.
The only form of connection I have to work with is SSH
Currently, my script deploys the directories over... (13 Replies)
Discussion started by: Keepcase
13 Replies
4. Shell Programming and Scripting
Hello, I would appreciate if any one can help me on this.
The below script start running at 12:30AM. Every 5 min, i go and check the remote site. If i see filewatch.txt over there, then i need to call another shell script and load the data into database. If i don't see that file, then i have to... (2 Replies)
Discussion started by: govindts
2 Replies
5. Shell Programming and Scripting
HI CAN ANY ONE HELP ME FOR BELOW QUESTION
CHECKING AVAILABILITY OF SERVICE IN LINUX (2 Replies)
Discussion started by: satheeshkr_cse
2 Replies
6. Shell Programming and Scripting
Hi,
I want my script to check for availability of few files contineously for some time.
Lets say from 10:00 AM to 10:30 AM script should keep checking on a particular location for each file one by one. If all the files are available then only it should complete the next processing part, else... (2 Replies)
Discussion started by: amit.mathur08
2 Replies
7. UNIX for Dummies Questions & Answers
Hi there,
I have a problem in my script,
I need to check whether file exists in remote server or not,
if the file exists, then stop copy
else copy the file to the server..
my code is something like this
while read $server
do
if ssh $server "cd $directory_name; if ; then echo "Error:... (2 Replies)
Discussion started by: beezy
2 Replies
8. Shell Programming and Scripting
Hello everybody. I have a little question. Im creating a script for checking the status of different servers, and everything is running fine except for one thing. I have to check if certain DBs are connectables, I dont care anything else, nor running querys nor updating tables, the only thing I... (4 Replies)
Discussion started by: SeaSoul
4 Replies
9. Shell Programming and Scripting
I am getting a file (abc.txt) using scp from remote server.
scp <connect string> -i $HOME/.ssh/id_dsa rem_id@hostname:/var/prod/abc.txt /var/prod/abc.out
Before loading I need to check if the file is indeed same , for that I thought of checking the line count but when I used ssh command it was... (3 Replies)
Discussion started by: lalitpct
3 Replies
10. Shell Programming and Scripting
I have a script, which connecting to remote server and first checks, if the files are there by timestamp. If not I want the script exit without error. Below is a code
TARFILE=${NAME}.tar
TARGZFILE=${NAME}.tar.gz
ssh ${DESTSERVNAME} 'cd /export/home/iciprod/download/let/monthly;... (3 Replies)
Discussion started by: digioleg54
3 Replies
LEARN ABOUT SUNOS
asadmin-list-instances
asadmin-list-instances(1AS) User Commands asadmin-list-instances(1AS)
NAME
asadmin-list-instances, list-instances - lists all the instances in the server
SYNOPSIS
list-instances [--user admin_user] [--password admin_password] [--host localhost] [--port 4848] [--domain domain_name] [--local=false]
[--passwordfile filename] [--secure|-s]
Use the list-instances to list all the instance in the server. The list-instances command can be run both locally and remotely. To list
remote instances, the named administration server must be running on the hostname and port number specified. The user authenticates using
the password identified for the administration server.
OPTIONS
--user administrative user associated for the instanace.
--password administrative password corresponding to the administrative user.
--host host name of the machine hosting the administrative instance.
--port 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, uses SSL/TLS to communicate with the administrative instance.
Example 1: Using list-instances in local mode
asadmin> list-instances --domain1 --local
admin-server running
server1 running
Where: the server1 and admin-server instances for the domain1 domain is listed.
Example 2: Using list-instances in remote mode
asadmin> list-instances --user admin --passwordfile passwords.txt --host localhost --port 4848
server1 [mayank:80] running
Where: the server1 instance associated with the specified user, passwords, host, and port number specified is listed for the remote
machine.
EXIT STATUS
0 command executed successfully
1 error in executing the command
INTERFACE EQUIVALENT
Server Instance page
asadmin-show-instance-status(1AS)
J2EE 1.4 SDK March 2004 asadmin-list-instances(1AS)