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

MikroTik RouterOS 'tool profile' template #1504

Merged
Merged
Show file tree
Hide file tree
Changes from 2 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions ntc_templates/templates/index
Original file line number Diff line number Diff line change
Expand Up @@ -591,6 +591,7 @@ mikrotik_routeros_ip_route_print_terse.textfsm, .*, mikrotik_routeros, [[/]]ip(v
mikrotik_routeros_system_clock_print.textfsm, .*, mikrotik_routeros, [[/]]sy[[stem]] cl[[ock]] p[[rint]]
mikrotik_routeros_user_active_print.textfsm, .*, mikrotik_routeros, [[/]]us[[er]] ac[[tive]] p[[rint]]
mikrotik_routeros_ip_address_print.textfsm, .*, mikrotik_routeros, [[/]]ip ad[[dress]] p[[rint]]
mikrotik_routeros_tool_profile.textfsm, .*, mikrotik_routeros, [[/]]too[[l]] pr[[ofile]]

paloalto_panos_show_running_security-policy.textfsm, .*, paloalto_panos, sh[[ow]] runn[[ing]] security[[-policy]]
paloalto_panos_show_high-availability_all.textfsm, .*, paloalto_panos, sh[[ow]] high[[-availability]] all
Expand Down
15 changes: 15 additions & 0 deletions ntc_templates/templates/mikrotik_routeros_tool_profile.textfsm
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
Value NAME (\S+)
Value CPU (\S+)
Value USAGE (\d+|\d+.\d+)

Start
^\s*NAME\s+CPU\s+USAGE\s*$$ -> ProfilingTable
^\s*$$
^. -> Error

ProfilingTable
^\s*${NAME}\s*(\s+${CPU})?\s+${USAGE}%\s*$$ -> Record
^\s*--\s+\[Q\s+quit\|D\s+dump\|C-z\s+pause\]\s*$$
^\s*--\s+\[Q\s+quit\|C-z\s+pause\]\s*$$
^\s*$$
^. -> Error
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
NAME CPU USAGE
spi 1%
console 0%
firewall 0.5%
networking 0%
management 0.5%
profiling 0%
unclassified 0.5%
total 2.5%
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
---
parsed_sample:
- name: "spi"
cpu: ""
usage: "1"
- name: "console"
cpu: ""
usage: "0"
- name: "firewall"
cpu: ""
usage: "0.5"
- name: "networking"
cpu: ""
usage: "0"
- name: "management"
cpu: ""
usage: "0.5"
- name: "profiling"
cpu: ""
usage: "0"
- name: "unclassified"
cpu: ""
usage: "0.5"
- name: "total"
cpu: ""
usage: "2.5"
Loading