Expect doesn't output the logs


 
Thread Tools Search this Thread
Top Forums Shell Programming and Scripting Expect doesn't output the logs
# 1  
Old 11-22-2013
Expect doesn't output the logs

Code:
(qemu) migrate -d tcp:192.168.122.1:4444
(qemu) info migrate 
capabilities: xbzrle: off 
Migration status: completed
total time: 4425 milliseconds
downtime: 3 milliseconds
transferred ram: 130338 kbytes
remaining ram: 0 kbytes
total ram: 1057152 kbytes
duplicate: 232613 pages
normal: 32011 pages
normal bytes: 128044 kbytes
(qemu)

I use below expect scripts fragment
Code:
puts "run cmd migrate -d tcp:192.168.122.1:4444"

expect {
        "*qemu*" {send "migrate -d tcp:192.168.122.1:4444\r\n" }
        timeout {  exit 2 }
}
sleep 10
puts "run info migrate"
expect {
    "(qemu)" {send "\ninfo migrate\r\n"}
#        timeout {  exit 2 }
}
puts "migrate is over"

I can't get the below output log with expect scripts, which print from the cmd "info migrate"

capabilities: xbzrle: off
Migration status: completed
total time: 4425 milliseconds
downtime: 3 milliseconds
transferred ram: 130338 kbytes
remaining ram: 0 kbytes
total ram: 1057152 kbytes
duplicate: 232613 pages
normal: 32011 pages
normal bytes: 128044 kbytes

Last edited by yanglei_fage; 11-22-2013 at 04:05 AM..
Login or Register to Ask a Question

Previous Thread | Next Thread

10 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

Expect script to collect logs in expert mode

I am trying to collect logs from a system in expert mode. Where I login to system and then change mode to expert mode and issue command to collect the log. I have a script which works but It waits for 30 mins even though log collection is complete before that. I have two issues with existing... (4 Replies)
Discussion started by: shunya
4 Replies

2. Shell Programming and Scripting

Pull out information from output logs

My scenario is as follows. 1. I have a reference file with the IP addresses and names $ cat ref.list 10.11.xxx.xxx AA 10.12.xxx.xxx BB 10.13.xxx.xxx CC 10.14.xxx.xxx DD 2. A script runs and gets me one of the IP addresses and puts it in a separate file, for e.g... (2 Replies)
Discussion started by: Nagesh_1985
2 Replies

3. Shell Programming and Scripting

Take the input from output logs

Hi, If I have loads of logs like below and I am interested to print the requests(lines) which have taken more than 1000 ms. In this case how could I print the two highlighted lines ? abc.log reqquest id232342 , adfghfasdfsaf, TIME=30 reqquest id11111 , asdfdfghdffsaf, TIME=54 reqquest... (4 Replies)
Discussion started by: nariwithu
4 Replies

4. Shell Programming and Scripting

Take the input from output logs

Hi, If I have loads of logs like below and I am interested to print the requests(lines) which have taken more than 1000 ms. In this case how could I print the two highlighted lines ? abc.log reqquest id232342 , adfghfasdfsaf, TIME=30 reqquest id11111 , asdfdfghdffsaf, TIME=54 reqquest... (0 Replies)
Discussion started by: nariwithu
0 Replies

5. Shell Programming and Scripting

Using expect doesn't preserve the stderr

Hello, I am performing the follwing line from a unix server: expect -c 'spawn ssh otherHost chown -R user:group /usr ; expect password: ; send 123456\n ; interact ;' I am getting return value 0, an empty stderr and a stdout that says "/usr/... Not owner, /usr/... Not Owner ..". If I... (2 Replies)
Discussion started by: lastZenMaster
2 Replies

6. Shell Programming and Scripting

Expect doesn't recognize a password prompt

Hi. Here is beginning of my script #!/usr/local/bin/expect -- set timeout 15 spawn /usr/local/account.sh -n modify expect "Password:" {send "mypassword\r"} But due to some terminal control sequences (or something else, dunno exactly) my password prompt is looking like this: and expect... (3 Replies)
Discussion started by: urello
3 Replies

7. Shell Programming and Scripting

Output from Logs

Hello All, I have created a script to capture logs on every day at every 3 Min.Please find in attach.So my goal is to mail all the logs to myself for pertical date.So can anyone guide me how can i this on the basis of the attached logs. Regards Ankit (0 Replies)
Discussion started by: ajaincv
0 Replies

8. Shell Programming and Scripting

background functions doesn't display their output

hello there, there's a function, in my shell script, i'd like to run in the background. here's an example: log() { local SELF=${0##*/} tty -s && echo ": $*" } some_func() { # do something log "This text is not displayed in the terminal's output when running in the... (1 Reply)
Discussion started by: Shedon
1 Replies

9. Shell Programming and Scripting

Expect script doesn't work under crontab

Hi All, Using Expect script when I run it manually it works. But when I put the entry in crontab, the job is still running after 15 hours. The script was created as root. I don't think it's a permission issue. Any idea? This is what I have under root crontab... 00 18 * * 1-5... (4 Replies)
Discussion started by: samnyc
4 Replies

10. Shell Programming and Scripting

Expect - Interact output hangs when large output

Hello, I have a simple expect script I use to ssh to a workstation. I then pass control over to the user with interact. This script works fine on my HP and Mac, but on my Linux Desktop, I get a problem where the terminal hangs when ever I execute a command in the interact session that requires a... (0 Replies)
Discussion started by: natedog
0 Replies
Login or Register to Ask a Question