Sponsored Content
Full Discussion: Expect Scripting Help
Top Forums Shell Programming and Scripting Expect Scripting Help Post 302317103 by Harikrishna on Monday 18th of May 2009 05:05:38 AM
Old 05-18-2009
Expect Scripting Help

Hi All,

I am trying to connect a router using Expect scripting. But my script shows error.One more thing after the command telnet localhost 2000
we should press ENTER KEY once before the command prompt asks for "enable" and password.Please help correctiong my script.

#!/usr/bin/expect --

spawn telnet localhost 2000
expect "\n"
send "enable\r"
expect "Password:"
send "reso\r"

Regards,
Harikrishna.
 

10 More Discussions You Might Find Interesting

1. UNIX for Dummies Questions & Answers

Help required on expect scripting

I am trying to write an expect script for remote server login. At some point of time I need to telnet based on the output of grep command. Based on the output I need to select the ip address of the server. How can I write an expect script for the same. The output of the grep command is as follows:... (1 Reply)
Discussion started by: ayyappakumar
1 Replies

2. Shell Programming and Scripting

expect scripting need help

Hi experts, I am trying to develop a script using Expect. I am stuck somewhere. I need ur help guys. I have sun solaris where i need to input the following commands- bash-2.05$ telnet 11.13.58.39 2310 Trying 0.0.0.0... Connected to .. Escape character is '^]'. CONNECTING TO... ... (3 Replies)
Discussion started by: thepurple
3 Replies

3. Shell Programming and Scripting

strange expect script behavior, or am i misunderstanding expect scripting?

Hello to all...this is my first post (so please go easy). :) I feel pretty solid at expect scripting, but I'm running into an issue that I'm not able to wrap my head around. I wrote a script that is a little advanced for logging into a remote Linux machine and changing text in a file using sed.... (2 Replies)
Discussion started by: v1k0d3n
2 Replies

4. Shell Programming and Scripting

Help needed in expect scripting.

Hi, I am new to expect scripting and need your help in the following task. I want an expect script to take the commands from an input file and then execute the commands and give the command execution output in an otput file. The command execution part is normal and I did it via script by... (2 Replies)
Discussion started by: Sooryaa
2 Replies

5. Shell Programming and Scripting

Expect passwd scripting

I am trying to write an expect script which will read information from a file that contains username and password, and change the password for each user accordingly. The list contains around 100 users. I am new to both Solaris and expect. I have successfully been able to set the first user's... (9 Replies)
Discussion started by: DoctorOctagon
9 Replies

6. Shell Programming and Scripting

Expect Scripting Help

Hi All, I am suppose to capature the value command `show ip route` of a router in a Expect script. But i am not able to catch the value in a variable or a file in the following Expect script. #!/usr/bin/expect -f set input spawn telnet localhost $argv expect "Escape character is '^]'."... (5 Replies)
Discussion started by: Harikrishna
5 Replies

7. Shell Programming and Scripting

Expect scripting

Hi I have a working expect script below. The script continues to log cisco router configurations until all the ip addresses in the "routerlist1" has been read. Problem will start to happen when one of the ip address is not reacheable via ssh or telnet. The script will stop to read the rest of the... (2 Replies)
Discussion started by: yano1o14
2 Replies

8. Shell Programming and Scripting

Expect scripting

Hello, I tried to use expect to catch information from my nagios and send me a call but i have nothing when i execute the script : 0 - add : account SIP 1 - trext : information from nagios text2wav : conversion text to wav ( text to speech ) pjsua : connection thru the SIP ... (0 Replies)
Discussion started by: acidozik
0 Replies

9. Shell Programming and Scripting

Expect scripting.

I was wondering if I could do this a bit better. another script calls this script and logs into a device, does the relavant "show commands" and then saves those to a file. My problem is that the buffer isn't large enough to the output of some of the commands. here is an excerpt of what i'm... (0 Replies)
Discussion started by: gen1mx6
0 Replies

10. IP Networking

IP and expect scripting

Hi I am new to IP configuration and using expect script I have a requirement like I need to write a expect script that can ssh to a remote machine(linux1) using password which already has IP, once logged inside machine need to reboot remote machine(linux1) and again login to same remote... (1 Reply)
Discussion started by: Priya Amaresh
1 Replies
PMDASIMPLE(1)						      General Commands Manual						     PMDASIMPLE(1)

NAME
pmdasimple - simple performance metrics domain agent (PMDA) SYNOPSIS
$PCP_PMDAS_DIR/simple/pmdasimple [-d domain] [-i port] [-l logfile] [-p] [-u socket] [-U username] DESCRIPTION
pmdasimple is a simple Performance Metrics Domain Agent (PMDA) which exports a small number of synthetic performance metrics. The simple PMDA is shipped as source code and is designed to be an aid for PMDA developers. In terms of code size and features, it is more complex than the trivial PMDA, about the same as the txmon PMDA and less complex than the sample PMDA. The source for the simple PMDA is a good template from which production, customized PMDAs can be developed. A brief description of the pmdasimple command line options follows: -d It is absolutely crucial that the performance metrics domain number specified here is unique and consistent. That is, domain should be different for every PMDA on the one host, and the same domain number should be used for the same PMDA on all hosts. -i Expect PMCD to connect to pmdasimple on the specified TCP/IP port. port may be a port number or port name. -l Location of the log file. By default, a log file named simple.log is written in the current directory of pmcd(1) when pmdasimple is started, i.e. $PCP_LOG_DIR/pmcd. If the log file cannot be created or is not writable, output is written to the standard error instead. -p Expect PMCD to create a pipe and the connection to pmdasimple is via standard input and standard output. This is the default connec- tion mode. -u Expect PMCD to connect to pmdasimple on the Unix domain socket named socket. -U User account under which to run the agent. The default is the unprivileged "pcp" account in current versions of PCP, but in older versions the superuser account ("root") was used by default. At most one of the options -i, -p and -u may be specified. INSTALLATION
If you want access the names, help text and values for the simple performance metrics, do the following as root: # cd $PCP_PMDAS_DIR/simple # ./Install If you want to undo the installation, do the following as root: # cd $PCP_PMDAS_DIR/simple # ./Remove pmdasimple is launched by pmcd(1) and should never be executed directly. The Install and Remove scripts notify pmcd(1) when the agent is installed or removed. FILES
$PCP_PMCDCONF_PATH command line options used to launch pmdasimple $PCP_PMDAS_DIR/simple/help default help text file for the simple metrics $PCP_PMDAS_DIR/simple/Install installation script for the pmdasimple agent $PCP_PMDAS_DIR/simple/Remove undo installation script for the pmdasimple agent $PCP_PMDAS_DIR/simple/simple.conf configuration file for the dynamic instance domain that underlies the simple.now performance metric. For a description, refer to the help text file, or run the command $ pminfo -T simple.now $PCP_PMDAS_DIR/simple/*.pmda_simple.so The DSO version of the PMDA. The same source is used to create both the DSO and the daemon versions of the simple PMDA, and one or the other may be installed as part of the dialog in the Install script. $PCP_LOG_DIR/pmcd/simple.log default log file for error messages and other information from pmdasimple PCP ENVIRONMENT
Environment variables with the prefix PCP_ are used to parameterize the file and directory names used by PCP. On each installation, the file /etc/pcp.conf contains the local values for these variables. The $PCP_CONF variable may be used to specify an alternative configura- tion file, as described in pcp.conf(5). SEE ALSO
PCPIntro(1), pmcd(1), pmdasample(1), pmdatrivial(1), pmdatxmon(1), PMDA(3), pcp.conf(5) and pcp.env(5). Performance Co-Pilot PCP PMDASIMPLE(1)
All times are GMT -4. The time now is 09:54 PM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy