diff --git a/ntc_templates/templates/index b/ntc_templates/templates/index index 1d151415fe..15ffb44fed 100644 --- a/ntc_templates/templates/index +++ b/ntc_templates/templates/index @@ -722,6 +722,7 @@ mikrotik_routeros_system_clock_print.textfsm, .*, mikrotik_routeros, [[/]]sy[[st 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_ip_arp_print.textfsm, .*, mikrotik_routeros, [[/]]ip a[[rp]] p[[rint]] +mikrotik_routeros_tool_profile.textfsm, .*, mikrotik_routeros, [[/]]too[[l]] pr[[ofile]] mikrotik_routeros_ping.textfsm, .*, mikrotik_routeros, [[/]]pin[[g]] oneaccess_oneos_show_voice_voip-call_active_all.textfsm, .*, oneaccess_oneos, sh[[ow]] voice voip-call active diff --git a/ntc_templates/templates/mikrotik_routeros_tool_profile.textfsm b/ntc_templates/templates/mikrotik_routeros_tool_profile.textfsm new file mode 100644 index 0000000000..9ac1c7b7f8 --- /dev/null +++ b/ntc_templates/templates/mikrotik_routeros_tool_profile.textfsm @@ -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 diff --git a/tests/mikrotik_routeros/tool_profile/mikrotik_routeros_tool_profile.raw b/tests/mikrotik_routeros/tool_profile/mikrotik_routeros_tool_profile.raw new file mode 100644 index 0000000000..04d7c9b79e --- /dev/null +++ b/tests/mikrotik_routeros/tool_profile/mikrotik_routeros_tool_profile.raw @@ -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% diff --git a/tests/mikrotik_routeros/tool_profile/mikrotik_routeros_tool_profile.yml b/tests/mikrotik_routeros/tool_profile/mikrotik_routeros_tool_profile.yml new file mode 100644 index 0000000000..5fa5a3d3c9 --- /dev/null +++ b/tests/mikrotik_routeros/tool_profile/mikrotik_routeros_tool_profile.yml @@ -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"