Skip to content
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_summary.textfsm support #1921

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

jnicholson56
Copy link

Adding support for Juniper Junos show system processes summary command.

Comment on lines +1 to +5
Value MEM_ACTIVE (\d*\D*)
Value MEM_INACTIVE (\d*\D*)
Value MEM_WIRED (\d*\D*)
Value MEM_BUFFER (\d*\D*)
Value MEM_FREE (\d*\D*)
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
Value MEM_ACTIVE (\d*\D*)
Value MEM_INACTIVE (\d*\D*)
Value MEM_WIRED (\d*\D*)
Value MEM_BUFFER (\d*\D*)
Value MEM_FREE (\d*\D*)
Value MEMORY_ACTIVE (\d*\S*)
Value MEMORY_INACTIVE (\d*\S*)
Value MEMORY_WIRED (\d*\S*)
Value MEMORY_BUFFER (\d*\S*)
Value MEMORY_FREE (\d*\S*)

Keep aligned with your other PR, and avoid capturing trailing space

Comment on lines +3 to +9
- mem_active: "3977M "
mem_buffer: "504M "
mem_free: "74G "
mem_inactive: "14G "
mem_wired: "1815M "
swap_free: "12G "
swap_total: "12G "
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
- mem_active: "3977M "
mem_buffer: "504M "
mem_free: "74G "
mem_inactive: "14G "
mem_wired: "1815M "
swap_free: "12G "
swap_total: "12G "
- mem_active: "3977M"
mem_buffer: "504M"
mem_free: "74G"
mem_inactive: "14G"
mem_wired: "1815M"
swap_free: "12G"
swap_total: "12G"

we should capture trailing space

19743 root -16 - 0B 16K select 7 172:15 0.10% ppt_11_80000013
21670 root -16 - 0B 16K select 0 166:12 0.10% ppt_11_80000015
2 root -16 - 0B 16K jfe_jo 2 138:19 0.10% jfe_job_0_0
24931 root 20 0 14M 3636K CPU5 5 0:00 0.00% top
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
24931 root 20 0 14M 3636K CPU5 5 0:00 0.00% top
24931 root 20 0 14M 3636K CPU5 5 0:00 0.00% top

Comment on lines +13 to +15
^\s*Mem:\s*${MEM_ACTIVE}\s*Active,\s*${MEM_INACTIVE}\s*Inact,\s*${MEM_WIRED}\s*Wired,\s*${MEM_BUFFER}\s*Buf,\s*${MEM_FREE}\s*Free
^\s*Mem:\s*${MEM_ACTIVE}\s*Active,\s*${MEM_INACTIVE}\s*Inact,\s*${MEM_WIRED}\s*Wired,\s*\d*\D*\s*Cache,\s*${MEM_BUFFER}\s*Buf,\s*${MEM_FREE}\s*Free
^\s*Mem:\s*${MEM_ACTIVE}\s*Active,\s*${MEM_INACTIVE}\s*Inact,\s*\d*\D*\s*Laundry,\s*${MEM_WIRED}\s*Wired,\s*${MEM_BUFFER}\s*Buf,\s*${MEM_FREE}\s*Free
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
^\s*Mem:\s*${MEM_ACTIVE}\s*Active,\s*${MEM_INACTIVE}\s*Inact,\s*${MEM_WIRED}\s*Wired,\s*${MEM_BUFFER}\s*Buf,\s*${MEM_FREE}\s*Free
^\s*Mem:\s*${MEM_ACTIVE}\s*Active,\s*${MEM_INACTIVE}\s*Inact,\s*${MEM_WIRED}\s*Wired,\s*\d*\D*\s*Cache,\s*${MEM_BUFFER}\s*Buf,\s*${MEM_FREE}\s*Free
^\s*Mem:\s*${MEM_ACTIVE}\s*Active,\s*${MEM_INACTIVE}\s*Inact,\s*\d*\D*\s*Laundry,\s*${MEM_WIRED}\s*Wired,\s*${MEM_BUFFER}\s*Buf,\s*${MEM_FREE}\s*Free
^\s*Mem:\s*${MEMORY_ACTIVE}\s*Active,\s*${MEMORY_INACTIVE}\s*Inact,\s*${MEMORY_WIRED}\s*Wired,\s*${MEMORY_BUFFER}\s*Buf,\s*${MEMORY_FREE}\s*Free
^\s*Mem:\s*${MEMORY_ACTIVE}\s*Active,\s*${MEMORY_INACTIVE}\s*Inact,\s*${MEMORY_WIRED}\s*Wired,\s*\d*\D*\s*Cache,\s*${MEMORY_BUFFER}\s*Buf,\s*${MEMORY_FREE}\s*Free
^\s*Mem:\s*${MEMORY_ACTIVE}\s*Active,\s*${MEMORY_INACTIVE}\s*Inact,\s*\d*\D*\s*Laundry,\s*${MEMORY_WIRED}\s*Wired,\s*${MEMORY_BUFFER}\s*Buf,\s*${MEMORY_FREE}\s*Free

Comment on lines +6 to +7
Value SWAP_TOTAL (\d*\D*)
Value SWAP_FREE (\d*\D*)
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
Value SWAP_TOTAL (\d*\D*)
Value SWAP_FREE (\d*\D*)
Value SWAP_TOTAL (\d*\S*)
Value SWAP_FREE (\d*\S*)



Start
^\s*last\s*pid
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
^\s*last\s*pid
^\s*last\s*pid
^\s*\d+\s+threads:
^\s*CPU:

^\s*Swap:\s*${SWAP_TOTAL}\s*Total,\s*\d*\D*\s*Used,\s*${SWAP_FREE}\s*Free,\s*\d*%\s*Inuse -> Record
^\s*Swap: -> Record
^\s*PID\s*USERNAME\s*PRI\s*NICE\s*SIZE\s*RES\s*STATE\s*C\s*TIME\s*WCPU\s*COMMAND
^\s*
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
^\s*

This is going to nullify the use of ^. -> Error used to detect failures in our parsing

^\s*$$
^. -> Error

EOF
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
EOF

This should not be needed since there aren't any FillDowns

^\s*Swap:\s*${SWAP_TOTAL}\s*Total,\s*\d*\D*\s*Used,\s*${SWAP_FREE}\s*Free -> Record
^\s*Swap:\s*${SWAP_TOTAL}\s*Total,\s*\d*\D*\s*Used,\s*${SWAP_FREE}\s*Free,\s*\d*%\s*Inuse -> Record
^\s*Swap: -> Record
^\s*PID\s*USERNAME\s*PRI\s*NICE\s*SIZE\s*RES\s*STATE\s*C\s*TIME\s*WCPU\s*COMMAND
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
^\s*PID\s*USERNAME\s*PRI\s*NICE\s*SIZE\s*RES\s*STATE\s*C\s*TIME\s*WCPU\s*COMMAND
^\s*PID\s*USERNAME\s*PRI\s*NICE\s*SIZE\s*RES\s*STATE\s*C\s*TIME\s*WCPU\s*COMMAND -> EOF

We can end matching lines once we get to this point since we aren't capturing any of the process data

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants