Can I use nornir napalm to execute or run cli command which is not defined in NAPALM? I am using JUNOS device. I want to capture show system processes extensive and want to use NAPALM.
From Ansible: use napalm_cli
Form Salt: use napalm.junos_cli
From Python/nornir: use cli
Python nornir NAPALM to execute junos command. Do you have example snippet?
#!/usr/bin/env python3 from nornir import InitNornir from nornir.plugins.tasks.networking import napalm_cli from nornir.plugins.functions.text import print_result import sys # Limit traceback details sys.tracebacklimit = 0 nr = InitNornir(config_file='config.yaml') result = nr.run( napalm_cli, commands=["show system processes extensive"] ) print_result(result)
Thanks for your help gmcms, it helped:
result = nr.run( napalm_cli, commands=['show system processes extensive | match rpd', 'show system processes extensive | match mem'])
You can use regex rather than sending two times the same Junos command…
Yeah it was more of to test to see if it takes two commands in list or not.