and i want to write an expect script for login in the router, give the command to dislay these stats and then store them in the script variables to use them .
I am able to log-in the router and give the command but not able to use regex for parsing the expect_out buffer.
Any help is appreciated.
Thanks,
ashy_g
Last edited by Scott; 12-17-2012 at 03:53 PM..
Reason: ICODE tags ===> CODE tags
There *has* to be an elegant way to do this in Expect...
I have a command that returns lines of numbers. Like:
prompt% mycommand --loop=5
9 4956 4951 4951 4956
9 4960 4951 4951 4956
9 4956 4951 4951 4956
9 4956 4951 4951 4956
9 4956 4951 4951 4956
prompt%
All numbers must be... (0 Replies)
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)
This is my simple expect scritpt:
#!/usr/bin/expect -f
match_max 100000
set timeout -1
spawn telnet $IP
expect "#"
send -- "shell\r"
expect "*Ready*"
send -- "init\r"
expect "*Ready*"
send -- "readsensor \r"
expect -- "*" <<< Output of this is a 2 digit number
set val... (5 Replies)
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)
I'm using Expect to execute a command on a router and return the output to a file. The output is a list. At the end of the list there's a statement that reads, "Found 165 active connections" (Where "165" could be any number between 0 and 2000.) I'm familiar with using Expect to return data from... (2 Replies)
I am trying to use send and receive using expect. the expect_out(buffer) is working fine while it is running it as foreground. But the same script when it is ran as background, the expect_out(buffer) errored out.
Is there any factor influence when we run script in foreground and in background? ... (0 Replies)
Help with parsing regex in tripwire:
the rule is" This test verifies that exported file systems do not have the "root=<host>" option specified."
regex that does not work is :
^.*-o+(?=root=\S+|\S+,root=\S+).*
the dfstab looks like this :
# cat /etc/dfs/dfstab
# Place... (1 Reply)
Help with parsing regex in tripwire:
the rule is" This test verifies that all exported file systems found in /etc/exports specify a fully qualified domain name containing "thecss.com" or a NIS netgroup.."
regex that does not work is :
... (1 Reply)
We have regex that we use to parse compliance policies in tripwire. can you please help to correct the regex :
policy is "Verify That Exported File Systems Specify the ro (read-only) Option"
the regex is
^.*-o+(?!ro+|ro\S+|\S+,ro\S+|\S+,ro+).*$
this does not work. how do we fix it ?
... (4 Replies)
Hi,
I need some guidance with understanding this Perl script below. I am not the author of the script and the author has not leave any documentation. I supposed it is meant to be 'easy' if you're a Perl or regex guru. I am having problem understanding what regex to use :confused: The script does... (3 Replies)
Discussion started by: newbie_01
3 Replies
LEARN ABOUT OSF1
iprsetup
iprsetup(8) System Manager's Manual iprsetup(8)NAME
iprsetup - Internet Protocol router setup
SYNOPSIS
/usr/sbin/iprsetup -s
/usr/sbin/iprsetup -sd
/usr/sbin/iprsetup -r
/usr/sbin/iprsetup -rd
/usr/sbin/iprsetup -fvalue
/usr/sbin/iprsetup -fvalued
/usr/sbin/iprsetup -d
OPTIONS
Sets ipforwarding and ipgateway to one, which means the system functions as an IP router. This option cannot be combined with the -r
option. Resets ipforwarding and ipgateway to zero, which means the system does not function as an IP router. This option cannot be com-
bined with the -s and -f options. Sets ipforwarding and ipgateway to one (like the -s option), and also sets ipfirewall to one, which
means the system functions as an IP firewall. Additionally, sets ipsrcroute and ipchkredirects according to the specified value. The fol-
lowing table shows the valid values and their meaning:
----------------------------------------------------------
Value Meaning
----------------------------------------------------------
0 Sets both ipsrcroute and ipchkredirects to zero
1 Sets ipsrcroute to zero and ipchkredirects to one
2 Sets ipsrcroute to one and ipchkredirects to zero
3 Sets both ipsrcroute and ipchkredirects to one
----------------------------------------------------------
This option cannot be combined with the -r option. Only application gateways for firewall services use this option. Displays the
values of ipforwarding and ipgateway. The values are displayed after the values are changed when combined with the -s, -r, and -f
options.
DESCRIPTION
The iprsetup command sets the ipgateway and ipforwarding variables in the running kernel allowing your system to function as an Internet
Protocol router.
When ipfirewall variable is set to one, the following variables are also set: Indicates whether IP source-routed packets are accepted (1)
or dropped immediately (0). Indicates whether ICMP Redirect messages are authenticated (1) or accepted with no authentication (0).
The iprsetup command is automatically executed by netsetup when you configure your network daemons. It is also executed by the
/sbin/init.d/inet script when you reboot your system or restart the network on your system.
FILES
Contains the /usr/sbin/iprsetup command Contains the /usr/sbin/iprsetup command
SEE ALSO
Network Administration
iprsetup(8)