Sponsored Content
Top Forums Shell Programming and Scripting Want to remove telnet error/info from screen Post 302844817 by Raza Ali on Tuesday 20th of August 2013 05:51:06 AM
Old 08-20-2013
Want to remove telnet error/info from screen

Hi Team,

I am using one script, It is working fine, the problem is it gives unwanted telnet errors when I am using it.
I just want to remove these unwanted errors/info from my screen.

Code:
bash-3.00$ cat raza_site_temp
#!/usr/bin/bash
#rj835b
IFS="|"
REGEX="$*"
echo
snarf2 -c "show chassis status" `showHosts gsx |egrep "$REGEX"` > /dev/null > d1d1
echo
cat d1d1 |egrep -i "Node|Temp"|sed '/Node/{x;p;x;}'
echo
echo
echo "GSX Temperature > 30C"
echo "*********************"
echo
cat d1d1|egrep "Node|Temp"|awk '{if ($1~/Node:/) print $1,$2; else if ($1~/Temperature/) print $0}'|sed '$!N;s/\n/ /'|awk '{if (substr($4,1,2)>30) print $2,"----->", $4}'|awk '{printf "%-10s %s %s\n", $1,$2,$3}'
echo
bash-3.00$

Output of the script

Code:
bash-3.00$ ./raza_site_temp hst

Enter GSX Login: Enter GSX Password: telnet: Unable to connect to remote host: Connection refused
Connection to 10.24.63.67 closed by foreign host.
Connection to 10.24.63.68 closed by foreign host.
telnet: Unable to connect to remote host: Connection refused
Connection to 10.24.63.70 closed by foreign host.
telnet: Unable to connect to remote host: Connection refused
Connection to 10.24.63.72 closed by foreign host.
telnet: Unable to connect to remote host: Connection refused
Connection to 10.24.63.74 closed by foreign host.
telnet: Unable to connect to remote host: Connection refused
Connection to 10.24.63.98 closed by foreign host.
telnet: Unable to connect to remote host: Connection refused


Node: hstg1so                                  Date: 2013/08/20 09:35:31  GMT
Temperature:   25C

Node: hstg2so                                  Date: 2013/08/20 09:35:39  GMT
Temperature:   26C

Node: hstg3so                                  Date: 2013/08/20 09:35:48  GMT
Temperature:   24C

Node: hstg4so                                  Date: 2013/08/20 09:35:55  GMT
Temperature:   25C

Node: hstg5so                                  Date: 2013/08/20 09:36:03  GMT
Temperature:   25C

Node: hstg6so                                  Date: 2013/08/20 09:36:11  GMT
Temperature:   25C


GSX Temperature > 30C
*********************


bash-3.00$

When I fire script it will ask for password, then it will fetch data from different node, error coming from redundant ports.
I jus want these telnet and connection refused error does not appear on my screen.

Thanks
Raza
 

9 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

Telnet and get info

Hello all, probably this is a very stupid question but I'm a beginner in the arts of scripting... :confused: I'm trying to do a script that logs in to several equipments, switchs etc, and make them show their version and save all the output to a file. I managed to do the login,... (6 Replies)
Discussion started by: pmpx
6 Replies

2. OS X (Apple)

Please look at this screen shot: How do I remove this lock icon?!

RESOLVED in the screen shot I'd like to remove the lock sandwiched between the spaces indicator and the monitor icon, how do I get rid of it? It locks the screen and I cannot remember how it came to be http://guptaxpn.com/tmp/lock_icon_screenshot.png Thanks for your help! (3 Replies)
Discussion started by: guptaxpn
3 Replies

3. Shell Programming and Scripting

Grabbing info from Telnet

I have a process that is running locally on the machine. When you telnet to the process: telnet IP port, it automatically returns a string which shows the status of that process. Something like this: # telnet IP Port Trying 127.0.0.1... Connected to localhost (127.0.0.1). Escape... (3 Replies)
Discussion started by: skaptakalian
3 Replies

4. UNIX for Dummies Questions & Answers

Automatic logging (capture screen output) of telnet/ssh sessions on a Solaris node

Hi I am working in Solaris 10 and I want to monitor logs for every telnet/ssh session that tries to connect to the server. I need these logs to be generated in a file that I can fetch using ftp. I am a new user and a stepwise detail will be great BR saGGee (3 Replies)
Discussion started by: saggee
3 Replies

5. Shell Programming and Scripting

Run a bash script, display on the screen and save all information in a file including error info

Hi all, How to: Run a bash script, display on the screen and save all information in a file including error information. For example: I have a bash script called test.sh now I want to run the test.sh and display the output on the screen and save the output including error info to a file. ... (1 Reply)
Discussion started by: Damon sine
1 Replies

6. Shell Programming and Scripting

Execution Problems with Remove Duplicate Info

Input file data_1 american 100 data_1 US 1000 data_1 australia 50 data_2 american 90 data_3 singapore 4 data_3 thailand 50 . . Desired output result data_1 american 100 US 1000 australia 50 data_2 american 90 data_3 singapore 4 thailand 50 (2 Replies)
Discussion started by: perl_beginner
2 Replies

7. AIX

xp to aix - telnet blank screen

hello, i am trying to test connection to a 5.3 box. from an xp machine, telnet connects but shows only a blank screen. cursor moves as i type, but no response back. have used telnet, putty and accuterm - all same result verified that telnet services are active in xp xp windoze firewall is... (10 Replies)
Discussion started by: allenhibbert
10 Replies

8. Shell Programming and Scripting

Telnet errors coming on screen while using snarf command.

Hi Team, I am using one script, It is working fine, the problem is it gives unwanted telnet errors when I am using it. I just want to remove these unwanted errors/info from my screen. bash-3.00$ cat raza_site_temp #!/usr/bin/bash #rj835b IFS="|" REGEX="$*" echo snarf2 -c "show... (1 Reply)
Discussion started by: Raza Ali
1 Replies

9. Post Here to Contact Site Administrators and Moderators

Remove confidential info

please remove following word from the respective links .There is a highy confidential info and hence we want it to be removed from site . https://www.unix.com/shell-programming-and-scripting/225177-max-size-directory.html words: itf ,ude,fititf ... (1 Reply)
Discussion started by: ptappeta
1 Replies
XRLOGIN(1)						      General Commands Manual							XRLOGIN(1)

NAME
xrlogin - start an xterm that uses ssh (or optionally rlogin or telnet) to connect to a remote host SYNOPSIS
xrlogin [-l username] [-rlogin|-telnet] [xterm options] remote-host DESCRIPTION
Xrlogin opens an xterm window and runs ssh, rlogin or telnet to login to a remote host. Xrlogin automatically passes the -name argument to xterm with a value of "xterm-hostname" where hostname is the name of the remote host. This allows the user to specify resources in their server's resource manager which are specific to xterms from a given host. For example, this feature can be used to make all xterm windows to a given remote host be the same color or use a specific font or start up in a spe- cific place on the screen. Xrsh(1) passes the same string so they are compatible in this regard. Xrlogin specifies that the default title for the new xterm will be "hostname" where hostname is the name of the remote host. This and the -name argument above can be overridden with xterm-options on the command line. One could also use xrlogin's sister command xrsh(1) to open a window to a remote host. In the case of xrsh, the xterm would run on the remote host and use X as the connection protocol while xrlogin would run the xterm on the local host and use rlogin or telnet as the con- nection protocol. See xrsh(1) for a discussion of the merits of each scheme. OPTIONS
-l username When not using -telnet, use username as the id to login to the remote host. -rlogin Use the rlogin protocol to open the connection. In general rlogin is preferred because it can be configured to not prompt the user for a password. Rlogin also automatically propagates window size change signals (SIGWINCH) to the remote host so that applications running there will learn of a new window size. -telnet Use the -telnet protocol to open the connection. Use of telnet provided mostly for hosts that don't support rlogin. COMMON PROBLEMS
Make sure that the local host is specified in the .rhosts file on the remote host or in the remote hosts /etc/hosts.equiv file. See rlogin(1) for more information. EXAMPLES
xrlogin -bg red yoda Start a local red xterm which connects to the remote host yoda using rlogin. xrlogin -telnet c70 Open a local xterm which connects to the remote host c70 using telnet. SEE ALSO
xrsh(1), rlogin(1), telnet(1) AUTHOR
James J. Dempsey <jjd@jjd.com> and Stephen Gildea <gildea@intouchsys.com>. X Version 11 Release 6 XRLOGIN(1)
All times are GMT -4. The time now is 09:12 AM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy