telnet Webserver GET /


 
Thread Tools Search this Thread
Operating Systems Solaris telnet Webserver GET /
# 1  
Old 03-30-2007
telnet Webserver GET /

I want to incorporate this in a script for some simple monitoring for my webserver

telnet localhost 80
GET /opencms/opencms/test/index.html


how to do it?

I tried

echo "GET /opencms/opencms/test/index.html" | telnet localhost 80

I tried

telnet localhost 80 << EOF
echo "GET /opencms/opencms/test/index.html"
EOF

I tried

"GET /opencms/opencms/test/index.html" < telnet localhost 80

all won't work, I need some help
# 2  
Old 03-30-2007
You're better off using wget, curl or even using a proper monitoring tool like Nagios with the check_http plugin.

That aside, you can do simple things with expect, e.g.
Code:
#!/usr/bin/expect -f

set timeout 10
spawn /usr/bin/telnet myhost 80
expect "Escape"
send "GET /\r"
expect "something here"

Cheers
ZB
# 3  
Old 03-30-2007
Code:
#! /usr/bin/ksh
exec 4>&1 5>&2
telnet foo 80 >&4 2>&5 |&
print -p GET

# 4  
Old 03-31-2007
thx zazzybob,

My requirement is quite complex Smilie

hey reborg,

yur script dun work. what is "4>&1" "5>&2" supposed to do?

#!/usr/bin/ksh
exec 4>&1 5>&2
telnet localhost 80 1>&4 2>&5 | &
print -p GET

#ksh -x /tmp/saver
+ exec
+ 4>& 1 5>& 2
/tmp/saver[3]: syntax error at line 4 : `&' unexpected

#
# 5  
Old 03-31-2007
It didn't work because you didn't copy it correctly.

Look at where I have spaces in my post and what you have.

exec 4>&1 5>&2

duplicates the output streams 4 and 5 to stdout and stderr.
Login or Register to Ask a Question

Previous Thread | Next Thread

10 More Discussions You Might Find Interesting

1. Emergency UNIX and Linux Support

Netcat ( nc -l ) as webserver

Dear Linux guru's I am trying to create a webserver using nc (netcat only) on RHEL 7.2 running on bash shell. now the easy thing is to get nc listing to a port and respond back $ while true; do { echo -e 'HTTP/1.0 200 OK\r\n'; set; } | nc -l 7877; done This when called from a... (3 Replies)
Discussion started by: chakrapani
3 Replies

2. UNIX for Dummies Questions & Answers

Difference Between Krb5-telnet And Ekrb5-telnet

Hi, I want to know the difference between these two services. Both are under xinetd. Both are used for enabling and disabling Telnet service. So, can somebody please explain me the difference between the two ? Thanks in advance :) (0 Replies)
Discussion started by: kashifsd17
0 Replies

3. Shell Programming and Scripting

PHP webserver vs AJAX

Hello All I want to develop a news ticker using a PHP webserver instead of polling the RSS feed using AJAX. Let me know if you guys have any idea about this. (0 Replies)
Discussion started by: suvendu4urs
0 Replies

4. UNIX for Dummies Questions & Answers

Automatically login in the telnet from present telnet

Hi, I was writing one script which includes to switch to the another telnet automatically from the present telnet server. I was using rlogin but firstly it takes the same user name of the present telnet and secondly it is prompting for the password. But i want to switch to the another telnet... (2 Replies)
Discussion started by: Prateek
2 Replies

5. UNIX for Advanced & Expert Users

is this enough for a webserver of 200 clients

Hi all, This is my server configuration. Hard Disk - 500 GB RAM - 3GB Processor - intel core 2 quad ( 4 numbers). each one of four cores. We have an application hosted thorough tomcat and accessed via apache through mod_jk connector. There would be around 200 clients... (1 Reply)
Discussion started by: anishkumarv
1 Replies

6. Shell Programming and Scripting

Webpage to Telnet via Perl and Expect: Telnet problem?

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

7. Solaris

webserver login

how can I get statistics and web analysis for solaris 10 webserver access? what is the file? and what is the tools to analyze it? thanx (2 Replies)
Discussion started by: fsmadi
2 Replies

8. UNIX for Advanced & Expert Users

apache webserver

Can I set up an apache webserver on Mandriva? Looking for the easiest webserver program to install basic webserver just for home use. Any ideas/suggestions much appreciated..... (2 Replies)
Discussion started by: jo calamine
2 Replies

9. SuSE

Cannot connect to webserver

Hello All, I need some help as to how to debug the problem I am having with my webserver. I am using Suse 9.2 pro as my server. I have setup my firewall and router to forward http 80 request to my linux server. I tried pinging my server from work - it worked. I tried running localhost... (5 Replies)
Discussion started by: negixx
5 Replies

10. OS X (Apple)

Webserver Setup, need help!

Hey guys, does anyone know how I edit, configure the server settings using the terminal? MySQL and PHP was once working. But after frying the Xserve G5 i'm in the middle of rebuilding everything, I believe i need to re-configure the root document directory... but have forgotten how to edit... (1 Reply)
Discussion started by: hype.it
1 Replies
Login or Register to Ask a Question