11-27-2015 03:45 AM
Currently I am running this part of a script to export the entire result to our syslog. However I only require 2 parts from the output (highlighted in below output). I have other scripts that do this, but as both lines start with a non consistant counter I am unsure how to pick out this data.
I would usually have something like: action 040 regexp "(Configured .*)" "$_cli_result" match line
Currently use:
action 030 cli command "show interface cellular 0"
action 040 regexp "(.*)" "$_cli_result" output
Output:
Cellular0 is up, line protocol is up
Hardware is 4G WWAN Modem - Global Multimode LTE/DC-HSPA+/HSPA+/HSPA/UMTS/EDGE/GPRS
Internet address will be assigned dynamically by the network
MTU 1500 bytes, BW 50000 Kbit/sec, DLY 20000 usec,
reliability 255/255, txload 1/255, rxload 1/255
Encapsulation SLIP, loopback not set
Keepalive not supported
Interface is bound to Di0 (Encapsulation SLIP)
Last input 00:00:00, output never, output hang never
Last clearing of "show interface" counters 00:11:07
Input queue: 0/75/0/0 (size/max/drops/flushes); Total output drops: 0
Queueing strategy: fifo
Output queue: 0/10 (size/max)
5 minute input rate 1000 bits/sec, 1 packets/sec
5 minute output rate 1000 bits/sec, 1 packets/sec
472 packets input, 67861 bytes, 0 no buffer
Received 0 broadcasts (0 IP multicasts)
0 runts, 0 giants, 0 throttles
0 input errors, 0 CRC, 0 frame, 0 overrun, 0 ignored, 0 abort
508 packets output, 91666 bytes, 0 underruns
0 output errors, 0 collisions, 0 interface resets
0 unknown protocol drops
0 output buffer failures, 0 output buffers swapped out
0 carrier transitions
DCD=up DSR=up DTR=up RTS=up CTS=up
Solved! Go to Solution.
11-27-2015 03:51 AM
for the cli command you could try this ,that should just pick up those two lines
sh int cellular 0 | i input,|output,
11-27-2015 03:51 AM
for the cli command you could try this ,that should just pick up those two lines
sh int cellular 0 | i input,|output,
11-27-2015 03:54 AM
that will do perfectly thanks
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