-
Notifications
You must be signed in to change notification settings - Fork 735
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
adding juniper_junos_show_system_processes_brief.textfsm support #1922
base: master
Are you sure you want to change the base?
adding juniper_junos_show_system_processes_brief.textfsm support #1922
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks @jnicholson56 just a couple of minor adjustments.
Value MEM_ACTIVE (\d*\D*\d*) | ||
Value MEM_FREE (\d*\D*\d*) | ||
Value MEM_USED (\d*\D*\d*) | ||
Value MEM_BUFFER (\d*\D*\d*) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Value MEM_ACTIVE (\d*\D*\d*) | |
Value MEM_FREE (\d*\D*\d*) | |
Value MEM_USED (\d*\D*\d*) | |
Value MEM_BUFFER (\d*\D*\d*) | |
Value MEMORY_ACTIVE (\d*\D*\d*) | |
Value MEMORY_FREE (\d*\D*\d*) | |
Value MEMORY_USED (\d*\D*\d*) | |
Value MEMORY_BUFFER (\d*\D*\d*) |
We should keep this consistent
^top\s* | ||
^Tasks:\s* | ||
^\%Cpu | ||
^${MEMORY_FORMAT}iB\s*Mem\s*:\s*${MEM_ACTIVE}\s*total,\s*${MEM_FREE}\s*free,\s*${MEM_USED}\s*used,\s*${MEM_BUFFER}\s*buff/cache\s* |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
^${MEMORY_FORMAT}iB\s*Mem\s*:\s*${MEM_ACTIVE}\s*total,\s*${MEM_FREE}\s*free,\s*${MEM_USED}\s*used,\s*${MEM_BUFFER}\s*buff/cache\s* | |
^${MEMORY_FORMAT}i*B\s*Mem\s*:\s*${MEMORY_ACTIVE}\s*total,\s*${MEMORY_FREE}\s*free,\s*${MEMORY_USED}\s*used,\s*${MEMORY_BUFFER}\s*buff/cache\s* |
I think the i
could not be present depending on what storage is being used
^Tasks:\s* | ||
^\%Cpu | ||
^${MEMORY_FORMAT}iB\s*Mem\s*:\s*${MEM_ACTIVE}\s*total,\s*${MEM_FREE}\s*free,\s*${MEM_USED}\s*used,\s*${MEM_BUFFER}\s*buff/cache\s* | ||
^${SWAP_FORMAT}iB\s*Swap:\s*${SWAP_TOTAL}\s*total,\s*${SWAP_FREE}\s*free,\s*${SWAP_USED}\s*used\.\s*${SWAP_AVAIL}\s*avail\s*Mem\s* -> Record |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
^${SWAP_FORMAT}iB\s*Swap:\s*${SWAP_TOTAL}\s*total,\s*${SWAP_FREE}\s*free,\s*${SWAP_USED}\s*used\.\s*${SWAP_AVAIL}\s*avail\s*Mem\s* -> Record | |
^${SWAP_FORMAT}i*B\s*Swap:\s*${SWAP_TOTAL}\s*total,\s*${SWAP_FREE}\s*free,\s*${SWAP_USED}\s*used\.\s*${SWAP_AVAIL}\s*avail\s*Mem\s* -> Record |
^{master} | ||
^. -> Error | ||
|
||
EOF |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
EOF |
I don't think the EOF is necessary since there aren't any FillDowns
Tasks: 407 total, 1 running, 406 sleeping, 0 stopped, 0 zombie | ||
%Cpu(s): 2.1 us, 2.7 sy, 0.0 ni, 94.6 id, 0.0 wa, 0.3 hi, 0.3 si, 0.0 st | ||
MiB Mem : 128191.6 total, 93230.9 free, 6286.2 used, 28674.5 buff/cache | ||
MiB Swap: 4096.0 total, 1131.7 free, 2964.2 used. 119812.1 avail Mem |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
MiB Swap: 4096.0 total, 1131.7 free, 2964.2 used. 119812.1 avail Mem | |
MiB Swap: 4096.0 total, 1131.7 free, 2964.2 used. 119812.1 avail Mem | |
- mem_active: "31554.4" | ||
mem_buffer: "3661.7" | ||
mem_free: "17292.4" | ||
mem_used: "10600.3" | ||
memory_format: "M" | ||
node: "fpc0" | ||
swap_avail: "19854.3" | ||
swap_format: "M" | ||
swap_free: "100.0" | ||
swap_total: "100.0" | ||
swap_used: "0.0" | ||
- mem_active: "128191.6" | ||
mem_buffer: "45096.8" | ||
mem_free: "65543.4" | ||
mem_used: "17551.4" | ||
memory_format: "M" | ||
node: "re0" | ||
swap_avail: "108490.7" | ||
swap_format: "M" | ||
swap_free: "8192.0" | ||
swap_total: "8192.0" | ||
swap_used: "0.0" | ||
- mem_active: "128191.6" | ||
mem_buffer: "28674.5" | ||
mem_free: "93230.9" | ||
mem_used: "6286.2" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
- mem_active: "31554.4" | |
mem_buffer: "3661.7" | |
mem_free: "17292.4" | |
mem_used: "10600.3" | |
memory_format: "M" | |
node: "fpc0" | |
swap_avail: "19854.3" | |
swap_format: "M" | |
swap_free: "100.0" | |
swap_total: "100.0" | |
swap_used: "0.0" | |
- mem_active: "128191.6" | |
mem_buffer: "45096.8" | |
mem_free: "65543.4" | |
mem_used: "17551.4" | |
memory_format: "M" | |
node: "re0" | |
swap_avail: "108490.7" | |
swap_format: "M" | |
swap_free: "8192.0" | |
swap_total: "8192.0" | |
swap_used: "0.0" | |
- mem_active: "128191.6" | |
mem_buffer: "28674.5" | |
mem_free: "93230.9" | |
mem_used: "6286.2" | |
- memory_active: "31554.4" | |
memory_buffer: "3661.7" | |
memory_free: "17292.4" | |
memory_used: "10600.3" | |
memory_format: "M" | |
node: "fpc0" | |
swap_avail: "19854.3" | |
swap_format: "M" | |
swap_free: "100.0" | |
swap_total: "100.0" | |
swap_used: "0.0" | |
- memory_active: "128191.6" | |
memory_buffer: "45096.8" | |
memory_free: "65543.4" | |
memory_used: "17551.4" | |
memory_format: "M" | |
node: "re0" | |
swap_avail: "108490.7" | |
swap_format: "M" | |
swap_free: "8192.0" | |
swap_total: "8192.0" | |
swap_used: "0.0" | |
- memory_active: "128191.6" | |
memory_buffer: "28674.5" | |
memory_free: "93230.9" | |
memory_used: "6286.2" |
Value SWAP_AVAIL (\d*\D*\d*) | ||
|
||
Start | ||
^------------------------------- |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
^------------------------------- | |
^-+\s*$$ |
We can match however many dashes there are
Start | ||
^------------------------------- | ||
^node:\s*${NODE} | ||
^------------------------------- |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
^------------------------------- |
matched be existing regex
^\%Cpu | ||
^${MEMORY_FORMAT}iB\s*Mem\s*:\s*${MEM_ACTIVE}\s*total,\s*${MEM_FREE}\s*free,\s*${MEM_USED}\s*used,\s*${MEM_BUFFER}\s*buff/cache\s* | ||
^${SWAP_FORMAT}iB\s*Swap:\s*${SWAP_TOTAL}\s*total,\s*${SWAP_FREE}\s*free,\s*${SWAP_USED}\s*used\.\s*${SWAP_AVAIL}\s*avail\s*Mem\s* -> Record | ||
^\s+\S+ |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
^\s+\S+ |
This is a little too loose of a match, and could lead to incorrect parsing without raising an error. I don't see any example of this in the provided test case, is this something you would expect to see?
adding juniper_junos_show_system_processes_brief.textfsm support