Guys,
I know this is tricky.. I'm trying to write a script to pull info from a MMI device.
Following script logins into the server and then changes to super user. Opens MMI session and then exits out. I need to run the command under the MMI session "dsp_alarm_span all" Is there any other way to do this?
#!/usr/bin/env expect -f
set timeout -1
set stty_init -echo
spawn ssh 10.242.112.100 -l loginuser
#match_max 100000
expect "Password:"
send -- "asdfgh\r"
send -- "\r"
expect "loginuser@mcoa:~$ "
send -- "su - root\r"
expect "Password:"
send -- "qwerty\r"
expect "root@mcoa:~#"
send -- "/usr/local/bin/mmi_cmd\r"
expect -exact "MMI>"
send -- "dsp_alarm_span all\r"
send -- "exit\r"