genieparser icon indicating copy to clipboard operation
genieparser copied to clipboard

[IOS-XR] Parser Output is empty - Failed to parse command output for "show install active summary"

Open amhunt-at-cisco opened this issue 1 year ago • 5 comments

Hey, thanks for looking into this!

Issue: When trying to feed in the full output of "show install active summary" from an 8000 Series Router IOS XR device into parse genie I get "Parser Output is empty - Failed to parse command output".

In troubleshooting the output is being passed in and displays fine on console, the genie just can't parse it. It's worth noting that the command isn't set up with exact columns and some of the column titles are identical repeats, so building my own tabular parser also isn't effective.

To Reproduce I used the following in my playbook:

#----------------------------------Show Install Active Summary------------------------------------------  
- name: Read in parse_genie role
  include_role:
    name: clay584.parse_genie

# Capturing information from Router - XR_VM
- name: Executing 'show install active summary'
  cli_command:
    command: show install active summary
  register: cli_output

- name: Getting status
  debug:
    msg: "{{ cli_output }}"
  no_log: False

# Added the part after os=iosxr to allow parser genie to read my template 
- name: Parsing "show install active summary" output 
  set_fact:
    xr_vm_active_summary_parsed_output: "{{ cli_output.stdout | parse_genie(command='show install active summary', os='iosxr' ) }}"
   no_log: False

This is part of a large ongoing project so I attached the entire playbook zipped which can be run with the following command: ansible-playbook -i hostinvent EA2-Main-Playbook.yml --vault-password-file vault_password.yml

To navigate to the playbook that reproduces the issue go to roles > Software_Info_Capture > tasks > show_install_active_summary.yml

I also attached just the output of that command as a text file.

The devices in the hostinvent file are the lab devices in autopod : https://cx-labs.cisco.com/pods/1188/short If you check them out and can SSH to at least one of them (10.88.146.243), nothing else is needed to reproduce.

Feel free to ping me at amhunt for any questions.

Mult-Stage XR OS Upgrade & Rollback.zip [show_install_active_summary.txt ](url)

amhunt-at-cisco avatar Feb 23 '24 16:02 amhunt-at-cisco

Hi amhunt,

I am working on it.Kindly give me some time

Thank you!

Harishv01 avatar Mar 04 '24 12:03 Harishv01

Thank you so much for looking at it!

amhunt-at-cisco avatar Mar 04 '24 20:03 amhunt-at-cisco

Hi , why are there duplicate sections in your output? Please verify your output and let me know.

Harishv01 avatar Mar 05 '24 14:03 Harishv01

Sorry about that! I replaced the file with the correct output.

I checked with ansible debug to see what I was sending the genie in case that was the problem but unfortunately I am sending the one I just uploaded (meaning... I am not sending the genie corrupt input).

amhunt-at-cisco avatar Mar 05 '24 20:03 amhunt-at-cisco

show install active summary_output.txt

When we add support for the command 'show install active summary' it will print output like below. If you are okay with it, I will raise a PR.

Harishv01 avatar Mar 07 '24 10:03 Harishv01

Hi, I have raised a draft PR.

Harishv01 avatar Mar 11 '24 16:03 Harishv01

Once it is merged, I will let you know.

Thank you.

Harishv01 avatar Mar 11 '24 16:03 Harishv01

Hi,

I have merged the PR just now. The fix will be available in version 24.4 and the build is available after 24 hrs, the fix will be accessible in the pre-flag. Hence I am closing the ticket

pyats version update --pre

Thank you!

Harishv01 avatar Apr 02 '24 13:04 Harishv01