https://github.com/dahai0013/Basic-python-with-Juniper/tree/master/python
change system message | system message labuser@saltsackmaster:~/project/python_script$ more chg_system_message.py from jnpr.junos import Device from jnpr.junos.utils.config import Config from pprint import pprint junos_hosts = [ '172.30.95.177' ] for ip in junos_hosts: ## open session with juniper divice dev = Device(host=ip, user='Netbox', password='Netbox') dev.open() ## Add or bound the configuration instance variable to the dev instan dev.bind(cu=Config) ## change config cmd_chg_hostname='set system login message "test jlk from python"' result = dev.cu.load(cmd_chg_hostname,format='set') pprint (result) dev.cu.pdiff() ## commit changes dev.cu.commit() ## close the session dev.close() |