Sponsored Content
Top Forums Shell Programming and Scripting Using telnet in my shell script Post 302838115 by umarsatti on Monday 29th of July 2013 02:32:54 AM
Old 07-29-2013
Actually in my scenario I can't use ssh, reason being is that in my scenario I do not need to login to any remote node/server. I want to send an http/xml requests by telneting to local host of my server on specific port.

In that case function that LEM has sent would not work. Here is what I am trying to achieve through a script.

Code:
telnet localhost 1111
[I will paste my http/xml Request here]
[Will get http response from server]
[I will paste my http/xml Request]
[Will get http response from server]

Example of my scenario is mentioned in my opening post.

Regards,
Umar
 

10 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

telnet & su in shell script

Hi, Any scripting experts out there that can point me to the right direction of writing a script using telnet and su to access a server without any users interaction such as login and entering passwd. Thanks. Thanks in advance vastare (1 Reply)
Discussion started by: vastare
1 Replies

2. Shell Programming and Scripting

telnet shell script on red hat 9 cmd line only

i would like to make a shell script (red hat 9 cmd line only) to telnet to my local isp's webmail server on port 25 and send it commands such as helo :) help would be much appreciated, and i found no posts similar that answered my question... the closest i've gotten to an answer from about 8... (3 Replies)
Discussion started by: kypeswith
3 Replies

3. Solaris

using shell script to telnet

I would like to log into a server read a certain file and get the results back. I have tried like below to no avail; #!/bin/ksh -x ( sleep 2 echo sdpuser sleep 2 echo cs3reloaded sleep 5 cd /export/home/scripts/daily_checks sleep 5 head daily_check_report.txt > test160108.txt exit )... (6 Replies)
Discussion started by: ricky katix
6 Replies

4. Shell Programming and Scripting

usage of telnet in shell script

Hi All, How could I use telnet to connect to Primary Host in the below shell script: Could I use: ( echo user sleep 2 echo password sleep 2 echo "ls ~" sleep 2 echo "exit" ) | telnet hostname ... (1 Reply)
Discussion started by: a1_win
1 Replies

5. Shell Programming and Scripting

closing a telnet session on error, in a shell script

I am using a shell script to telnet into a remote unix server and execute certain commands. But if any command being executed remotely, throws an error, the script just hangs. And the telnet session does not get closed. I want to be able to close the session and complete the script execution in... (1 Reply)
Discussion started by: farahzaiba
1 Replies

6. Shell Programming and Scripting

How to Create a shell script to test the telnet connection status

Hi friends, I'm newbie to shell script. I wanted to create a shell script which able to write a result for all the telnet connection status. For example, from this machine I want to test the telnet connection (total 100+ servers) with this machine. Any idea how to write this shell script?... (16 Replies)
Discussion started by: yhcheong
16 Replies

7. Shell Programming and Scripting

Telnet using shell script

Hi I need to telnet a device with IP Address and port. After logging in, I need to execute some commands in that device. Please find the example below telnet 170.10.11.1 2100 #170.10.11.1 is the IP address. 2100 is the Port after telnet, the device will show the command prompt as : ... (2 Replies)
Discussion started by: sudharsan23
2 Replies

8. UNIX for Advanced & Expert Users

Telnet from shell script , further need to logout if log in not authenticate

Using unix shell script file I need to telnet to a IP further send a command to the telnet IP and get the response to a file with out using "expect" utility and I have achieved this by below command. (sleep 3; echo admin; sleep 3; echo mypass; sleep 5;echo "show status-list"; sleep 5; echo... (3 Replies)
Discussion started by: raghunath Rao
3 Replies

9. UNIX for Dummies Questions & Answers

Shell Script to test telnet connection using port

Hello, I need to test telnet connections using port number for few hosts. Could you please help me? Thanks !! (1 Reply)
Discussion started by: skhichi
1 Replies

10. Shell Programming and Scripting

Need shell script for SMS via telnet command

I am not very much familiar with telnet based scripting so I would need your help to directly submitting sms as deliver_sm or submit_sm msg to SMSC (IP & system_id and password are already known). So, need your help to provide such script. I previously used such script but my harddisk crashed and... (1 Reply)
Discussion started by: wasay
1 Replies
wbemexec(1)															       wbemexec(1)

NAME
wbemexec - submit a CIM operation request to a CIM Server SYNOPSIS
wbemexec [ -h hostname ] [ -p portnumber ] [ -v httpversion ] [ -m httpmethod ] [ -t timeout ] [ -u username ] [ -w password ] [ -s ] [ --help ] [ --version ] [ inputfilepath ] DESCRIPTION
The wbemexec command provides a command line interface to a CIM Server. The input to the command consists of a CIM request encoded in XML. The request is submitted to the CIM Server for execution. If the HTTP response from the CIM Server contains a status code of 200 (OK), the result returned to stdout is the CIM response encoded in XML. Otherwise, the result returned to stdout is the HTTP response. Some types of invalid XML requests (e.g. missing PROTOCOLVERSION attribute or missing NAME attribute) are detected by wbemexec, and result in an error message from wbemexec. Other invalid XML requests (e.g. invalid CIMVERSION attribute value or missing XML version), are detected by the CIM Server, and result in an HTTP response, containing a non-Success status code, such as 501 (Not Implemented) or 400 (Bad Request). By default, the request is sent as an HTTP/1.1 request, using the HTTP M-POST method, and wbemexec waits 20000 milliseconds (20 seconds), then times out if a response hasn't been received. Input is read from stdin, if no input file is specified. By default, the operation is executed on the local host. wbemexec first attempts to connect to the CIM Server on the default port for the wbem-http service, and if that fails, another attempt is made on the default port for the wbem-https service. Options wbemexec recognizes the following options: -h hostname Connect to the CIM Server on the specified host. If this option is not specified, wbemexec connects to the local host. --help Display command usage information. -m httpmethod Use the specified HTTP method for the request. The method must be "POST" or "M-POST". -p portnumber Connect to the CIM Server on the specified port number. If this option is not specified, wbemexec connects to the default port for the wbem-http service, or if the -s option is specified, to the default port for the wbem-https ser- vice. -s Enable the use of the SSL protocol between and the CIM server. The -s option should be specified if the CIM Server on the specified hostname/portnumber expects clients to connect using HTTPS. -t timeout Wait the specified number of milliseconds on sending a request, before timing out if no response has been received. The timeout value must be an integer value greater than 0. -u username Connect as the specified R username . If username is not specified, the current logged in user is used for authenti- cation. This option is ignored if neither hostname nor portnumber is specified. -v httpversion Use the specified HTTP version for the request. The version must be "1.0" or "1.1". The 1.0 version may not be specified if the M-POST method is specified. --version Display CIM Server version. -w password Authenticate the connection using the specified password . This option is ignored if neither hostname nor portnumber is specified. WARNING: A password should not be specified on the command line on a multi-user system, since command- line options are typically world-readable for a short window of time. If the remote host requests authentication and this option is not specified, wbemexec will prompt for the password. (See cimconfig (1) for information on configur- ing the CIM Server.) EXIT STATUS
When an error occurs, an explanatory error message is written to stderr and an appropriate value is returned. The following exit values are returned: 0 Success 1 Error USAGE NOTE
The wbemexec command requires that the CIM Server is running. EXAMPLES
Submit an XML request contained in the file cimrequest.xml to the CIM Server running on the local host on the default port: wbemexec cimrequest.xml Submit an XML request contained in the file cimrequest.xml to the CIM Server running on the host hpserver on port 49152, using the username guest and password guest for authentication: wbemexec -h hpserver -p 49152 -u guest -w guest cimrequest.xml SEE ALSO
cimserver(1), cimconfig(1). STANDARDS CONFORMANCE
wbemexec: CIM Operations over HTTP 1.0, Representation of CIM in XML 2.0 wbemexec(1)
All times are GMT -4. The time now is 06:58 PM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy