05-20-2014 09:34 AM
hi EEM guys,
probably a few of you have a lot more experience like me on the EEM side :) - hier my brief question|requirement:
dsl lines are more unstable the longer a line could be or the more crostalk is on the line etc.. - means line could be for some reason
disconected. (of course ISP´s try to avoid that while increasing the SNR etc....) - however the bandwith "could" change..
also for an standard HQoS it would be great if there is an method of setting "automatically the shape bandwith)
so i am wondering of someone of you had already implemented such requirement or an similar one via EEM:
here my scenario:
policy-map PM_AT_3Q
class P1_CLASSIFY
priority level 1
set cos 5
set ip precedence 5
class P2_CLASSIFY
set cos 6
set ip precedence 6
priority level 2
class class-default
set cos 2
set ip precedence 2
random-detect
policy-map QOS-POLICY
class class-default
shape average <EEM-Script-Output>
service-policy PM_AT_3Q
requirement to the EEM:
show interfaces ethernet 0 | i BW
MTU 1940 bytes, BW 5120 Kbit/sec, DLY 1900 usec,
calculate 97% from the BW and put the output in bit/s in the <EEM-Script-Output>
this should be only done if the interface resets (down|up)
any idea how to solve that?
thank you!
christian
05-26-2014 02:05 PM
Doing floating-point math is not possible using EEM applets. If you need exact figures, you'd need to use EEM Tcl policies. But, if you are okay with approximate values, this applet should work:
event manager applet adjust-qos
event syslog pattern "UPDOWN.*Ethernet0.*changed state to up"
action 001 cli command "enable"
action 002 cli command "show int e0 | inc BW"
action 003 regexp "BW ([0-9]+)" "$_cli_result" match bw
action 004 multiply $bw 97
action 005 divide $_result 100
action 006 subtract $_result $_remainder
action 007 cli command "config t"
action 008 cli command "policy-map QOS-POLICY"
action 009 cli command "class class-default"
action 010 cli command "shape average $_result"
action 011 cli command "service-policy PM_AT_3Q"
action 012 cli command "end"
05-26-2014 11:15 PM
hey joseph,
many thanks for your response!
i´ve tested it out - but it seems there is still one fault within it:
%HA_EM-3-FMPD_UNKNOWN_ENV: fh_parse_var: could not find environment variable: bw
your help is greatly appreciated
greetings
christian
05-27-2014 09:17 AM
Enable debug event manager action cli and re-run your applet. Post the debugging output.
05-27-2014 09:32 AM
hey joseph,
thanks for responding,
here is the debugtrace routput:
*May 27 16:31:14.009: %LINK-3-UPDOWN: Interface Ethernet0, changed state to up
*May 27 16:31:14.029: %HA_EM-6-LOG: adjust-qos : DEBUG(cli_lib) : : CTL : cli_open called.
*May 27 16:31:14.033: %HA_EM-6-LOG: adjust-qos : DEBUG(cli_lib) : : OUT : c888EG2>
*May 27 16:31:14.033: %HA_EM-6-LOG: adjust-qos : DEBUG(cli_lib) : : IN : c888EG2>enable
*May 27 16:31:14.045: %HA_EM-6-LOG: adjust-qos : DEBUG(cli_lib) : : OUT : c888EG2#
*May 27 16:31:14.045: %HA_EM-6-LOG: adjust-qos : DEBUG(cli_lib) : : IN : c888EG2#show int e0 | inc BW
*May 27 16:31:14.057: %HA_EM-6-LOG: adjust-qos : DEBUG(cli_lib) : : OUT : c888EG2#
*May 27 16:31:14.057: %HA_EM-3-FMPD_UNKNOWN_ENV: fh_parse_var: could not find environment variable: bw
*May 27 16:31:14.057: %HA_EM-3-FMPD_ERROR: Error executing applet adjust-qos statement 004
*May 27 16:31:14.057: %HA_EM-6-LOG: adjust-qos : DEBUG(cli_lib) : : CTL : cli_close called.
*May 27 16:31:14.061:
*May 27 16:31:14.061: tty is now going through its death sequence
*May 27 16:31:15.009: %LINEPROTO-5-UPDOWN: Line protocol on Interface Ethernet0, changed state to up
*May 27 16:31:15.017: %HA_EM-6-LOG: adjust-qos : DEBUG(cli_lib) : : CTL : cli_open called.
*May 27 16:31:15.021: %HA_EM-6-LOG: adjust-qos : DEBUG(cli_lib) : : OUT : c888EG2>
*May 27 16:31:15.021: %HA_EM-6-LOG: adjust-qos : DEBUG(cli_lib) : : IN : c888EG2>enable
*May 27 16:31:15.033: %HA_EM-6-LOG: adjust-qos : DEBUG(cli_lib) : : OUT : c888EG2#
*May 27 16:31:15.033: %HA_EM-6-LOG: adjust-qos : DEBUG(cli_lib) : : IN : c888EG2#show int e0 | inc BW
*May 27 16:31:15.045: %HA_EM-6-LOG: adjust-qos : DEBUG(cli_lib) : : OUT : c888EG2#
*May 27 16:31:15.045: %HA_EM-3-FMPD_UNKNOWN_ENV: fh_parse_var: could not find environment variable: bw
*May 27 16:31:15.045: %HA_EM-3-FMPD_ERROR: Error executing applet adjust-qos statement 004
*May 27 16:31:15.045: %HA_EM-6-LOG: adjust-qos : DEBUG(cli_lib) : : CTL : cli_close called.
*May 27 16:31:15.049:
*May 27 16:31:15.049: tty is now going through its death sequence
btw i guess i have to calculate the bw from kbit/s to bit/s probably i need somewhere
to calculate the 1000 factor right? because the shaper needs en value in bits.
thank you!!
christian
05-27-2014 09:44 AM
Remove the "| inc BW" and re-run the test. Yes, you'll need to add a multiply 1000 action in there to convert to bits.
05-27-2014 10:31 AM
looks fine now. great job!
i have to set also an wait "time" for 120 seconds.. what is your recommendation doing that? - with wait? i tried out after the enable sequence.
then i did run in an "
*May 27 17:23:52.853: tty is now going through its death sequence
any idea for wait untill all lines are sync and BW is updated?
btw this is the working output:
*May 27 17:29:15.305: %LINK-3-UPDOWN: Interface Ethernet0, changed state to up
*May 27 17:29:15.321: %HA_EM-6-LOG: adjust-qos : DEBUG(cli_lib) : : CTL : cli_open called.
*May 27 17:29:15.325: %HA_EM-6-LOG: adjust-qos : DEBUG(cli_lib) : : OUT : c888EG2>
*May 27 17:29:15.329: %HA_EM-6-LOG: adjust-qos : DEBUG(cli_lib) : : IN : c888EG2>enable
*May 27 17:29:15.341: %HA_EM-6-LOG: adjust-qos : DEBUG(cli_lib) : : OUT : c888EG2#
*May 27 17:29:15.341: %HA_EM-6-LOG: adjust-qos : DEBUG(cli_lib) : : IN : c888EG2#show int e0
*May 27 17:29:15.369: %HA_EM-6-LOG: adjust-qos : DEBUG(cli_lib) : : OUT : Ethernet0 is up, line protocol is up
*May 27 17:29:15.369: %HA_EM-6-LOG: adjust-qos : DEBUG(cli_lib) : : OUT : Hardware is PQII_SHDSL_EFM, address is dca5.f499.07c8 (bia dca5.f499.07c8)
*May 27 17:29:15.369: %HA_EM-6-LOG: adjust-qos : DEBUG(cli_lib) : : OUT : Description: GSHDSL:WAN
*May 27 17:29:15.369: %HA_EM-6-LOG: adjust-qos : DEBUG(cli_lib) : : OUT : MTU 1600 bytes, BW 5696 Kbit/sec, DLY 1700 usec,
*May 27 17:29:15.369: %HA_EM-6-LOG: adjust-qos : DEBUG(cli_lib) : : OUT : reliability 255/255, txload 1/255, rxload 1/255
*May 27 17:29:15.369: %HA_EM-6-LOG: adjust-qos : DEBUG(cli_lib) : : OUT : Encapsulation 802.1Q Virtual LAN, Vlan ID 1., loopback not set
*May 27 17:29:15.369: %HA_EM-6-LOG: adjust-qos : DEBUG(cli_lib) : : OUT : Keepalive set (10 sec)
*May 27 17:29:15.369: %HA_EM-6-LOG: adjust-qos : DEBUG(cli_lib) : : OUT : ARP type: ARPA, ARP Timeout 04:00:00
*May 27 17:29:15.369: %HA_EM-6-LOG: adjust-qos : DEBUG(cli_lib) : : OUT : Last input 00:00:00, output 00:00:00, output hang never
*May 27 17:29:15.369: %HA_EM-6-LOG: adjust-qos : DEBUG(cli_lib) : : OUT : Last clearing of "show interface" counters 1w1d
*May 27 17:29:15.369: %HA_EM-6-LOG: adjust-qos : DEBUG(cli_lib) : : OUT : Input queue: 0/75/0/0 (size/max/drops/flushes); Total output drops: 58
*May 27 17:29:15.369: %HA_EM-6-LOG: adjust-qos : DEBUG(cli_lib) : : OUT : Queueing strategy: fifo
*May 27 17:29:15.369: %HA_EM-6-LOG: adjust-qos : DEBUG(cli_lib) : : OUT : Output queue: 0/40 (size/max)
*May 27 17:29:15.369: %HA_EM-6-LOG: adjust-qos : DEBUG(cli_lib) : : OUT : 5 minute input rate 0 bits/sec, 0 packets/sec
*May 27 17:29:15.369: %HA_EM-6-LOG: adjust-qos : DEBUG(cli_lib) : : OUT : 5 minute output rate 0 bits/sec, 0 packets/sec
*May 27 17:29:15.369: %HA_EM-6-LOG: adjust-qos : DEBUG(cli_lib) : : OUT : 49727 packets input, 3771383 bytes, 0 no buffer
*May 27 17:29:15.369: %HA_EM-6-LOG: adjust-qos : DEBUG(cli_lib) : : OUT : Received 349 broadcasts (0 IP multicasts)
*May 27 17:29:15.369: %HA_EM-6-LOG: adjust-qos : DEBUG(cli_lib) : : OUT : 0 runts, 0 giants, 0 throttles
*May 27 17:29:15.369: %HA_EM-6-LOG: adjust-qos : DEBUG(cli_lib) : : OUT : 0 input errors, 0 CRC, 0 frame, 0 overrun, 0 ignored
*May 27 17:29:15.369: %HA_EM-6-LOG: adjust-qos : DEBUG(cli_lib) : : OUT : 0 input packets with dribble condition detected
*May 27 17:29:15.369: %HA_EM-6-LOG: adjust-qos : DEBUG(cli_lib) : : CTL : 20+ lines read from cli, debug output truncated
*May 27 17:29:15.373: %HA_EM-6-LOG: adjust-qos : DEBUG(cli_lib) : : IN : c888EG2#config t
*May 27 17:29:15.389: %HA_EM-6-LOG: adjust-qos : DEBUG(cli_lib) : : OUT : Enter configuration commands, one per line. End with CNTL/Z.
*May 27 17:29:15.389: %HA_EM-6-LOG: adjust-qos : DEBUG(cli_lib) : : OUT : c888EG2(config)#
*May 27 17:29:15.393: %HA_EM-6-LOG: adjust-qos : DEBUG(cli_lib) : : IN : c888EG2(config)#policy-map QOS-POLICY
*May 27 17:29:15.409: %HA_EM-6-LOG: adjust-qos : DEBUG(cli_lib) : : OUT : c888EG2(config-pmap)#
*May 27 17:29:15.409: %HA_EM-6-LOG: adjust-qos : DEBUG(cli_lib) : : IN : c888EG2(config-pmap)#class class-default
*May 27 17:29:15.425: %HA_EM-6-LOG: adjust-qos : DEBUG(cli_lib) : : OUT : c888EG2(config-pmap-c)#
*May 27 17:29:15.425: %HA_EM-6-LOG: adjust-qos : DEBUG(cli_lib) : : IN : c888EG2(config-pmap-c)#shape average 5525120
*May 27 17:29:15.441: %HA_EM-6-LOG: adjust-qos : DEBUG(cli_lib) : : OUT : c888EG2(config-pmap-c)#
*May 27 17:29:15.441: %HA_EM-6-LOG: adjust-qos : DEBUG(cli_lib) : : IN : c888EG2(config-pmap-c)#end
*May 27 17:29:15.441: %SYS-5-CONFIG_I: Configured from console by admin on vty0 (EEM:adjust-qos)
*May 27 17:29:15.453: %HA_EM-6-LOG: adjust-qos : DEBUG(cli_lib) : : OUT : c888EG2#
*May 27 17:29:15.453: %HA_EM-6-LOG: adjust-qos : DEBUG(cli_lib) : : CTL : cli_close called.
*May 27 17:29:15.457:
*May 27 17:29:15.457: tty is now going through its death sequence
*May 27 17:29:16.305: %LINEPROTO-5-UPDOWN: Line protocol on Interface Ethernet0, changed state to up
*May 27 17:29:16.313: %HA_EM-6-LOG: adjust-qos : DEBUG(cli_lib) : : CTL : cli_open called.
*May 27 17:29:16.317: %HA_EM-6-LOG: adjust-qos : DEBUG(cli_lib) : : OUT : c888EG2>
*May 27 17:29:16.317: %HA_EM-6-LOG: adjust-qos : DEBUG(cli_lib) : : IN : c888EG2>enable
*May 27 17:29:16.329: %HA_EM-6-LOG: adjust-qos : DEBUG(cli_lib) : : OUT : c888EG2#
*May 27 17:29:16.329: %HA_EM-6-LOG: adjust-qos : DEBUG(cli_lib) : : IN : c888EG2#show int e0
*May 27 17:29:16.357: %HA_EM-6-LOG: adjust-qos : DEBUG(cli_lib) : : OUT : Ethernet0 is up, line protocol is up
*May 27 17:29:16.357: %HA_EM-6-LOG: adjust-qos : DEBUG(cli_lib) : : OUT : Hardware is PQII_SHDSL_EFM, address is dca5.f499.07c8 (bia dca5.f499.07c8)
*May 27 17:29:16.357: %HA_EM-6-LOG: adjust-qos : DEBUG(cli_lib) : : OUT : Description: GSHDSL:WAN
*May 27 17:29:16.357: %HA_EM-6-LOG: adjust-qos : DEBUG(cli_lib) : : OUT : MTU 1600 bytes, BW 5696 Kbit/sec, DLY 1700 usec,
*May 27 17:29:16.357: %HA_EM-6-LOG: adjust-qos : DEBUG(cli_lib) : : OUT : reliability 255/255, txload 1/255, rxload 1/255
*May 27 17:29:16.357: %HA_EM-6-LOG: adjust-qos : DEBUG(cli_lib) : : OUT : Encapsulation 802.1Q Virtual LAN, Vlan ID 1., loopback not set
*May 27 17:29:16.357: %HA_EM-6-LOG: adjust-qos : DEBUG(cli_lib) : : OUT : Keepalive set (10 sec)
*May 27 17:29:16.357: %HA_EM-6-LOG: adjust-qos : DEBUG(cli_lib) : : OUT : ARP type: ARPA, ARP Timeout 04:00:00
*May 27 17:29:16.357: %HA_EM-6-LOG: adjust-qos : DEBUG(cli_lib) : : OUT : Last input 00:00:00, output 00:00:00, output hang never
*May 27 17:29:16.357: %HA_EM-6-LOG: adjust-qos : DEBUG(cli_lib) : : OUT : Last clearing of "show interface" counters 1w1d
*May 27 17:29:16.357: %HA_EM-6-LOG: adjust-qos : DEBUG(cli_lib) : : OUT : Input queue: 0/75/0/0 (size/max/drops/flushes); Total output drops: 58
*May 27 17:29:16.357: %HA_EM-6-LOG: adjust-qos : DEBUG(cli_lib) : : OUT : Queueing strategy: fifo
*May 27 17:29:16.357: %HA_EM-6-LOG: adjust-qos : DEBUG(cli_lib) : : OUT : Output queue: 0/40 (size/max)
*May 27 17:29:16.357: %HA_EM-6-LOG: adjust-qos : DEBUG(cli_lib) : : OUT : 5 minute input rate 1000 bits/sec, 1 packets/sec
*May 27 17:29:16.357: %HA_EM-6-LOG: adjust-qos : DEBUG(cli_lib) : : OUT : 5 minute output rate 1000 bits/sec, 1 packets/sec
*May 27 17:29:16.357: %HA_EM-6-LOG: adjust-qos : DEBUG(cli_lib) : : OUT : 49732 packets input, 3772873 bytes, 0 no buffer
*May 27 17:29:16.357: %HA_EM-6-LOG: adjust-qos : DEBUG(cli_lib) : : OUT : Received 353 broadcasts (0 IP multicasts)
*May 27 17:29:16.357: %HA_EM-6-LOG: adjust-qos : DEBUG(cli_lib) : : OUT : 0 runts, 0 giants, 0 throttles
*May 27 17:29:16.357: %HA_EM-6-LOG: adjust-qos : DEBUG(cli_lib) : : OUT : 0 input errors, 0 CRC, 0 frame, 0 overrun, 0 ignored
*May 27 17:29:16.357: %HA_EM-6-LOG: adjust-qos : DEBUG(cli_lib) : : OUT : 0 input packets with dribble condition detected
*May 27 17:29:16.357: %HA_EM-6-LOG: adjust-qos : DEBUG(cli_lib) : : CTL : 20+ lines read from cli, debug output truncated
*May 27 17:29:16.361: %HA_EM-6-LOG: adjust-qos : DEBUG(cli_lib) : : IN : c888EG2#config t
*May 27 17:29:16.377: %HA_EM-6-LOG: adjust-qos : DEBUG(cli_lib) : : OUT : Enter configuration commands, one per line. End with CNTL/Z.
*May 27 17:29:16.377: %HA_EM-6-LOG: adjust-qos : DEBUG(cli_lib) : : OUT : c888EG2(config)#
*May 27 17:29:16.381: %HA_EM-6-LOG: adjust-qos : DEBUG(cli_lib) : : IN : c888EG2(config)#policy-map QOS-POLICY
*May 27 17:29:16.397: %HA_EM-6-LOG: adjust-qos : DEBUG(cli_lib) : : OUT : c888EG2(config-pmap)#
*May 27 17:29:16.397: %HA_EM-6-LOG: adjust-qos : DEBUG(cli_lib) : : IN : c888EG2(config-pmap)#class class-default
*May 27 17:29:16.413: %HA_EM-6-LOG: adjust-qos : DEBUG(cli_lib) : : OUT : c888EG2(config-pmap-c)#
*May 27 17:29:16.413: %HA_EM-6-LOG: adjust-qos : DEBUG(cli_lib) : : IN : c888EG2(config-pmap-c)#shape average 5525120
*May 27 17:29:16.429: %HA_EM-6-LOG: adjust-qos : DEBUG(cli_lib) : : OUT : c888EG2(config-pmap-c)#
*May 27 17:29:16.429: %HA_EM-6-LOG: adjust-qos : DEBUG(cli_lib) : : IN : c888EG2(config-pmap-c)#end
*May 27 17:29:16.429: %SYS-5-CONFIG_I: Configured from console by admin on vty0 (EEM:adjust-qos)
thank you!
chris
05-27-2014 10:47 AM
Weird, I don't know why the "| inc BW" wouldn't have worked. Perhaps that has something to do with the line not being negotiated yet.
If you add a wait of 120, you will need to increase the maxrun of this applet to something like 140 seconds on the event syslog line.
05-27-2014 11:16 AM
so we are talking about:
(config-applet)#event syslog maxrun 140 ?
facility Match string for facility
mnemonic Match string for mnemonic
occurs Number of occurrences before raising event
pattern Pattern match string for the entire message
period Occurrence period
priority Screen messages that have specified priority
ratelimit Limit trigger to once per given time period
sequence Match string for sequence number
severity-critical Critical conditions, immediate attention needed
severity-debugging Debugging messages
severity-fatal System is unusable
severity-major Major conditions
severity-minor Minor conditions
severity-normal Normal event, signifying returning to normal state
severity-notification Basic notification, informational messages
severity-warning Warning conditions
timestamp Match string for timestamp
what do i need here?
05-27-2014 11:19 AM
Yes, append the maxrun 140 argument to the end of the event syslog line leaving everything else the same.
05-27-2014 11:36 AM
did it but now...
*May 27 18:35:26.405: %HA_EM-6-LOG: adjust-qos : DEBUG(cli_lib) : : CTL : cli_open called.
*May 27 18:35:26.409: %HA_EM-6-LOG: adjust-qos : DEBUG(cli_lib) : : OUT : c888EG2>
*May 27 18:35:26.409: %HA_EM-6-LOG: adjust-qos : DEBUG(cli_lib) : : IN : c888EG2>enable
*May 27 18:35:26.421: %HA_EM-6-LOG: adjust-qos : DEBUG(cli_lib) : : OUT : c888EG2#
*May 27 18:35:26.421: %HA_EM-6-LOG: adjust-qos : DEBUG(cli_lib) : : IN : c888EG2#show int e0
*May 27 18:35:26.637: %HA_EM-6-LOG: adjust-qos : DEBUG(cli_lib) : : OUT : Command authorization failed.
*May 27 18:35:26.637: %HA_EM-6-LOG: adjust-qos : DEBUG(cli_lib) : : OUT :
*May 27 18:35:26.637: %HA_EM-6-LOG: adjust-qos : DEBUG(cli_lib) : : OUT : c888EG2#
*May 27 18:35:26.637: %HA_EM-3-FMPD_UNKNOWN_ENV: fh_parse_var: could not find environment variable: bw
*May 27 18:35:26.637: %HA_EM-3-FMPD_ERROR: Error executing applet adjust-qos statement 004
*May 27 18:35:26.637: %HA_EM-6-LOG: adjust-qos : DEBUG(cli_lib) : : CTL : cli_close called.
*May 27 18:35:26.637:
*May 27 18:35:26.637: tty is now going through its death sequence
*May 27 18:35:27.393: %HA_EM-6-LOG: adjust-qos : DEBUG(cli_lib) : : CTL : cli_open called.
*May 27 18:35:27.409: %HA_EM-6-LOG: adjust-qos : DEBUG(cli_lib) : : OUT : c888EG2>
*May 27 18:35:27.409: %HA_EM-6-LOG: adjust-qos : DEBUG(cli_lib) : : IN : c888EG2>enable
*May 27 18:35:27.421: %HA_EM-6-LOG: adjust-qos : DEBUG(cli_lib) : : OUT : c888EG2#
*May 27 18:35:27.421: %HA_EM-6-LOG: adjust-qos : DEBUG(cli_lib) : : IN : c888EG2#show int e0
*May 27 18:35:27.637: %HA_EM-6-LOG: adjust-qos : DEBUG(cli_lib) : : OUT : Command authorization failed.
*May 27 18:35:27.637: %HA_EM-6-LOG: adjust-qos : DEBUG(cli_lib) : : OUT :
*May 27 18:35:27.637: %HA_EM-6-LOG: adjust-qos : DEBUG(cli_lib) : : OUT : c888EG2#
*May 27 18:35:27.637: %HA_EM-3-FMPD_UNKNOWN_ENV: fh_parse_var: could not find environment variable: bw
*May 27 18:35:27.637: %HA_EM-3-FMPD_ERROR: Error executing applet adjust-qos statement 004
*May 27 18:35:27.637: %HA_EM-6-LOG: adjust-qos : DEBUG(cli_lib) : : CTL : cli_close called.
*May 27 18:35:27.637:
*May 27 18:35:27.637: tty is now going through its death sequence
this is my config:
event manager session cli username "admin"
event manager applet adjust-qos
event syslog pattern "UPDOWN.*Ethernet0.*changed state to up" maxrun 140
action 000 wait 60
action 001 cli command "enable"
action 002 cli command "show int e0"
action 003 regexp "BW ([0-9]+)" "$_cli_result" match bw
action 004 multiply $bw 97000
action 005 divide $_result 100
action 006 subtract $_result $_remainder
action 007 cli command "config t"
action 008 cli command "policy-map QOS-POLICY"
action 009 cli command "class class-default"
action 010 cli command "shape average $_result"
action 011 cli command "end"
05-27-2014 11:45 AM
i guess i run now in an tacacs auth problem.
i have to verify that my admin account local has the correct rights.
have to verify at my own.
thank you for your great help!
chris
05-27-2014 02:09 PM
Yes. Make sure the admin user is authorized to run all of the CLI commands in the applet.
05-29-2014 11:23 PM
hey joseph,
finally made some changes - this script works for me now fine:
event manager session cli username "admin" privilege 15
event manager applet adjust-qos
event syslog pattern "UPDOWN.*Ethernet0.*changed state to up" maxrun 140
action 000 wait 60
action 001 cli command "enable"
action 002 cli command "show int e0"
action 003 regexp "BW ([0-9]+)" "$_cli_result" match bw
action 004 multiply $bw 970
action 005 cli command "config t"
action 006 cli command "policy-map QOS-POLICY"
action 007 cli command "class class-default"
action 008 cli command "shape average $_result"
action 009 cli command "end"
action 010 info type routername
action 011 syslog msg "$_info_routername: Shape average adjusted to $_result Bits/s"
i am also wondering if i can according to the dsl technology differ between
ATM and Ethernet - means if ATM0 comes up caclulate 15% OH and if the
Ethernet0 comes up calculate 3% OH. - is this within one script possible?
many thanks!!
chris
05-30-2014 03:10 PM
Sure. You could adjust the regular expression to be (ATM|Ethernet)0. Then add a regexp action to match on either the Ethernet or ATM pattern. Check $_regexp_result eq 1. If that's true, then do whatever calc you want based on what interface you matched. Then add an else for the other calc.
Discover and save your favorite ideas. Come back to expert answers, step-by-step guides, recent topics, and more.
New here? Get started with these tips. How to use Community New member guide