EXPECT | Shutdown MITEL by Serial.


 
Thread Tools Search this Thread
Top Forums Shell Programming and Scripting EXPECT | Shutdown MITEL by Serial.
# 1  
Old 05-23-2016
EXPECT | Shutdown MITEL by Serial.

Hi everybody,

I'm from Spain so excuse my english.


I'm Trying to Shutdown the Mitel 3300 CXI by serial port.

I'm trying to do this with the EXPECT software.

The problem is:

The connection is done.
The "shutdown" is done BUT the Mitel auto-boot if the script does not type "<space><space><space>" to keep the Mitel powered off.

Image

I wrote the next script, of course I tried a lot of variants but I can't send the characters " " (space x3).

#!/usr/bin/expect
spawn screen dev/ttyUSB0
send "appShutdown"
expect "countdown starts..."
send " " (3 spaces but the forum only display 1)
interact


If I can share something more, tell me. Thanks.

Is too important for me...

Thanks for read.

Regards.

Last edited by Jonsaldana; 05-23-2016 at 12:11 PM..
Login or Register to Ask a Question

Previous Thread | Next Thread

10 More Discussions You Might Find Interesting

1. Programming

Expect script returning string following a found expect.

I'm fairly new to scripting so this might not be possible. I am using Expect with Cisco switches and need to capture the string after finding the expect request. For example, when I issue "show version" on a Nexus switch, I'm looking to capture the current firmware version: #show version ... (0 Replies)
Discussion started by: IBGaryA
0 Replies

2. Programming

Calling expect script inside another expect

Hi, Am very new to expect scripting.. Can You please suggest me how to call an expect script inside another expect script.. I tried with spawn /usr/bin/ksh send "expect main.exp\r" expect $root_prompt and spawn /usr/bin/ksh send "main.exp\r" expect $root_prompt Both... (1 Reply)
Discussion started by: Priya Amaresh
1 Replies

3. Linux

Mitel Standard Linux Installation Problems

I didn't know what sub category to put this under, so I just figured I'd throw it in the main area. I've recently acquired an HP ProLiant120 G6 and am trying to install Mitel's version of Linux onto it. I boot from the cd, and can make it as far as selecting what type of keyboard I have. The... (5 Replies)
Discussion started by: madeang
5 Replies

4. Shell Programming and Scripting

Expect - Comparison of expect value and loop selection

Hello All, I am trying to automate an installation process using expect and sh script. My problem is that during the installation process the expected value can change according to the situation. For Example if this is a first time installation then at step 3 I'll get "Do you want to accept... (0 Replies)
Discussion started by: alokrm
0 Replies

5. UNIX for Dummies Questions & Answers

Script to force Oracle database shutdown when shutdown immediate does not work

I have Oracle 9i R2 on AIX 5.2. My Database is running in shared server mode (MTS). Sometimes when I shutdown the database it shutsdown cleanly in 4-5 mints and sometimes it takes good 15-20 minutes and then I get some ora-600 errors and only way to shutdown is by opening another session and... (7 Replies)
Discussion started by: aixhp
7 Replies

6. Ubuntu

Ubuntu 9.04 Serial application to telnet to serial device

Hello! I am working on an application which reads environmental instruments which have serial ports. The application requires a serial port to be present to talk to the device (i.e. /dev/ttyS0 ). In some instances the environmental devices will be 100's of yards away from the computer, so a... (5 Replies)
Discussion started by: mvona
5 Replies

7. Shell Programming and Scripting

Need help with Expect script for Cisco IPS Sensors, Expect sleep and quoting

This Expect script provides expect with a list of IP addresses to Cisco IPS sensors and commands to configure Cisco IPS sensors. The user, password, IP addresses, prompt regex, etc. have been anonymized. In general this script will log into the sensors and send commands successfully but there are... (1 Reply)
Discussion started by: genewolfe
1 Replies

8. Shell Programming and Scripting

Expect Issue Serial Forground Execution vs Concurrent Background Execution

I have an expect script that interrogates several hundred unix servers for both access and directories therein using "ssh user@host ls -l /path". The combination of host/path are unique but the host may be interrogated multiple times if there are multiple paths to test. The expect script is run... (2 Replies)
Discussion started by: twk
2 Replies

9. 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

10. Shell Programming and Scripting

Expect and auto expect command

I need to run a remote application(GUI) in a client.i.e on running a script in the client machine i should get the GUI application which is running in the server by providing password through the script.Will expect or autoexpect command suit for this scenario? could anyone help me by posting some... (0 Replies)
Discussion started by: arun_v
0 Replies
Login or Register to Ask a Question
FENCE_AGENT(8)						      System Manager's Manual						    FENCE_AGENT(8)

NAME
fence_virsh - Fence agent for virsh DESCRIPTION
fence_virsh is an I/O Fencing agent which can be used with the virtual machines managed by libvirt. It logs via ssh to a dom0 and there run virsh command, which does all work. By default, virsh needs root account to do properly work. So you must allow ssh login in your sshd_config. fence_virsh accepts options on the command line as well as from stdin. Fenced sends parameters through stdin when it execs the agent. fence_virsh can be run by itself with command line options. This is useful for testing and for turning outlets on or off from scripts. Vendor URL: http://libvirt.org PARAMETERS
-a, --ip=[ip] IP Address or Hostname This parameter is always required. -l, --username=[name] Login Name This parameter is always required. -p, --password=[password] Login password or passphrase -c, --command-prompt=[prompt] Force Python regex for command prompt (Default Value: ['[EXPECT]# ']) -x, --ssh SSH connection (Default Value: 1) -n, --plug=[id] Physical plug number, name of virtual machine or UUID This parameter is always required. -u, --ipport=[port] TCP/UDP port to use for connection with device (Default Value: 22) -4, --inet4-only Forces agent to use IPv4 addresses only -6, --inet6-only Forces agent to use IPv6 addresses only -S, --password-script=[script] Script to retrieve password -k, --identity-file=[filename] Identity file for ssh --ssh-options=[options] SSH options to use (Default Value: -t '/bin/bash -c "PS1=# /bin/bash --noprofile --norc"') -o, --action=[action] Fencing Action (Default Value: reboot) -v, --verbose Verbose mode -D, --debug-file=[debugfile] Write debug information to given file -V, --version Display version information and exit -h, --help Display help and exit -C, --separator=[char] Separator for CSV created by operation list (Default Value: ,) --power-timeout=[seconds] Test X seconds for status change after ON/OFF (Default Value: 20) --shell-timeout=[seconds] Wait X seconds for cmd prompt after issuing command (Default Value: 3) --login-timeout=[seconds] Wait X seconds for cmd prompt after login (Default Value: 5) --power-wait=[seconds] Wait X seconds after issuing ON/OFF (Default Value: 0) --delay=[seconds] Wait X seconds before fencing is started (Default Value: 0) --retry-on=[attempts] Count of attempts to retry power on (Default Value: 1) --use-sudo Use sudo (without password) when calling 3rd party sotfware. ACTIONS
on Power on machine. off Power off machine. reboot Reboot machine. status This returns the status of the plug/virtual machine. list List available plugs with aliases/virtual machines if there is support for more then one device. Returns N/A otherwise. monitor Check the health of fence device metadata Display the XML metadata describing this resource. STDIN PARAMETERS
ipaddr IP Address or Hostname This parameter is always required. login Login Name This parameter is always required. passwd Login password or passphrase cmd_prompt Force Python regex for command prompt (Default Value: ['[EXPECT]# ']) secure SSH connection (Default Value: 1) port Physical plug number, name of virtual machine or UUID This parameter is always required. ipport TCP/UDP port to use for connection with device (Default Value: 22) inet4_only Forces agent to use IPv4 addresses only inet6_only Forces agent to use IPv6 addresses only passwd_script Script to retrieve password identity_file Identity file for ssh ssh_options SSH options to use (Default Value: -t '/bin/bash -c "PS1=# /bin/bash --noprofile --norc"') action Fencing Action (Default Value: reboot) verbose Verbose mode debug Write debug information to given file version Display version information and exit help Display help and exit separator Separator for CSV created by operation list (Default Value: ,) power_timeout Test X seconds for status change after ON/OFF (Default Value: 20) shell_timeout Wait X seconds for cmd prompt after issuing command (Default Value: 3) login_timeout Wait X seconds for cmd prompt after login (Default Value: 5) power_wait Wait X seconds after issuing ON/OFF (Default Value: 0) delay Wait X seconds before fencing is started (Default Value: 0) retry_on Count of attempts to retry power on (Default Value: 1) sudo Use sudo (without password) when calling 3rd party sotfware. fence_virsh (Fence Agent) 2009-10-20 FENCE_AGENT(8)