I request assistance to write a script that needs to verify that EIGRP neighbourship shown in router before IOS upgrade is the same after IOS upgrade (and reload) as well. Below is a sample output of EIGRP neibourship that i need to verify after IOS upgrade. How can i write a script for that?
Sorry i didn’t frame my question properly. What i want to check is the number of entries in the output matches with the entries after IOS upgrade & reload.
I wrote the below script but i don’t think it would help this script compares the whole output and not just the no. of entgries. Since the timer in secs would keep chaging, this script will always show wrong result. Any other suggestion you have?
name: GATHER SHOW VERSION
ios_command:
commands: “show cdp nei”
register: show_cdp
debug:
msg: “{{ show_cdp.stdout_lines[0] | list }}”
I will compare the command within debug msg with the similar output extracted after IOS upgrade & reload.
However i noticed that this comamnd wrosk only when i give it as ‘{{ show_eigrp.stdout_lines[0] | count }}’. Ifg i were to give it as {{ show_eigrp.stdout_lines | count }}, it shown count as zero. Any idea why this difference happens?