07-11-2008
telnet problem
Hello everyone,
I have got this following script to telnet to other UNIX boxes from one UNIX box and then run a script to count a certain paramater. The following line connects to the other box(es):
(sleep 1; echo $username; sleep 1; echo $password ; sleep 1 ; echo y; sleep 1; echo "\r" ; sleep 1 ; echo `pwd` ; sleep 1 ; cd ./myworkdir ; echo `pwd` ; echo `./Count.sh` >> Count.csv ; echo `cat $count` ; sleep 15 |&)| telnet $SERVER > temp
The script in Count.sh is:
TotalCount=0
#For finding Today's total count
TotalCount=0
searchString="<LDATE>2008-07-03</LDATE>"
TotalCount=`find /DIR1/LOGDIR/* -name "*appLog*" -mtime -8 | xargs grep -hc $searchString | awk '{sum+=$1;}END{print sum}'`
echo "TodayTotalCount,$1",$TotalCount > ./Datafiles/ServerCount.csv
cd ./Datafiles
clear
cat ServerCount.csv
exit
Now what I want to do is get the data of all these servers and then collect them into one single file in the master box from where I am running these scripts.
I have tried it with:
echo `./Count.sh` >> Count.csv in the line where I am 'telnetting' to the other boxes but with no effect.
Any idea people?!
Thanks.
10 More Discussions You Might Find Interesting
1. UNIX for Dummies Questions & Answers
Good day to you all,
Hope you must doing good..me..oh no I am not..I've trying to log on to my network from home...but it's not letting me...I am trying to use telnet cis.hfcc.net but it's saying "connection to the host cannot to be established"????what is this...any good reason...do I have to... (2 Replies)
Discussion started by: tahaislam
2 Replies
2. Filesystems, Disks and Memory
Hello friends,
The problem is that we have one SunOS5.7 server, while attempting telnet to that server following error is occured -
ld.so.1: login: fatal: libc.so.1: open failed: Too many open files
The login on console is possible. The inetd daemon is running. inetd.conf and services... (1 Reply)
Discussion started by: rahul72
1 Replies
3. IP Networking
Hello friends,
The problem is that we have one SunOS5.7 server, while attempting telnet to that server following error is occured -
ld.so.1: login: fatal: libc.so.1: open failed: Too many open files
The login on console is possible. The inetd daemon is running. inetd.conf and services... (3 Replies)
Discussion started by: rahul72
3 Replies
4. HP-UX
Hi,
My network layout is:
Pub LAN
|
freeBSD
|
Internal LAN
|
+ telnet srv on HP-UX 10.x box
+ other services (http, pop3, smtp, ftp)...
I've the following problem:
Inside Internal LAN I can connect myself to HP-UX telnet but from Public LAN in some place is refusing me... (5 Replies)
Discussion started by: efrenba
5 Replies
5. AIX
hi all,
i have a problem in telnet.when i am using telnet to my new aix server it takes about 5min to open.
can any one tell what i have to do.???? (5 Replies)
Discussion started by: rrlog
5 Replies
6. Solaris
Dear All
I have a Sun280R server when i telnet to this server from my Laptop i got error :
Could connect to 192.168.199.10(Server IP):port 23 closed
I want to login to the server through its Db25 serial port but i used to connect to it from my laptop through USB to db9 then to Db25 so do... (1 Reply)
Discussion started by: zanetti321
1 Replies
7. UNIX for Dummies Questions & Answers
I have a problem where on one unix machine I can telnet all IP addresses in the host file with no connection problem and another machine has recently started to have trouble connecting with the same host IP's on just some IP addresses where it had no trouble before. Have any ideas?? (17 Replies)
Discussion started by: tazzy
17 Replies
8. Shell Programming and Scripting
Somewhat long story:
I have a simple Perl CGI script that uses Expect to Telnet to a device and grab some data, and then spits it back to Perl for display on the Webpage.
This works for many devices I've tried, but one device just fails, it keeps rejecting the password on this device, only... (1 Reply)
Discussion started by: jondo
1 Replies
9. Shell Programming and Scripting
#!/usr/bin/perl
use strict;
use warnings;
use Net::Telnet ();
my $t = new Net::Telnet (Timeout => 10,
Prompt => '/.*(#|>|\))\s*$/');
my $remote_host='home';
$t->open(Host => $remote_host, Port =>23);
$t->login('root', 'pass');
the error that I get... (4 Replies)
Discussion started by: lassimanji
4 Replies
10. Linux
ok, i need to test a list of addresses via telnet and make sure that i get a response like the following:
telnet anag.testboalo.com443
Trying 100.100.100.100...
Connected to anag.testboalo.com.
Escape character is '^]'.
The thing is, for each address I telnet to, the telnet hangs in... (4 Replies)
Discussion started by: SkySmart
4 Replies
LEARN ABOUT DEBIAN
sleepenh
SLEEPENH(1) General Commands Manual SLEEPENH(1)
NAME
sleepenh - an enhanced sleep program.
SYNOPSIS
sleepenh [initial-time] sleep-time
DESCRIPTION
sleepenh is a program that can be used when there is a need to execute some functions periodically in a shell script. It was not designed
to be accurate for a single sleep, but to be accurate in a sequence of consecutive sleeps.
After a successful execution, it returns to stdout the timestamp it finished running, that can be used as initial-time to a successive exe-
cution of sleepenh.
OPTIONS
There are no command line options. Run it without any option to get a brief help and version.
ARGUMENTS
sleep-time is a real number in seconds, with microseconds resolution (1 minute, 20 seconds and 123456 microseconds would be 80.123456).
initial-time is a real number in seconds, with microseconds resolution. This number is system dependent. In GNU/Linux systems, it is the
number of seconds since midnight 1970-01-01 GMT. Do not try to get a good value of initial-time. Use the value supplied by a previous exe-
cution of sleepenh.
If you don't specify initial-time, it is assumed the current-time.
EXIT STATUS
An exit status greater or equal to 10 means failure. Known exit status:
0 Success.
1 Success. There was no need to sleep. (means that initial-time + sleep-time was greater than current-time).
10 Failure. Missing command line arguments.
11 Failure. Did not receive SIGALRM.
12 Failure. Argument is not a number.
13 Failure. System error, could not get current time.
USAGE EXAMPLE
Suppose you need to send the char 'A' to the serial port ttyS0 every 4 seconds. This will do that:
#!/bin/sh
TIMESTAMP=`sleepenh 0`
while true; do
# send the byte to ttyS0
echo -n "A" > /dev/ttyS0;
# just print a nice message on screen
echo -n "I sent 'A' to ttyS0, time now is ";
sleepenh 0;
# wait the required time
TIMESTAMP=`sleepenh $TIMESTAMP 4.0`;
done
HINT
This program can be used to get the current time. Just execute:
sleepenh 0
BUGS
It is not accurate for a single sleep. Short sleep-times will also not be accurate.
SEE ALSO
date(1), sleep(1).
AUTHOR
This manual page was written by Pedro Zorzenon Neto.
2008/04/20 SLEEPENH(1)