Hello,
I am trying to capture the output of a show snmp command, but only the text between certain strings. When I use an online regex tester it seems to work, but it filters everything out when I use the same regex in the NCM script. Here is an example show snmp output:
Chassis: XXXXXX
8039735 SNMP packets input
0 Bad SNMP version errors
965 Unknown community name
0 Illegal operation for community name supplied
32 Encoding errors
7817315 Number of requested variables
0 Number of altered variables
1817502 Get-request PDUs
278 Get-next PDUs
0 Set-request PDUs
0 Input queue packet drops (Maximum queue size 1000)
8038727 SNMP packets output
0 Too big errors (Maximum packet size 1500)
0 No such name errors
0 Bad values errors
0 General errors
0 Response PDUs
0 Trap PDUs
SNMP Dispatcher:
queue 0/75 (current/max), 0 dropped
SNMP Engine:
queue 0/1000 (current/max), 0 dropped
0 Unknown Security Models
0 SNMP Invalid Messages
0 SNMP Unknown PDU handlers
0 Unsupported Security Level
0 Unknown User Names
4019390 Unknown EngineIDs
0 Not In Time Windows
0 Wrong MD5 or SHA Digests
0 Decryption Errors
I would like to capture from the text "packets input" to Encoding Errors. Here is my regex: /packets input.*\n(.*\n)*.*Encoding errors
Can someone tell me what I am missing?